@wix/blog 1.0.702 → 1.0.704
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 +2 -2
- package/_sdk-exports/context-post/runtime.d.ts +195 -115
- package/_sdk-exports/context-post/runtime.js +2 -5
- package/_sdk-exports/context-post-by-id/runtime.js +3 -3
- package/_sdk-exports/context-post-by-slug/runtime.d.ts +18 -0
- package/_sdk-exports/context-post-by-slug/runtime.js +5 -0
- package/_sdk-exports/context-post-item/runtime.d.ts +5 -6
- package/_sdk-exports/context-post-item/runtime.js +4 -4
- package/_sdk-exports/context-post-list-item/runtime.d.ts +508 -0
- package/_sdk-exports/context-post-list-item/runtime.js +5 -0
- package/_sdk-exports/context-related-posts/runtime.js +2 -2
- package/build/cjs/context-blog-feed.js +1 -1
- package/build/cjs/context-blog-feed.js.map +1 -1
- package/build/cjs/context-post-by-id.js +534 -496
- package/build/cjs/context-post-by-id.js.map +1 -1
- package/build/cjs/context-post-by-slug.d.ts +18 -0
- package/build/cjs/context-post-by-slug.js +5455 -0
- package/build/cjs/context-post-by-slug.js.map +1 -0
- package/build/cjs/context-post-item.d.ts +5 -6
- package/build/cjs/context-post-item.js +804 -788
- package/build/cjs/context-post-item.js.map +1 -1
- package/build/cjs/context-post-list-item.d.ts +508 -0
- package/build/cjs/context-post-list-item.js +3698 -0
- package/build/cjs/context-post-list-item.js.map +1 -0
- package/build/cjs/context-post.d.ts +195 -115
- package/build/cjs/context-post.js +342 -5175
- package/build/cjs/context-post.js.map +1 -1
- package/build/cjs/context-related-posts.js +1 -1
- package/build/cjs/context-related-posts.js.map +1 -1
- package/build/es/context-blog-feed.mjs +1 -1
- package/build/es/context-blog-feed.mjs.map +1 -1
- package/build/es/context-post-by-id.mjs +534 -496
- package/build/es/context-post-by-id.mjs.map +1 -1
- package/build/es/context-post-by-slug.d.mts +18 -0
- package/build/es/context-post-by-slug.mjs +5415 -0
- package/build/es/context-post-by-slug.mjs.map +1 -0
- package/build/es/context-post-item.d.mts +5 -6
- package/build/es/context-post-item.mjs +803 -798
- package/build/es/context-post-item.mjs.map +1 -1
- package/build/es/context-post-list-item.d.mts +508 -0
- package/build/es/context-post-list-item.mjs +3657 -0
- package/build/es/context-post-list-item.mjs.map +1 -0
- package/build/es/context-post.d.mts +195 -115
- package/build/es/context-post.mjs +341 -5173
- package/build/es/context-post.mjs.map +1 -1
- package/build/es/context-related-posts.mjs +1 -1
- package/build/es/context-related-posts.mjs.map +1 -1
- package/build/internal/cjs/context-post-by-slug.d.ts +18 -0
- package/build/internal/cjs/context-post-item.d.ts +5 -6
- package/build/internal/cjs/context-post-list-item.d.ts +508 -0
- package/build/internal/cjs/context-post.d.ts +195 -115
- package/build/internal/es/context-post-by-slug.d.mts +18 -0
- package/build/internal/es/context-post-item.d.mts +5 -6
- package/build/internal/es/context-post-list-item.d.mts +508 -0
- package/build/internal/es/context-post.d.mts +195 -115
- package/context/post-by-slug/package.json +3 -0
- package/context/post-list-item/package.json +3 -0
- package/package.json +26 -2
- package/post-by-slug-context-provider/package.json +3 -0
- package/post-list-item-context-provider/package.json +3 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,34 +17,44 @@ var __copyProps = (to2, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to2;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// context-post-item.ts
|
|
21
31
|
var context_post_item_exports = {};
|
|
22
32
|
__export(context_post_item_exports, {
|
|
23
|
-
PostItemContextProvider: () =>
|
|
24
|
-
default: () =>
|
|
25
|
-
injectAccessTokenGetter: () =>
|
|
26
|
-
usePostItemContext: () =>
|
|
33
|
+
PostItemContextProvider: () => ms,
|
|
34
|
+
default: () => ms,
|
|
35
|
+
injectAccessTokenGetter: () => hs,
|
|
36
|
+
usePostItemContext: () => fs,
|
|
37
|
+
usePostListItemContext: () => fs
|
|
27
38
|
});
|
|
28
39
|
module.exports = __toCommonJS(context_post_item_exports);
|
|
29
40
|
|
|
30
41
|
// _sdk-exports/context-post-item/runtime.js
|
|
42
|
+
var import_post_context_provider = __toESM(require("@wix/blog/post-context-provider"));
|
|
31
43
|
var import_react = require("react");
|
|
32
44
|
var import_services_manager_react = require("@wix/services-manager-react");
|
|
33
45
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
46
|
var import_meta = {};
|
|
35
|
-
var
|
|
36
|
-
var
|
|
47
|
+
var p = Object.defineProperty;
|
|
48
|
+
var m = (e6, t2) => {
|
|
37
49
|
let n2 = {};
|
|
38
|
-
for (var r2 in e6)
|
|
39
|
-
return t2 ||
|
|
50
|
+
for (var r2 in e6) p(n2, r2, { get: e6[r2], enumerable: true });
|
|
51
|
+
return t2 || p(n2, Symbol.toStringTag, { value: `Module` }), n2;
|
|
40
52
|
};
|
|
41
|
-
var
|
|
42
|
-
function
|
|
53
|
+
var h = {};
|
|
54
|
+
function g(e6, t2 = false, n2 = (e7) => e7) {
|
|
43
55
|
return () => ({ __type: `event-definition`, type: e6, isDomainEvent: t2, transformations: n2 });
|
|
44
56
|
}
|
|
45
|
-
var
|
|
57
|
+
var _ = (e6) => {
|
|
46
58
|
switch (e6) {
|
|
47
59
|
case `get`:
|
|
48
60
|
case `GET`:
|
|
@@ -69,11 +81,11 @@ var g = (e6) => {
|
|
|
69
81
|
throw Error(`Unknown method: ${e6}`);
|
|
70
82
|
}
|
|
71
83
|
};
|
|
72
|
-
var
|
|
84
|
+
var v = (e6) => (t2) => async (n2) => {
|
|
73
85
|
let r2, i2 = (t3) => {
|
|
74
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.`);
|
|
75
87
|
let { method: i3, url: a2, params: o2 } = r2;
|
|
76
|
-
return { ...r2, method:
|
|
88
|
+
return { ...r2, method: _(i3), url: a2, data: r2.data, params: o2 };
|
|
77
89
|
};
|
|
78
90
|
try {
|
|
79
91
|
let e7 = await t2.request(i2);
|
|
@@ -86,10 +98,10 @@ var _ = (e6) => (t2) => async (n2) => {
|
|
|
86
98
|
throw typeof e7 == `object` && e7 && `response` in e7 && typeof e7.response == `object` && e7.response !== null && `data` in e7.response ? e7.response.data : e7;
|
|
87
99
|
}
|
|
88
100
|
};
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
var
|
|
101
|
+
var y = (e6) => e6.__isAmbassador ? true : !!e6().__isAmbassador;
|
|
102
|
+
var b = `__metadata`;
|
|
103
|
+
var x = `edge.wixapis.com`;
|
|
104
|
+
var S = class extends Error {
|
|
93
105
|
message;
|
|
94
106
|
response;
|
|
95
107
|
constructor(e6, t2) {
|
|
@@ -97,108 +109,108 @@ var x = class extends Error {
|
|
|
97
109
|
}
|
|
98
110
|
async details() {
|
|
99
111
|
let e6 = await this.response.json();
|
|
100
|
-
return
|
|
112
|
+
return C(this.response.status, e6?.message, e6?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e6 });
|
|
101
113
|
}
|
|
102
114
|
};
|
|
103
|
-
var
|
|
104
|
-
var
|
|
105
|
-
var
|
|
106
|
-
var
|
|
107
|
-
function
|
|
115
|
+
var C = (e6, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e6, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
116
|
+
var ee = (e6) => e6?.method && [`post`, `put`, `patch`].includes(e6.method.toLocaleLowerCase()) && e6.body ? { "Content-Type": `application/json` } : {};
|
|
117
|
+
var w = (e6) => e6 && typeof e6 == `object` && !Array.isArray(e6);
|
|
118
|
+
var T = (e6) => e6.__type === `host`;
|
|
119
|
+
function te(e6, t2) {
|
|
108
120
|
return e6.create(t2);
|
|
109
121
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
112
|
-
return { [
|
|
122
|
+
var ne = `x-wix-bi-gateway`;
|
|
123
|
+
function re(e6, t2, n2) {
|
|
124
|
+
return { [ne]: ie({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e6.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e6.methodFqn, entity: e6.entityFqdn }) };
|
|
113
125
|
}
|
|
114
|
-
function
|
|
126
|
+
function ie(e6) {
|
|
115
127
|
return Object.entries(e6).filter(([e7, t2]) => !!t2).map(([e7, t2]) => `${e7}=${t2}`).join(`,`);
|
|
116
128
|
}
|
|
117
|
-
function
|
|
118
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
119
|
-
globalThis.__wix_context__ = void 0,
|
|
129
|
+
function ae(e6) {
|
|
130
|
+
let t2 = globalThis.__wix_context__, n2 = { client: h.client, elevatedClient: h.elevatedClient }, r2;
|
|
131
|
+
globalThis.__wix_context__ = void 0, h.client = void 0, h.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
120
132
|
try {
|
|
121
133
|
return e6();
|
|
122
134
|
} finally {
|
|
123
|
-
globalThis.__wix_context__ = t2,
|
|
135
|
+
globalThis.__wix_context__ = t2, h.client = n2.client, h.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
124
136
|
}
|
|
125
137
|
}
|
|
126
|
-
var
|
|
127
|
-
function
|
|
128
|
-
return
|
|
138
|
+
var oe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
139
|
+
function se(e6) {
|
|
140
|
+
return fe(e6).map((e7) => e7.toLocaleUpperCase()).join(`_`);
|
|
129
141
|
}
|
|
130
|
-
var
|
|
131
|
-
var
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
function
|
|
142
|
+
var ce = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
143
|
+
var le = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
144
|
+
var ue = `$1\0$2`;
|
|
145
|
+
var de = /[^\p{L}\d]+/giu;
|
|
146
|
+
function fe(e6) {
|
|
135
147
|
let t2 = e6.trim();
|
|
136
|
-
t2 = t2.replace(
|
|
148
|
+
t2 = t2.replace(ce, ue).replace(le, ue), t2 = t2.replace(de, `\0`);
|
|
137
149
|
let n2 = 0, r2 = t2.length;
|
|
138
150
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
139
151
|
if (n2 === r2) return [];
|
|
140
152
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
141
153
|
return t2.slice(n2, r2).split(/\0/g);
|
|
142
154
|
}
|
|
143
|
-
var
|
|
144
|
-
var
|
|
145
|
-
var
|
|
146
|
-
function
|
|
155
|
+
var pe = (e6) => `validationError` in (e6.response?.data?.details ?? {});
|
|
156
|
+
var me = (e6) => `applicationError` in (e6.response?.data?.details ?? {});
|
|
157
|
+
var he = (e6) => (e6.response?.status ?? -1) >= 400 && (e6.response?.status ?? -1) < 500;
|
|
158
|
+
function ge(e6, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
147
159
|
if (typeof e6 != `object` || !e6) throw e6;
|
|
148
|
-
if (
|
|
149
|
-
if (
|
|
150
|
-
if (
|
|
151
|
-
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
152
|
-
return
|
|
160
|
+
if (pe(e6)) return _e(e6, t2, n2);
|
|
161
|
+
if (me(e6)) return ye(e6);
|
|
162
|
+
if (he(e6)) {
|
|
163
|
+
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: se(n3), data: {} }, requestId: e6.requestId };
|
|
164
|
+
return ve(e6, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
153
165
|
}
|
|
154
|
-
return
|
|
166
|
+
return be(e6);
|
|
155
167
|
}
|
|
156
|
-
var
|
|
157
|
-
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
158
|
-
return
|
|
168
|
+
var _e = (e6, t2, n2) => {
|
|
169
|
+
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = xe(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 ve(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e6.response?.status, requestId: i2 } });
|
|
159
171
|
};
|
|
160
|
-
var
|
|
161
|
-
var
|
|
162
|
-
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 ??
|
|
163
|
-
return
|
|
172
|
+
var ve = (e6, { message: t2, extraProperties: n2 }) => Object.assign(e6, { ...n2, message: t2 });
|
|
173
|
+
var ye = (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 ?? se(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 ve(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e6.requestId } });
|
|
164
176
|
};
|
|
165
|
-
var
|
|
166
|
-
var
|
|
177
|
+
var be = (e6) => ve(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: se(e6.response?.statusText ?? `UNKNOWN`), ...!e6.response && { runtimeError: e6 } } });
|
|
178
|
+
var xe = ({ spreadPathsToArguments: e6, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
167
179
|
let a2 = { ...e6, ...t2 }, o2 = Object.keys(a2);
|
|
168
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) => {
|
|
169
181
|
let r3 = t2[e7.field];
|
|
170
|
-
if (r3) return { ...e7, field:
|
|
182
|
+
if (r3) return { ...e7, field: Se(r3, i2) };
|
|
171
183
|
let s2 = o2?.sort((e8, t3) => t3.length - e8.length)?.find((t3) => e7.field.startsWith(t3));
|
|
172
184
|
if (s2) {
|
|
173
185
|
let t3 = a2[s2];
|
|
174
|
-
if (t3) return { ...e7, field: e7.field.replace(s2,
|
|
186
|
+
if (t3) return { ...e7, field: e7.field.replace(s2, Se(t3, i2)) };
|
|
175
187
|
}
|
|
176
188
|
return n2 ? { ...e7, field: `${i2[0]}.${e7.field}` } : e7;
|
|
177
189
|
});
|
|
178
190
|
};
|
|
179
|
-
var
|
|
180
|
-
let n2 =
|
|
191
|
+
var Se = (e6, t2) => {
|
|
192
|
+
let n2 = Ce(e6);
|
|
181
193
|
return n2 == null ? e6 : e6.replace(`$[${n2}]`, t2[n2]);
|
|
182
194
|
};
|
|
183
|
-
var
|
|
195
|
+
var Ce = (e6) => {
|
|
184
196
|
let t2 = e6.match(/\$\[(?<argIndex>\d+)\]/);
|
|
185
197
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
186
198
|
};
|
|
187
|
-
function
|
|
188
|
-
return
|
|
199
|
+
function we(e6, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
200
|
+
return ae(() => e6({ request: async (e7) => {
|
|
189
201
|
let i3 = e7({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
190
202
|
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
191
|
-
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ?
|
|
203
|
+
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? x : o3}${a3.url}`;
|
|
192
204
|
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
193
205
|
try {
|
|
194
|
-
let e8 =
|
|
206
|
+
let e8 = re(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e8 } }, s3 = await n2(u3, o4);
|
|
195
207
|
if (s3.status !== 200) {
|
|
196
208
|
let e9 = null;
|
|
197
209
|
try {
|
|
198
210
|
e9 = await s3.json();
|
|
199
211
|
} catch {
|
|
200
212
|
}
|
|
201
|
-
let t3 =
|
|
213
|
+
let t3 = Ee(s3.status, e9?.message ?? s3.statusText, e9?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e9 }), n3 = ge(t3);
|
|
202
214
|
throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
|
|
203
215
|
}
|
|
204
216
|
let l3 = await s3.json();
|
|
@@ -208,18 +220,18 @@ function Ce(e6, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
208
220
|
}
|
|
209
221
|
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
210
222
|
}
|
|
211
|
-
var
|
|
223
|
+
var Te = class extends Error {
|
|
212
224
|
response;
|
|
213
225
|
requestId;
|
|
214
226
|
constructor(e6) {
|
|
215
227
|
super(), this.response = e6.response, this.requestId = e6.requestId;
|
|
216
228
|
}
|
|
217
229
|
};
|
|
218
|
-
var
|
|
219
|
-
var
|
|
220
|
-
function
|
|
230
|
+
var Ee = (e6, t2, n2, r2) => new Te({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e6, data: r2 } }, ...n2 }, message: t2 }, status: e6 }, requestId: r2?.requestId });
|
|
231
|
+
var De = `.`;
|
|
232
|
+
function Oe(e6, t2, n2) {
|
|
221
233
|
if (e6 == null) throw Error(`Cannot set value on null or undefined`);
|
|
222
|
-
let r2 =
|
|
234
|
+
let r2 = ke(t2), i2 = e6;
|
|
223
235
|
for (let e7 = 0; e7 < r2.length; e7++) {
|
|
224
236
|
let t3 = r2[e7];
|
|
225
237
|
if (e7 === r2.length - 1) {
|
|
@@ -231,21 +243,21 @@ function De(e6, t2, n2) {
|
|
|
231
243
|
}
|
|
232
244
|
return e6;
|
|
233
245
|
}
|
|
234
|
-
function Oe(e6) {
|
|
235
|
-
return Array.isArray(e6) ? e6 : e6.split(Ee).map((e7) => ke(e7) ? Number(e7) : e7);
|
|
236
|
-
}
|
|
237
246
|
function ke(e6) {
|
|
238
|
-
return
|
|
247
|
+
return Array.isArray(e6) ? e6 : e6.split(De).map((e7) => Ae(e7) ? Number(e7) : e7);
|
|
239
248
|
}
|
|
240
249
|
function Ae(e6) {
|
|
250
|
+
return /^\d+$/.test(e6);
|
|
251
|
+
}
|
|
252
|
+
function je(e6) {
|
|
241
253
|
let t2 = {};
|
|
242
|
-
for (let [n2, r2] of Object.entries(e6))
|
|
254
|
+
for (let [n2, r2] of Object.entries(e6)) Me(n2) || Oe(t2, ke(n2), r2);
|
|
243
255
|
return t2;
|
|
244
256
|
}
|
|
245
|
-
function
|
|
257
|
+
function Me(e6) {
|
|
246
258
|
return e6 === `__proto__` || e6 === `constructor` || e6 === `prototype`;
|
|
247
259
|
}
|
|
248
|
-
var
|
|
260
|
+
var Ne = class {
|
|
249
261
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
250
262
|
NUMERIC_PATTERN = /^\d+$/;
|
|
251
263
|
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
@@ -268,7 +280,7 @@ var Me = class {
|
|
|
268
280
|
return e6.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
269
281
|
}
|
|
270
282
|
unflatten() {
|
|
271
|
-
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])), je(this.cleanedModifiedFields);
|
|
272
284
|
}
|
|
273
285
|
flatten(e6) {
|
|
274
286
|
let t2 = {};
|
|
@@ -288,12 +300,12 @@ var Me = class {
|
|
|
288
300
|
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
289
301
|
r2.push(`[${e7}]`), n2 = n2[parseInt(e7, 10)];
|
|
290
302
|
}, a2 = (e7, t3) => {
|
|
291
|
-
let i3 = e7 in
|
|
303
|
+
let i3 = e7 in oe ? oe[e7] : void 0;
|
|
292
304
|
if (i3 && i3 in t3) {
|
|
293
305
|
r2.push(i3), n2 = t3[i3];
|
|
294
306
|
return;
|
|
295
307
|
}
|
|
296
|
-
let a3 =
|
|
308
|
+
let a3 = Le(e7);
|
|
297
309
|
if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
|
|
298
310
|
else throw Error(`Cannot find key '${e7}' or its transformations at path ${this.buildPathString(r2)}`);
|
|
299
311
|
}, o2 = (e7, t3) => {
|
|
@@ -317,28 +329,28 @@ var Me = class {
|
|
|
317
329
|
return e6.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e6[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
318
330
|
}
|
|
319
331
|
};
|
|
320
|
-
function
|
|
332
|
+
function Pe(e6, t2) {
|
|
321
333
|
let n2 = e6?.modifiedFields;
|
|
322
334
|
if (!n2) return null;
|
|
323
|
-
let r2 =
|
|
335
|
+
let r2 = Fe(n2);
|
|
324
336
|
if (!r2) return null;
|
|
325
337
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
326
338
|
e6 = { ...e6, modifiedFields: i2 };
|
|
327
339
|
let o2 = t2(e6), s2 = o2?.modifiedFields;
|
|
328
340
|
if (!s2) return null;
|
|
329
|
-
let c2 =
|
|
341
|
+
let c2 = Ie(s2, a2);
|
|
330
342
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
331
343
|
}
|
|
332
|
-
function
|
|
344
|
+
function Fe(e6) {
|
|
333
345
|
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) try {
|
|
334
|
-
let t2 = new
|
|
346
|
+
let t2 = new Ne(e6);
|
|
335
347
|
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
336
348
|
} catch {
|
|
337
349
|
return null;
|
|
338
350
|
}
|
|
339
351
|
return null;
|
|
340
352
|
}
|
|
341
|
-
function
|
|
353
|
+
function Ie(e6, t2) {
|
|
342
354
|
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) try {
|
|
343
355
|
return t2.flatten(e6);
|
|
344
356
|
} catch {
|
|
@@ -346,10 +358,10 @@ function Fe(e6, t2) {
|
|
|
346
358
|
}
|
|
347
359
|
return null;
|
|
348
360
|
}
|
|
349
|
-
function
|
|
361
|
+
function Le(e6) {
|
|
350
362
|
return e6.replace(/[-_\s]+(.)?/g, (e7, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e7) => e7.toLowerCase());
|
|
351
363
|
}
|
|
352
|
-
function
|
|
364
|
+
function Re() {
|
|
353
365
|
return { emit(e6, ...t2) {
|
|
354
366
|
for (let n2 = 0, r2 = this.events[e6] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
355
367
|
}, events: {}, on(e6, t2) {
|
|
@@ -358,8 +370,8 @@ function Le() {
|
|
|
358
370
|
};
|
|
359
371
|
} };
|
|
360
372
|
}
|
|
361
|
-
var
|
|
362
|
-
function
|
|
373
|
+
var ze = (e6) => e6.__type === `event-definition`;
|
|
374
|
+
function Be(e6, t2, n2, r2) {
|
|
363
375
|
let i2;
|
|
364
376
|
if (e6.isDomainEvent) {
|
|
365
377
|
let { deletedEvent: e7, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
@@ -370,14 +382,14 @@ function ze(e6, t2, n2, r2) {
|
|
|
370
382
|
let e7 = s2.modifiedFields;
|
|
371
383
|
if (typeof e7 == `object` && e7 && !Array.isArray(e7)) {
|
|
372
384
|
o2 = structuredClone(i2);
|
|
373
|
-
let e8 =
|
|
385
|
+
let e8 = Pe(s2, a2);
|
|
374
386
|
if (e8) return t2(e8);
|
|
375
387
|
}
|
|
376
388
|
}
|
|
377
389
|
return t2(a2(o2));
|
|
378
390
|
}
|
|
379
|
-
function
|
|
380
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
391
|
+
function Ve(e6) {
|
|
392
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Re();
|
|
381
393
|
return { initModule(e7) {
|
|
382
394
|
return (r2) => {
|
|
383
395
|
let i2 = t2.get(e7.type) ?? [];
|
|
@@ -387,7 +399,7 @@ function Be(e6) {
|
|
|
387
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 }))];
|
|
388
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(`, `)}`);
|
|
389
401
|
let l2 = t2.get(r2) ?? [];
|
|
390
|
-
return await Promise.all(l2.map(({ eventDefinition: e8, handler: t3 }) =>
|
|
402
|
+
return await Promise.all(l2.map(({ eventDefinition: e8, handler: t3 }) => Be(e8, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
391
403
|
}, async processRequest(e7, t3) {
|
|
392
404
|
let n3 = await e7.text();
|
|
393
405
|
return this.process(n3, t3);
|
|
@@ -406,12 +418,12 @@ function Be(e6) {
|
|
|
406
418
|
let n3 = Array.from(t2.keys()).map((e8) => ({ type: e8 }));
|
|
407
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(`, `)}`);
|
|
408
420
|
let r2 = t2.get(e7.eventType) ?? [];
|
|
409
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) =>
|
|
410
|
-
}, apps: { AppInstalled:
|
|
421
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Be(t3, n4, e7.payload, { instanceId: e7.instanceId, identity: e7.identity })));
|
|
422
|
+
}, apps: { AppInstalled: g(`AppInstalled`)(), AppRemoved: g(`AppRemoved`)() } } };
|
|
411
423
|
}
|
|
412
|
-
var
|
|
413
|
-
function
|
|
414
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
424
|
+
var He = (e6) => e6.__type === `service-plugin-definition`;
|
|
425
|
+
function Ue(e6) {
|
|
426
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Re();
|
|
415
427
|
return { initModule(e7) {
|
|
416
428
|
return (r2) => {
|
|
417
429
|
let i2 = t2.get(e7.componentType.toLowerCase()) ?? [];
|
|
@@ -453,76 +465,76 @@ function He(e6) {
|
|
|
453
465
|
} } };
|
|
454
466
|
}
|
|
455
467
|
var E = `X-Wix-Consistent`;
|
|
456
|
-
function
|
|
468
|
+
function We(e6) {
|
|
457
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) => {
|
|
458
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?.();
|
|
459
471
|
try {
|
|
460
472
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
461
473
|
let e7 = await i3(n3, { ...r3, headers: c3 });
|
|
462
474
|
l3?.handleError(e7, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
463
|
-
let a3 =
|
|
475
|
+
let a3 = Ge(e7);
|
|
464
476
|
return a3 && (t2[E] = a3), e7;
|
|
465
477
|
}
|
|
466
478
|
{
|
|
467
479
|
for (let [e8, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e8, t3);
|
|
468
480
|
let e7 = await i3(n3, r3);
|
|
469
481
|
l3?.handleError(e7, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
470
|
-
let a3 =
|
|
482
|
+
let a3 = Ge(e7);
|
|
471
483
|
return a3 && (t2[E] = a3), e7;
|
|
472
484
|
}
|
|
473
485
|
} catch (e7) {
|
|
474
486
|
throw l3?.handleError(e7, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e7;
|
|
475
487
|
}
|
|
476
|
-
}, { client: c2, initModule: l2 } =
|
|
477
|
-
let i3 = o2(), s3 = await a2(), c3 =
|
|
488
|
+
}, { client: c2, initModule: l2 } = Ue(i2), { client: u2, initModule: d2 } = Ve(i2), f2 = async (n3, r3) => {
|
|
489
|
+
let i3 = o2(), s3 = await a2(), c3 = ee(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 = Ge(l3);
|
|
478
490
|
return u3 && (t2[E] = u3), l3;
|
|
479
491
|
}, p2 = (t3, n3) => {
|
|
480
|
-
if (
|
|
481
|
-
if (
|
|
482
|
-
if (
|
|
492
|
+
if (ze(t3)) return d2(t3);
|
|
493
|
+
if (He(t3)) return l2(t3);
|
|
494
|
+
if (T(t3) && e6.host) return te(t3, e6.host);
|
|
483
495
|
if (typeof t3 == `function`) {
|
|
484
496
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
485
497
|
let r3 = e6.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e6.useCDN === void 0 ? i2().shouldUseCDN : e6.useCDN;
|
|
486
|
-
return
|
|
498
|
+
return we(ae(() => y(t3)) ? v(t3) : t3, n3 ?? {}, f2, e6.host?.getErrorHandler?.(), (e7, t4) => {
|
|
487
499
|
let n4 = new URL(e7, `https://${r3}`);
|
|
488
500
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
489
501
|
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e6.host?.name, o3, e6.validateRequestSchema);
|
|
490
502
|
}
|
|
491
|
-
return
|
|
492
|
-
},
|
|
503
|
+
return w(t3) ? Object.fromEntries(Object.entries(t3).map(([e7, n4]) => [e7, p2(n4, t3[b])])) : t3;
|
|
504
|
+
}, m2 = (e7) => {
|
|
493
505
|
for (let n3 in e7) t2[n3] = e7[n3];
|
|
494
506
|
};
|
|
495
507
|
return { ...e6.modules ? p2(e6.modules) : {}, get auth() {
|
|
496
508
|
let t3 = i2();
|
|
497
509
|
return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e6.host), t3;
|
|
498
|
-
}, setHeaders:
|
|
499
|
-
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 ?
|
|
510
|
+
}, setHeaders: m2, use: p2, enableContext(e7, t3 = { elevated: false }) {
|
|
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 ? h.elevatedClient = this : h.client = this;
|
|
500
512
|
}, fetch: (t3, n3) => {
|
|
501
513
|
let r3 = e6.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
|
|
502
514
|
return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
|
|
503
515
|
}, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
|
|
504
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 }) });
|
|
505
|
-
if (a3.status !== 200) throw new
|
|
517
|
+
if (a3.status !== 200) throw new S(`GraphQL request failed with status ${a3.status}`, a3);
|
|
506
518
|
let { data: o3, errors: s3 } = await a3.json();
|
|
507
519
|
return { data: o3 ?? {}, errors: s3 };
|
|
508
520
|
}, webhooks: u2, servicePlugins: c2 };
|
|
509
521
|
}
|
|
510
|
-
function
|
|
522
|
+
function Ge(e6) {
|
|
511
523
|
return e6.headers?.get(`X-Wix-Consistent`) ?? e6.headers?.get(`x-wix-consistent`);
|
|
512
524
|
}
|
|
513
|
-
var
|
|
514
|
-
var
|
|
515
|
-
var
|
|
516
|
-
var
|
|
517
|
-
var
|
|
518
|
-
function
|
|
525
|
+
var Ke = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
526
|
+
var qe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
527
|
+
var Je = `items`;
|
|
528
|
+
var Ye = `pagingMetadata`;
|
|
529
|
+
var Xe = Ke;
|
|
530
|
+
function Ze(e6, t2) {
|
|
519
531
|
return e6?.split(`.`).map((e7) => t2?.[e7] ?? e7).join(`.`);
|
|
520
532
|
}
|
|
521
|
-
var
|
|
522
|
-
function Qe(e6, t2, n2) {
|
|
523
|
-
return (e6 === Ze || e6.endsWith(`.${Ze}`)) && typeof t2 == `string` ? Xe(t2, n2) : t2;
|
|
524
|
-
}
|
|
533
|
+
var Qe = `sort.fieldName`;
|
|
525
534
|
function $e(e6, t2, n2) {
|
|
535
|
+
return (e6 === Qe || e6.endsWith(`.${Qe}`)) && typeof t2 == `string` ? Ze(t2, n2) : t2;
|
|
536
|
+
}
|
|
537
|
+
function et(e6, t2, n2) {
|
|
526
538
|
let r2 = (e7) => n2.includes(e7), i2 = (e7, n3) => {
|
|
527
539
|
if (Array.isArray(e7)) e7.forEach((e8) => {
|
|
528
540
|
i2(e8, n3);
|
|
@@ -532,160 +544,160 @@ function $e(e6, t2, n2) {
|
|
|
532
544
|
Object.keys(a2).forEach((e8) => {
|
|
533
545
|
let o2 = n3 === `` ? e8 : `${n3}.${e8}`;
|
|
534
546
|
if (r2(o2)) return;
|
|
535
|
-
let s2 =
|
|
536
|
-
s2 !== e8 && !(s2 in a2) && (a2[s2] = a2[e8], delete a2[e8]), a2[s2] =
|
|
547
|
+
let s2 = tt(e8, t2);
|
|
548
|
+
s2 !== e8 && !(s2 in a2) && (a2[s2] = a2[e8], delete a2[e8]), a2[s2] = $e(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
537
549
|
});
|
|
538
550
|
}
|
|
539
551
|
};
|
|
540
552
|
return i2(e6, ``), e6;
|
|
541
553
|
}
|
|
542
|
-
function
|
|
554
|
+
function tt(e6, t2) {
|
|
543
555
|
let n2;
|
|
544
556
|
return n2 = e6.includes(`.`) ? e6.split(`.`).map((e7) => t2[e7] ?? e7).join(`.`) : t2[e6] ?? e6, n2;
|
|
545
557
|
}
|
|
546
558
|
function D(e6, t2 = []) {
|
|
547
|
-
return
|
|
559
|
+
return et(e6, Ke, t2);
|
|
548
560
|
}
|
|
549
561
|
function O(e6, t2 = []) {
|
|
550
|
-
return
|
|
562
|
+
return et(e6, qe, t2);
|
|
551
563
|
}
|
|
552
|
-
function
|
|
564
|
+
function nt(e6) {
|
|
553
565
|
return e6?.toISOString();
|
|
554
566
|
}
|
|
555
|
-
function
|
|
567
|
+
function rt(e6) {
|
|
556
568
|
return e6 ? new Date(e6) : void 0;
|
|
557
569
|
}
|
|
558
|
-
var
|
|
559
|
-
function
|
|
570
|
+
var it = /* @__PURE__ */ new WeakMap();
|
|
571
|
+
function at() {
|
|
560
572
|
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
561
573
|
}
|
|
562
|
-
function
|
|
574
|
+
function ot(e6, t2) {
|
|
563
575
|
let n2 = e6.get(t2);
|
|
564
|
-
return n2 || (n2 =
|
|
576
|
+
return n2 || (n2 = at(), e6.set(t2, n2)), n2;
|
|
565
577
|
}
|
|
566
|
-
function
|
|
567
|
-
return t2 === `*` ? (e6.anyField ??=
|
|
578
|
+
function st(e6, t2) {
|
|
579
|
+
return t2 === `*` ? (e6.anyField ??= at(), e6.anyField) : t2.endsWith(`{}`) ? (e6.mapFields ??= /* @__PURE__ */ new Map(), ot(e6.mapFields, t2.slice(0, -2))) : (e6.fields ??= /* @__PURE__ */ new Map(), ot(e6.fields, t2));
|
|
568
580
|
}
|
|
569
|
-
function
|
|
570
|
-
let t2 =
|
|
581
|
+
function ct(e6) {
|
|
582
|
+
let t2 = at();
|
|
571
583
|
for (let n2 of e6) {
|
|
572
|
-
let e7 = n2.path.split(`.`).reduce(
|
|
584
|
+
let e7 = n2.path.split(`.`).reduce(st, t2);
|
|
573
585
|
e7.leaves ??= [], e7.leaves.push(n2);
|
|
574
586
|
}
|
|
575
587
|
return t2;
|
|
576
588
|
}
|
|
577
|
-
function
|
|
578
|
-
let t2 =
|
|
579
|
-
return t2 || (t2 =
|
|
589
|
+
function lt(e6) {
|
|
590
|
+
let t2 = it.get(e6);
|
|
591
|
+
return t2 || (t2 = ct(e6), it.set(e6, t2)), t2;
|
|
580
592
|
}
|
|
581
593
|
function k(e6) {
|
|
582
594
|
return typeof e6 == `object` && !!e6;
|
|
583
595
|
}
|
|
584
|
-
function
|
|
596
|
+
function ut(e6, { isRepeated: t2, isMap: n2 }, r2) {
|
|
585
597
|
return t2 ? Array.isArray(e6) ? e6.map(r2) : e6 : n2 ? k(e6) ? Object.fromEntries(Object.entries(e6).map(([e7, t3]) => [e7, r2(t3)])) : e6 : r2(e6);
|
|
586
598
|
}
|
|
587
599
|
function A(e6, t2, n2) {
|
|
588
|
-
k(e6) &&
|
|
600
|
+
k(e6) && pt(e6, t2, n2);
|
|
589
601
|
}
|
|
590
|
-
function
|
|
602
|
+
function dt(e6, t2, n2) {
|
|
591
603
|
for (let [r2, i2] of t2) {
|
|
592
604
|
if (!(r2 in e6)) continue;
|
|
593
|
-
if (i2.leaves) for (let t4 of i2.leaves) e6[r2] =
|
|
605
|
+
if (i2.leaves) for (let t4 of i2.leaves) e6[r2] = ut(e6[r2], t4, n2);
|
|
594
606
|
let t3 = e6[r2];
|
|
595
607
|
Array.isArray(t3) ? t3.forEach((e7) => A(e7, i2, n2)) : A(t3, i2, n2);
|
|
596
608
|
}
|
|
597
609
|
}
|
|
598
|
-
function
|
|
610
|
+
function ft(e6, t2, n2) {
|
|
599
611
|
for (let [r2, i2] of t2) {
|
|
600
612
|
let t3 = e6[r2];
|
|
601
613
|
k(t3) && Object.values(t3).forEach((e7) => A(e7, i2, n2));
|
|
602
614
|
}
|
|
603
615
|
}
|
|
604
|
-
function
|
|
605
|
-
t2 &&
|
|
616
|
+
function pt(e6, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
617
|
+
t2 && dt(e6, t2, i2), n2 && ft(e6, n2, i2), r2 && Object.values(e6).forEach((e7) => A(e7, r2, i2));
|
|
606
618
|
}
|
|
607
619
|
function j(e6, t2) {
|
|
608
620
|
if (!k(e6)) return e6;
|
|
609
|
-
for (let { paths: n2, transformFn: r2 } of t2)
|
|
621
|
+
for (let { paths: n2, transformFn: r2 } of t2) pt(e6, lt(n2), r2);
|
|
610
622
|
return e6;
|
|
611
623
|
}
|
|
612
|
-
function
|
|
613
|
-
return
|
|
624
|
+
function mt(e6) {
|
|
625
|
+
return yt(e6).map((e7) => e7.toLocaleUpperCase()).join(`_`);
|
|
614
626
|
}
|
|
615
|
-
var
|
|
616
|
-
var
|
|
617
|
-
var
|
|
618
|
-
var
|
|
619
|
-
function
|
|
627
|
+
var ht = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
628
|
+
var gt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
629
|
+
var _t = `$1\0$2`;
|
|
630
|
+
var vt = /[^\p{L}\d]+/giu;
|
|
631
|
+
function yt(e6) {
|
|
620
632
|
let t2 = e6.trim();
|
|
621
|
-
t2 = t2.replace(
|
|
633
|
+
t2 = t2.replace(ht, _t).replace(gt, _t), t2 = t2.replace(vt, `\0`);
|
|
622
634
|
let n2 = 0, r2 = t2.length;
|
|
623
635
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
624
636
|
if (n2 === r2) return [];
|
|
625
637
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
626
638
|
return t2.slice(n2, r2).split(/\0/g);
|
|
627
639
|
}
|
|
628
|
-
var
|
|
629
|
-
var
|
|
630
|
-
var
|
|
640
|
+
var bt = (e6) => `validationError` in (e6.response?.data?.details ?? {});
|
|
641
|
+
var xt = (e6) => `applicationError` in (e6.response?.data?.details ?? {});
|
|
642
|
+
var St = (e6) => (e6.response?.status ?? -1) >= 400 && (e6.response?.status ?? -1) < 500;
|
|
631
643
|
function M(e6, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
632
644
|
if (typeof e6 != `object` || !e6) throw e6;
|
|
633
|
-
if (
|
|
634
|
-
if (
|
|
635
|
-
if (
|
|
636
|
-
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
645
|
+
if (bt(e6)) return Ct(e6, t2, n2);
|
|
646
|
+
if (xt(e6)) return wt(e6);
|
|
647
|
+
if (St(e6)) {
|
|
648
|
+
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: mt(n3), data: {} }, requestId: e6.requestId };
|
|
637
649
|
return N(e6, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
638
650
|
}
|
|
639
|
-
return
|
|
651
|
+
return Tt(e6);
|
|
640
652
|
}
|
|
641
|
-
var
|
|
642
|
-
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
653
|
+
var Ct = (e6, t2, n2) => {
|
|
654
|
+
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Et(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 };
|
|
643
655
|
return N(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e6.response?.status, requestId: i2 } });
|
|
644
656
|
};
|
|
645
657
|
var N = (e6, { message: t2, extraProperties: n2 }) => Object.assign(e6, { ...n2, message: t2 });
|
|
646
|
-
var
|
|
647
|
-
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 ??
|
|
658
|
+
var wt = (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 ?? mt(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 };
|
|
648
660
|
return N(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e6.requestId } });
|
|
649
661
|
};
|
|
650
|
-
var
|
|
651
|
-
var
|
|
662
|
+
var Tt = (e6) => N(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: mt(e6.response?.statusText ?? `UNKNOWN`), ...!e6.response && { runtimeError: e6 } } });
|
|
663
|
+
var Et = ({ spreadPathsToArguments: e6, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
652
664
|
let a2 = { ...e6, ...t2 }, o2 = Object.keys(a2);
|
|
653
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) => {
|
|
654
666
|
let r3 = t2[e7.field];
|
|
655
|
-
if (r3) return { ...e7, field:
|
|
667
|
+
if (r3) return { ...e7, field: Dt(r3, i2) };
|
|
656
668
|
let s2 = o2?.sort((e8, t3) => t3.length - e8.length)?.find((t3) => e7.field.startsWith(t3));
|
|
657
669
|
if (s2) {
|
|
658
670
|
let t3 = a2[s2];
|
|
659
|
-
if (t3) return { ...e7, field: e7.field.replace(s2,
|
|
671
|
+
if (t3) return { ...e7, field: e7.field.replace(s2, Dt(t3, i2)) };
|
|
660
672
|
}
|
|
661
673
|
return n2 ? { ...e7, field: `${i2[0]}.${e7.field}` } : e7;
|
|
662
674
|
});
|
|
663
675
|
};
|
|
664
|
-
var
|
|
665
|
-
let n2 =
|
|
676
|
+
var Dt = (e6, t2) => {
|
|
677
|
+
let n2 = Ot(e6);
|
|
666
678
|
return n2 == null ? e6 : e6.replace(`$[${n2}]`, t2[n2]);
|
|
667
679
|
};
|
|
668
|
-
var
|
|
680
|
+
var Ot = (e6) => {
|
|
669
681
|
let t2 = e6.match(/\$\[(?<argIndex>\d+)\]/);
|
|
670
682
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
671
683
|
};
|
|
672
|
-
function
|
|
684
|
+
function kt() {
|
|
673
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;
|
|
674
686
|
if (e6) return { initWixModules(t3, n3) {
|
|
675
|
-
return
|
|
687
|
+
return At(() => e6(t3, n3));
|
|
676
688
|
}, fetchWithAuth() {
|
|
677
689
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
678
690
|
}, graphql() {
|
|
679
691
|
throw Error(`graphql is not available in this context`);
|
|
680
692
|
} };
|
|
681
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
693
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : h.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : h.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : h.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : h.elevatedClient;
|
|
682
694
|
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
683
695
|
if (r2) {
|
|
684
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`);
|
|
685
|
-
return
|
|
697
|
+
return At(() => n2.use(e7));
|
|
686
698
|
}
|
|
687
699
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
688
|
-
return
|
|
700
|
+
return At(() => t2.use(e7));
|
|
689
701
|
}, fetchWithAuth: (e7, n3) => {
|
|
690
702
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
691
703
|
return t2.fetchWithAuth(e7, n3);
|
|
@@ -697,110 +709,110 @@ function Ot() {
|
|
|
697
709
|
return t2.graphql(e7, n3, r2);
|
|
698
710
|
} };
|
|
699
711
|
}
|
|
700
|
-
function
|
|
701
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
702
|
-
globalThis.__wix_context__ = void 0,
|
|
712
|
+
function At(e6) {
|
|
713
|
+
let t2 = globalThis.__wix_context__, n2 = { client: h.client, elevatedClient: h.elevatedClient }, r2;
|
|
714
|
+
globalThis.__wix_context__ = void 0, h.client = void 0, h.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
703
715
|
try {
|
|
704
716
|
return e6();
|
|
705
717
|
} finally {
|
|
706
|
-
globalThis.__wix_context__ = t2,
|
|
718
|
+
globalThis.__wix_context__ = t2, h.client = n2.client, h.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
707
719
|
}
|
|
708
720
|
}
|
|
709
|
-
function
|
|
721
|
+
function jt(e6, t2) {
|
|
710
722
|
return (...n2) => {
|
|
711
|
-
let r2 =
|
|
723
|
+
let r2 = kt();
|
|
712
724
|
return r2 ? r2.initWixModules(e6, t2).apply(void 0, n2) : e6.apply(void 0, n2);
|
|
713
725
|
};
|
|
714
726
|
}
|
|
715
|
-
function
|
|
716
|
-
return
|
|
727
|
+
function Mt(e6, t2 = false) {
|
|
728
|
+
return jt(e6, t2);
|
|
717
729
|
}
|
|
718
|
-
function
|
|
719
|
-
let n2 =
|
|
720
|
-
return t2 && r2 ? new URLSearchParams({ ".r":
|
|
730
|
+
function Nt(e6, t2) {
|
|
731
|
+
let n2 = Ft(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": Lt(JSON.stringify(e6)) }) : Object.entries(n2).reduce((e7, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
|
|
721
733
|
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e7.append(t3, r3);
|
|
722
734
|
}), e7), new URLSearchParams());
|
|
723
735
|
}
|
|
724
|
-
function
|
|
725
|
-
let t2 =
|
|
726
|
-
return
|
|
736
|
+
function Pt(e6) {
|
|
737
|
+
let t2 = Xt(Jt(e6.host), e6.domainToMappings);
|
|
738
|
+
return on(nn(e6.protoPath, e6.data || {}), t2);
|
|
727
739
|
}
|
|
728
|
-
function
|
|
740
|
+
function Ft(e6, t2 = ``) {
|
|
729
741
|
let n2 = {};
|
|
730
742
|
return Object.entries(e6).forEach(([e7, r2]) => {
|
|
731
|
-
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 =
|
|
743
|
+
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = It(t2, e7);
|
|
732
744
|
if (i2) {
|
|
733
|
-
let e8 =
|
|
745
|
+
let e8 = Ft(r2, a2);
|
|
734
746
|
Object.assign(n2, e8);
|
|
735
747
|
} else n2[a2] = r2;
|
|
736
748
|
}), n2;
|
|
737
749
|
}
|
|
738
|
-
function
|
|
750
|
+
function It(e6, t2) {
|
|
739
751
|
return `${e6}${e6 ? `.` : ``}${t2}`;
|
|
740
752
|
}
|
|
741
|
-
var
|
|
753
|
+
var Lt = (e6) => {
|
|
742
754
|
let t2 = new TextEncoder().encode(e6);
|
|
743
755
|
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e6, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
|
|
744
756
|
};
|
|
745
|
-
var
|
|
746
|
-
var
|
|
747
|
-
var
|
|
748
|
-
var
|
|
749
|
-
var
|
|
750
|
-
var
|
|
751
|
-
var
|
|
752
|
-
var
|
|
753
|
-
var
|
|
754
|
-
var
|
|
755
|
-
function qt(e6) {
|
|
756
|
-
return Jt(e6).replace(Bt, `._base_domain_`).replace(Gt, `._api_base_domain_`).replace(Kt, `*.dev.wix-code.com`);
|
|
757
|
-
}
|
|
757
|
+
var Rt = [`wix.com`, `editorx.com`];
|
|
758
|
+
var zt = `_`;
|
|
759
|
+
var Bt = `*.`;
|
|
760
|
+
var Vt = RegExp(`\\.(${Rt.join(`|`)})$`);
|
|
761
|
+
var Ht = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
762
|
+
var Ut = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
763
|
+
var Wt = `dev.wix-code.com`;
|
|
764
|
+
var Gt = /{(.*)}/;
|
|
765
|
+
var Kt = RegExp(`\\.(${Ht.join(`|`)})$`);
|
|
766
|
+
var qt = RegExp(`.*\\.${Wt}$`);
|
|
758
767
|
function Jt(e6) {
|
|
759
|
-
return
|
|
768
|
+
return Yt(e6).replace(Vt, `._base_domain_`).replace(Kt, `._api_base_domain_`).replace(qt, `*.dev.wix-code.com`);
|
|
769
|
+
}
|
|
770
|
+
function Yt(e6) {
|
|
771
|
+
return Ut[e6] ?? e6;
|
|
760
772
|
}
|
|
761
|
-
function
|
|
773
|
+
function Xt(e6, t2) {
|
|
762
774
|
let n2 = t2[e6];
|
|
763
775
|
if (n2) return n2;
|
|
764
|
-
let r2 =
|
|
776
|
+
let r2 = Zt(e6, t2) ?? Qt(e6, t2);
|
|
765
777
|
if (!r2) {
|
|
766
|
-
if (
|
|
767
|
-
let e7 = t2[
|
|
778
|
+
if (en(e6)) {
|
|
779
|
+
let e7 = t2[tn];
|
|
768
780
|
if (e7) return e7;
|
|
769
781
|
}
|
|
770
|
-
let n3 = t2[
|
|
782
|
+
let n3 = t2[zt];
|
|
771
783
|
if (n3) return n3;
|
|
772
784
|
}
|
|
773
785
|
return r2 ?? [];
|
|
774
786
|
}
|
|
775
|
-
function
|
|
787
|
+
function Zt(e6, t2) {
|
|
776
788
|
return Object.entries(t2).find(([t3]) => {
|
|
777
789
|
let [, ...n2] = e6.split(`.`);
|
|
778
790
|
return n2.join(`.`) === t3;
|
|
779
791
|
})?.[1];
|
|
780
792
|
}
|
|
781
|
-
function
|
|
782
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
793
|
+
function Qt(e6, t2) {
|
|
794
|
+
let [n2] = Object.entries(t2).filter(([t3]) => $t(e6, t3)).sort(([e7], [t3]) => t3.length - e7.length);
|
|
783
795
|
if (!n2) return;
|
|
784
796
|
let [, r2] = n2;
|
|
785
797
|
return r2;
|
|
786
798
|
}
|
|
787
|
-
function
|
|
788
|
-
if (!t2.startsWith(
|
|
799
|
+
function $t(e6, t2) {
|
|
800
|
+
if (!t2.startsWith(Bt)) return false;
|
|
789
801
|
let n2 = t2.slice(1);
|
|
790
802
|
return e6.length > n2.length && e6.endsWith(n2);
|
|
791
803
|
}
|
|
792
|
-
function
|
|
804
|
+
function en(e6) {
|
|
793
805
|
return !!e6.match(/\._base_domain_$/);
|
|
794
806
|
}
|
|
795
|
-
var
|
|
796
|
-
function tn(e6, t2) {
|
|
797
|
-
return e6.split(`/`).map((e7) => nn(e7, t2)).join(`/`);
|
|
798
|
-
}
|
|
807
|
+
var tn = `www._base_domain_`;
|
|
799
808
|
function nn(e6, t2) {
|
|
800
|
-
|
|
801
|
-
return r2 ? rn(t2, r2, e6, e6.replace(n2[0], ``)) : e6;
|
|
809
|
+
return e6.split(`/`).map((e7) => rn(e7, t2)).join(`/`);
|
|
802
810
|
}
|
|
803
|
-
function rn(e6, t2
|
|
811
|
+
function rn(e6, t2) {
|
|
812
|
+
let n2 = e6.match(Gt) || [], r2 = n2[1];
|
|
813
|
+
return r2 ? an(t2, r2, e6, e6.replace(n2[0], ``)) : e6;
|
|
814
|
+
}
|
|
815
|
+
function an(e6, t2, n2, r2) {
|
|
804
816
|
let i2 = e6;
|
|
805
817
|
for (let e7 of t2.split(`.`)) {
|
|
806
818
|
if (!i2) return n2;
|
|
@@ -808,22 +820,22 @@ function rn(e6, t2, n2, r2) {
|
|
|
808
820
|
}
|
|
809
821
|
return `${i2}${r2}`;
|
|
810
822
|
}
|
|
811
|
-
function
|
|
823
|
+
function on(e6, t2) {
|
|
812
824
|
let n2 = t2?.find((t3) => e6.startsWith(t3.destPath));
|
|
813
825
|
return n2 ? n2.srcPath + e6.slice(n2.destPath.length) : e6;
|
|
814
826
|
}
|
|
815
|
-
function
|
|
827
|
+
function sn(e6) {
|
|
816
828
|
return e6 === `NaN` ? NaN : e6 === `Infinity` ? 1 / 0 : e6 === `-Infinity` ? -1 / 0 : e6;
|
|
817
829
|
}
|
|
818
|
-
var
|
|
819
|
-
var
|
|
830
|
+
var cn = `modulepreload`;
|
|
831
|
+
var ln = function(e6, t2) {
|
|
820
832
|
return new URL(e6, t2).href;
|
|
821
833
|
};
|
|
822
|
-
var
|
|
823
|
-
var
|
|
834
|
+
var un = {};
|
|
835
|
+
var dn = function(e6) {
|
|
824
836
|
return e6.pathname.endsWith(`.css`);
|
|
825
837
|
};
|
|
826
|
-
var
|
|
838
|
+
var fn = function(e6, t2, n2) {
|
|
827
839
|
if (t2 in e6) return e6[t2];
|
|
828
840
|
let r2 = n2();
|
|
829
841
|
if (!r2) {
|
|
@@ -837,7 +849,7 @@ var dn = function(e6, t2, n2) {
|
|
|
837
849
|
});
|
|
838
850
|
return e6[t2] = i2, i2;
|
|
839
851
|
};
|
|
840
|
-
var
|
|
852
|
+
var pn = function(e6, t2, n2) {
|
|
841
853
|
let r2 = Promise.resolve();
|
|
842
854
|
if (t2 && t2.length > 0) {
|
|
843
855
|
let o3 = function(e8) {
|
|
@@ -848,9 +860,9 @@ var fn = function(e6, t2, n2) {
|
|
|
848
860
|
var o2 = o3, s2 = s3;
|
|
849
861
|
let e7, i3 = document.querySelector(`meta[property=csp-nonce]`), a2 = i3?.nonce || i3?.getAttribute(`nonce`);
|
|
850
862
|
r2 = o3(t2.map((t3) => {
|
|
851
|
-
t3 =
|
|
852
|
-
let r3 = s3(t3), i4 =
|
|
853
|
-
return
|
|
863
|
+
t3 = ln(t3, n2);
|
|
864
|
+
let r3 = s3(t3), i4 = dn(r3);
|
|
865
|
+
return fn(un, r3.href, () => {
|
|
854
866
|
if (e7 === void 0) {
|
|
855
867
|
e7 = { all: /* @__PURE__ */ new Set(), styles: /* @__PURE__ */ new Set() };
|
|
856
868
|
let t5 = document.getElementsByTagName(`link`);
|
|
@@ -861,7 +873,7 @@ var fn = function(e6, t2, n2) {
|
|
|
861
873
|
}
|
|
862
874
|
if ((i4 ? e7.styles : e7.all).has(r3.href)) return;
|
|
863
875
|
let t4 = document.createElement(`link`);
|
|
864
|
-
if (t4.rel = i4 ? `stylesheet` :
|
|
876
|
+
if (t4.rel = i4 ? `stylesheet` : cn, i4 || (t4.as = `script`), t4.crossOrigin = ``, t4.href = r3.href, a2 && t4.setAttribute(`nonce`, a2), document.head.appendChild(t4), i4) return new Promise((e8, n3) => {
|
|
865
877
|
t4.addEventListener(`load`, e8), t4.addEventListener(`error`, () => n3(Error(`Unable to preload CSS for ${r3}`)));
|
|
866
878
|
});
|
|
867
879
|
});
|
|
@@ -876,30 +888,30 @@ var fn = function(e6, t2, n2) {
|
|
|
876
888
|
return e6().catch(i2);
|
|
877
889
|
});
|
|
878
890
|
};
|
|
879
|
-
var
|
|
880
|
-
var
|
|
881
|
-
var
|
|
882
|
-
var
|
|
883
|
-
let e6 =
|
|
884
|
-
if (e6) return { [
|
|
891
|
+
var mn = `x-wix-linguist`;
|
|
892
|
+
var hn = `00000000-0000-0000-0000-000000000000`;
|
|
893
|
+
var gn = `false`;
|
|
894
|
+
var _n = () => {
|
|
895
|
+
let e6 = bn(`language`), t2 = bn(`locale`);
|
|
896
|
+
if (e6) return { [mn]: [e6, t2 || e6, gn, hn].join(`|`) };
|
|
885
897
|
};
|
|
886
|
-
function
|
|
898
|
+
function vn() {
|
|
887
899
|
let e6 = null, t2 = null;
|
|
888
900
|
return { promise: new Promise((n2, r2) => {
|
|
889
901
|
e6 = n2, t2 = r2;
|
|
890
902
|
}), resolve: e6, reject: t2 };
|
|
891
903
|
}
|
|
892
|
-
var
|
|
893
|
-
var
|
|
894
|
-
var
|
|
895
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e6(t2), o2 =
|
|
896
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
897
|
-
return
|
|
904
|
+
var yn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
905
|
+
var bn = (e6) => yn()?.[e6];
|
|
906
|
+
var xn = ({ createHost: e6 }) => ({ __type: `host`, create: (e7) => ({}), host: (t2) => {
|
|
907
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e6(t2), o2 = Cn();
|
|
908
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: bn(`language`), locale: bn(`locale`), get passThroughHeaders() {
|
|
909
|
+
return _n();
|
|
898
910
|
} } };
|
|
899
911
|
}, auth: (e7) => {
|
|
900
912
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
901
|
-
!e7 &&
|
|
902
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
913
|
+
!e7 && Sn() && (e7 = t2?.getAccessTokenFunction?.());
|
|
914
|
+
let n2 = false, { resolve: r2, promise: i2 } = vn();
|
|
903
915
|
return { getAuthHeaders: async () => {
|
|
904
916
|
if (!e7 && n2 && (e7 = await i2), !e7) throw Error(`Failed to resolve auth token`);
|
|
905
917
|
return { headers: { Authorization: await e7() } };
|
|
@@ -907,60 +919,60 @@ var bn = ({ createHost: e6 }) => ({ __type: `host`, create: (e7) => ({}), host:
|
|
|
907
919
|
r2(e8);
|
|
908
920
|
}) };
|
|
909
921
|
} });
|
|
910
|
-
function
|
|
922
|
+
function Sn() {
|
|
911
923
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
912
924
|
}
|
|
913
|
-
function
|
|
925
|
+
function Cn() {
|
|
914
926
|
let e6 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
915
927
|
if (!e6) return;
|
|
916
928
|
let t2 = new URL(e6);
|
|
917
929
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
918
930
|
}
|
|
919
|
-
var
|
|
931
|
+
var wn = ({ clientSdk: e6, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
920
932
|
if (!e6) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
|
|
921
933
|
return e6.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
922
934
|
}, getAccessToken: () => {
|
|
923
935
|
throw Error(`Not implemented`);
|
|
924
936
|
}, observeState: () => ({ disconnect: () => {
|
|
925
937
|
} }) });
|
|
926
|
-
var
|
|
938
|
+
var Tn = xn({ createHost: function(e6) {
|
|
927
939
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e6?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e6 || {};
|
|
928
940
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
929
|
-
return { channel:
|
|
941
|
+
return { channel: wn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
930
942
|
} };
|
|
931
943
|
} });
|
|
932
|
-
var
|
|
933
|
-
let n2 =
|
|
934
|
-
return
|
|
935
|
-
};
|
|
936
|
-
var
|
|
937
|
-
var
|
|
938
|
-
var
|
|
939
|
-
function
|
|
940
|
-
let o2 =
|
|
944
|
+
var En = (e6, t2) => {
|
|
945
|
+
let n2 = Tn.host({ applicationId: e6, componentId: t2 }), r2 = Tn.auth();
|
|
946
|
+
return We({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
947
|
+
};
|
|
948
|
+
var Dn = (e6) => En(`14bcded7-0066-7c35-14d7-466cb3f09103`, e6);
|
|
949
|
+
var On = { post: `post`, feed: `feed`, relatedPosts: `related-posts`, comments: `comments`, seo: `seo`, likes: `likes` };
|
|
950
|
+
var kn = (e6, t2) => e6 && typeof e6[t2] == `function` ? e6 : null;
|
|
951
|
+
function An(e6, t2, { feature: n2, action: r2, level: i2 = `error`, contexts: a2 }) {
|
|
952
|
+
let o2 = kn(e6, `captureException`);
|
|
941
953
|
if (!o2) return;
|
|
942
954
|
let s2 = t2 instanceof Error ? t2 : Error(String(t2));
|
|
943
955
|
o2.captureException(s2, { level: i2, tags: { feature: n2, action: r2 }, ...a2 ? { contexts: a2 } : {} });
|
|
944
956
|
}
|
|
945
|
-
function
|
|
957
|
+
function jn(e6) {
|
|
946
958
|
return Object.keys(e6).length === 1 && `$and` in e6 && Array.isArray(e6.$and);
|
|
947
959
|
}
|
|
948
|
-
function
|
|
960
|
+
function Mn(e6) {
|
|
949
961
|
return Object.keys(e6).length === 1 && `$or` in e6 && Array.isArray(e6.$or);
|
|
950
962
|
}
|
|
951
|
-
function
|
|
963
|
+
function Nn(e6) {
|
|
952
964
|
return Object.keys(e6).length === 1 && `$not` in e6 && typeof e6.$not == `object`;
|
|
953
965
|
}
|
|
954
966
|
function P(e6, t2) {
|
|
955
|
-
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $and: [...
|
|
967
|
+
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $and: [...jn(e6) ? e6.$and : [e6], ...jn(t2) ? t2.$and : [t2]] };
|
|
956
968
|
}
|
|
957
|
-
function
|
|
958
|
-
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $or: [...
|
|
969
|
+
function Pn(e6, t2) {
|
|
970
|
+
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $or: [...Mn(e6) ? e6.$or : [e6], ...Mn(t2) ? t2.$or : [t2]] };
|
|
959
971
|
}
|
|
960
|
-
function
|
|
961
|
-
if (e6 !== void 0 && Object.keys(e6).length !== 0) return
|
|
972
|
+
function Fn(e6) {
|
|
973
|
+
if (e6 !== void 0 && Object.keys(e6).length !== 0) return Nn(e6) ? e6.$not : { $not: e6 };
|
|
962
974
|
}
|
|
963
|
-
var
|
|
975
|
+
var In = class {
|
|
964
976
|
_items;
|
|
965
977
|
_fetchNextPage;
|
|
966
978
|
_fetchPrevPage;
|
|
@@ -990,7 +1002,7 @@ var Fn = class {
|
|
|
990
1002
|
return await this._fetchPrevPage();
|
|
991
1003
|
}
|
|
992
1004
|
};
|
|
993
|
-
var
|
|
1005
|
+
var Ln = class extends In {
|
|
994
1006
|
_nextCursor;
|
|
995
1007
|
_prevCursor;
|
|
996
1008
|
cursors;
|
|
@@ -1004,7 +1016,7 @@ var In = class extends Fn {
|
|
|
1004
1016
|
return !!this._prevCursor;
|
|
1005
1017
|
}
|
|
1006
1018
|
};
|
|
1007
|
-
var
|
|
1019
|
+
var Rn = class extends In {
|
|
1008
1020
|
_totalCount;
|
|
1009
1021
|
_offset;
|
|
1010
1022
|
_tooManyToCount;
|
|
@@ -1027,16 +1039,16 @@ var Ln = class extends Fn {
|
|
|
1027
1039
|
return !!(this._limit !== 0 && this.currentPage && this.currentPage > 0);
|
|
1028
1040
|
}
|
|
1029
1041
|
};
|
|
1030
|
-
function
|
|
1042
|
+
function zn(e6) {
|
|
1031
1043
|
let t2 = (n2) => ({ query: n2, async find() {
|
|
1032
1044
|
try {
|
|
1033
|
-
let r2 = e6.requestTransformer(e6.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e6.func(r2), { [
|
|
1045
|
+
let r2 = e6.requestTransformer(e6.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e6.func(r2), { [Je]: a2, [Ye]: o2 } = e6.responseTransformer(i2);
|
|
1034
1046
|
if (e6.pagingMethod === `OFFSET`) {
|
|
1035
1047
|
let e7 = n2;
|
|
1036
|
-
return new
|
|
1048
|
+
return new Rn({ 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 });
|
|
1037
1049
|
}
|
|
1038
1050
|
let s2 = n2.cursorPaging;
|
|
1039
|
-
return new
|
|
1051
|
+
return new Ln({ items: a2 ?? [], limit: s2.limit, originQuery: this, fetchNextPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.next ?? void 0, limit: s2.limit } }).find(), fetchPrevPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.prev ?? void 0, limit: s2.limit } }).find(), prevCursor: o2?.cursors?.prev ?? void 0, nextCursor: o2?.cursors?.next ?? void 0 });
|
|
1040
1052
|
} catch (t3) {
|
|
1041
1053
|
throw e6.errorTransformer(t3);
|
|
1042
1054
|
}
|
|
@@ -1088,11 +1100,11 @@ function Rn(e6) {
|
|
|
1088
1100
|
let a2 = { [F(e6.transformationPaths, r2)]: { $exists: i2 } };
|
|
1089
1101
|
return t2({ ...n2, filter: P(n2.filter, a2) });
|
|
1090
1102
|
}, or(e7) {
|
|
1091
|
-
return t2({ ...n2, filter:
|
|
1103
|
+
return t2({ ...n2, filter: Pn(n2.filter, e7.query.filter) });
|
|
1092
1104
|
}, and(e7) {
|
|
1093
1105
|
return t2({ ...n2, filter: P(n2.filter, e7.query.filter) });
|
|
1094
1106
|
}, not(e7) {
|
|
1095
|
-
return t2({ ...n2, filter:
|
|
1107
|
+
return t2({ ...n2, filter: Fn(e7.query.filter) });
|
|
1096
1108
|
}, ascending(...r2) {
|
|
1097
1109
|
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: F(e6.transformationPaths, t3), order: `ASC` }))] });
|
|
1098
1110
|
}, descending(...r2) {
|
|
@@ -1111,69 +1123,69 @@ function Rn(e6) {
|
|
|
1111
1123
|
}
|
|
1112
1124
|
function F(e6, t2) {
|
|
1113
1125
|
let n2 = Object.entries(e6).find(([e7]) => e7 === t2 || t2.startsWith(`${e7}.`))?.[0];
|
|
1114
|
-
return n2 ? t2.replace(n2, e6[n2]) :
|
|
1115
|
-
}
|
|
1116
|
-
var
|
|
1117
|
-
var
|
|
1118
|
-
var
|
|
1119
|
-
var
|
|
1120
|
-
var
|
|
1121
|
-
var
|
|
1122
|
-
function
|
|
1126
|
+
return n2 ? t2.replace(n2, e6[n2]) : Ze(t2, { ...e6, ...Xe });
|
|
1127
|
+
}
|
|
1128
|
+
var Bn = `filter`;
|
|
1129
|
+
var Vn = `sort`;
|
|
1130
|
+
var Hn = `cursorPaging`;
|
|
1131
|
+
var Un = `paging`;
|
|
1132
|
+
var Wn = [Bn, Vn, Hn];
|
|
1133
|
+
var Gn = [Bn, Vn, Un];
|
|
1134
|
+
function Kn(e6, t2) {
|
|
1123
1135
|
return !e6 || typeof e6 != `object` ? false : t2.some((t3) => e6.hasOwnProperty(t3));
|
|
1124
1136
|
}
|
|
1125
|
-
function Kn(e6) {
|
|
1126
|
-
return Gn(e6, Un);
|
|
1127
|
-
}
|
|
1128
1137
|
function qn(e6) {
|
|
1129
|
-
return
|
|
1138
|
+
return Kn(e6, Wn);
|
|
1130
1139
|
}
|
|
1131
1140
|
function Jn(e6) {
|
|
1141
|
+
return Kn(e6, Gn);
|
|
1142
|
+
}
|
|
1143
|
+
function Yn(e6) {
|
|
1132
1144
|
let { hasOptionsParameter: t2 } = e6;
|
|
1133
1145
|
return function(...n2) {
|
|
1134
|
-
return t2 ?
|
|
1146
|
+
return t2 ? Zn(n2, e6) : Xn(n2, e6);
|
|
1135
1147
|
};
|
|
1136
1148
|
}
|
|
1137
|
-
function
|
|
1149
|
+
function Xn(e6, t2) {
|
|
1138
1150
|
return e6.length === 0 ? t2.builderQueryFunction() : t2.typedQueryFunction(e6[0]);
|
|
1139
1151
|
}
|
|
1140
|
-
function
|
|
1152
|
+
function Zn(e6, t2) {
|
|
1141
1153
|
switch (e6.length) {
|
|
1142
1154
|
case 0:
|
|
1143
1155
|
return t2.builderQueryFunction();
|
|
1144
1156
|
case 1:
|
|
1145
|
-
return
|
|
1157
|
+
return qn(e6[0]) || Jn(e6[0]) ? t2.typedQueryFunction(e6[0]) : t2.builderQueryFunction(e6[0]);
|
|
1146
1158
|
default:
|
|
1147
1159
|
return t2.typedQueryFunction(e6[0], e6[1]);
|
|
1148
1160
|
}
|
|
1149
1161
|
}
|
|
1150
|
-
var
|
|
1151
|
-
var
|
|
1152
|
-
function
|
|
1153
|
-
return
|
|
1162
|
+
var Qn = [{ path: `like.createdDate` }];
|
|
1163
|
+
var $n = [{ path: `likes.createdDate` }];
|
|
1164
|
+
function er(e6) {
|
|
1165
|
+
return Pt(Object.assign(e6, { domainToMappings: { _: [{ srcPath: `/_api/blog-like-service`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/blog-like-service`, destPath: `` }], "social-blog._base_domain_": [{ srcPath: `/_api/blog-like-service`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/blog-like-service`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/blog-like-service`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/blog/v1/likes`, destPath: `/v1/likes` }], "*.dev.wix-code.com": [{ srcPath: `/blog/v1/likes`, destPath: `/v1/likes` }] } }));
|
|
1154
1166
|
}
|
|
1155
|
-
var
|
|
1156
|
-
function
|
|
1167
|
+
var tr = `@wix/auto_sdk_blog_likes`;
|
|
1168
|
+
function nr(e6) {
|
|
1157
1169
|
function t2({ host: t3 }) {
|
|
1158
|
-
let n2 = j(e6, [{ transformFn:
|
|
1159
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.CreateLike`, packageName:
|
|
1170
|
+
let n2 = j(e6, [{ transformFn: nt, paths: Qn }]);
|
|
1171
|
+
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.CreateLike`, packageName: tr, migrationOptions: { optInTransformResponse: true }, url: er({ protoPath: `/v1/likes`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => j(e7, [{ transformFn: rt, paths: Qn }]) };
|
|
1160
1172
|
}
|
|
1161
1173
|
return t2;
|
|
1162
1174
|
}
|
|
1163
|
-
function
|
|
1175
|
+
function rr(e6) {
|
|
1164
1176
|
function t2({ host: t3 }) {
|
|
1165
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.QueryLikes`, packageName:
|
|
1177
|
+
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.QueryLikes`, packageName: tr, migrationOptions: { optInTransformResponse: true }, url: er({ protoPath: `/v1/likes/query`, data: e6, host: t3 }), data: e6, transformResponse: (e7) => j(e7, [{ transformFn: rt, paths: $n }]) };
|
|
1166
1178
|
}
|
|
1167
1179
|
return t2;
|
|
1168
1180
|
}
|
|
1169
|
-
function
|
|
1181
|
+
function ir(e6) {
|
|
1170
1182
|
function t2({ host: t3 }) {
|
|
1171
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `DELETE`, methodFqn: `wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId`, packageName:
|
|
1183
|
+
return { entityFqdn: `wix.blog.v1.like`, method: `DELETE`, methodFqn: `wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId`, packageName: tr, migrationOptions: { optInTransformResponse: true }, url: er({ protoPath: `/v1/likes/fqdn/{fqdn}/entity-id/{entityId}`, data: e6, host: t3 }), params: Nt(e6) };
|
|
1172
1184
|
}
|
|
1173
1185
|
return t2;
|
|
1174
1186
|
}
|
|
1175
|
-
async function
|
|
1176
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1187
|
+
async function ar(e6) {
|
|
1188
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = nr(D({ like: e6?.like }));
|
|
1177
1189
|
n2?.onSiteCall?.();
|
|
1178
1190
|
try {
|
|
1179
1191
|
let e7 = await t2.request(r2);
|
|
@@ -1183,10 +1195,10 @@ async function ir(e6) {
|
|
|
1183
1195
|
throw n2?.onError?.(e7), t3;
|
|
1184
1196
|
}
|
|
1185
1197
|
}
|
|
1186
|
-
function
|
|
1198
|
+
function or() {
|
|
1187
1199
|
let { httpClient: e6, sideEffects: t2 } = arguments[0];
|
|
1188
|
-
return
|
|
1189
|
-
let r2 =
|
|
1200
|
+
return zn({ func: async (n2) => {
|
|
1201
|
+
let r2 = rr(n2);
|
|
1190
1202
|
t2?.onSiteCall?.();
|
|
1191
1203
|
try {
|
|
1192
1204
|
let n3 = await e6.request(r2);
|
|
@@ -1204,8 +1216,8 @@ function ar() {
|
|
|
1204
1216
|
throw M(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
1205
1217
|
}, pagingMethod: `CURSOR`, transformationPaths: {} });
|
|
1206
1218
|
}
|
|
1207
|
-
async function
|
|
1208
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1219
|
+
async function sr(e6) {
|
|
1220
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = rr(D({ query: e6 }));
|
|
1209
1221
|
n2?.onSiteCall?.();
|
|
1210
1222
|
try {
|
|
1211
1223
|
let e7 = await t2.request(r2);
|
|
@@ -1215,8 +1227,8 @@ async function or(e6) {
|
|
|
1215
1227
|
throw n2?.onError?.(e7), t3;
|
|
1216
1228
|
}
|
|
1217
1229
|
}
|
|
1218
|
-
async function
|
|
1219
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1230
|
+
async function cr(e6) {
|
|
1231
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ir(D({ fqdn: e6?.fqdn, entityId: e6?.entityId }));
|
|
1220
1232
|
n2?.onSiteCall?.();
|
|
1221
1233
|
try {
|
|
1222
1234
|
let e7 = await t2.request(r2);
|
|
@@ -1226,41 +1238,41 @@ async function sr(e6) {
|
|
|
1226
1238
|
throw n2?.onError?.(e7), t3;
|
|
1227
1239
|
}
|
|
1228
1240
|
}
|
|
1229
|
-
function cr(e6) {
|
|
1230
|
-
return (t2) => ir(t2, { httpClient: e6 });
|
|
1231
|
-
}
|
|
1232
1241
|
function lr(e6) {
|
|
1233
|
-
return () => ar({ httpClient: e6 });
|
|
1242
|
+
return (t2) => ar(t2, { httpClient: e6 });
|
|
1234
1243
|
}
|
|
1235
1244
|
function ur(e6) {
|
|
1236
|
-
return (
|
|
1245
|
+
return () => or({ httpClient: e6 });
|
|
1237
1246
|
}
|
|
1238
1247
|
function dr(e6) {
|
|
1239
1248
|
return (t2) => sr(t2, { httpClient: e6 });
|
|
1240
1249
|
}
|
|
1241
1250
|
function fr(e6) {
|
|
1242
|
-
|
|
1251
|
+
return (t2) => cr(t2, { httpClient: e6 });
|
|
1252
|
+
}
|
|
1253
|
+
function pr(e6) {
|
|
1254
|
+
let t2 = Yn({ builderQueryFunction: () => ur(e6)(), typedQueryFunction: (t3) => dr(e6)(t3), hasOptionsParameter: false });
|
|
1243
1255
|
function n2(e7) {
|
|
1244
1256
|
return t2(...arguments);
|
|
1245
1257
|
}
|
|
1246
1258
|
return n2;
|
|
1247
1259
|
}
|
|
1248
|
-
var
|
|
1249
|
-
var
|
|
1250
|
-
var
|
|
1251
|
-
var
|
|
1252
|
-
function
|
|
1253
|
-
return
|
|
1260
|
+
var mr = Mt(lr);
|
|
1261
|
+
var hr = Mt(fr);
|
|
1262
|
+
var gr = Mt(pr);
|
|
1263
|
+
var _r = [{ path: `metrics.averageRating` }];
|
|
1264
|
+
function vr(e6) {
|
|
1265
|
+
return Pt(Object.assign(e6, { domainToMappings: { _: [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "apps._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "www._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "www.wixapis.com": [{ srcPath: `/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/blog/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/_api/v3/posts`, destPath: `/v3/posts` }], "manage._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/_api/post-service-api-proxy/v3/bulk/posts`, destPath: `/v3/bulk/posts` }], "*.dev.wix-code.com": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "editor._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "blocks._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "create.editorx": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "editor.wixapps.net": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "dev._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }] } }));
|
|
1254
1266
|
}
|
|
1255
|
-
var
|
|
1256
|
-
function
|
|
1267
|
+
var yr = `@wix/auto_sdk_blog_posts`;
|
|
1268
|
+
function br(e6) {
|
|
1257
1269
|
function t2({ host: t3 }) {
|
|
1258
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName:
|
|
1270
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName: yr, migrationOptions: { optInTransformResponse: true }, url: vr({ protoPath: `/v3/posts/{postId}/metrics`, data: e6, host: t3 }), params: Nt(e6), transformResponse: (e7) => j(e7, [{ transformFn: sn, paths: _r }]) };
|
|
1259
1271
|
}
|
|
1260
1272
|
return t2;
|
|
1261
1273
|
}
|
|
1262
|
-
async function
|
|
1263
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1274
|
+
async function xr(e6) {
|
|
1275
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = br(D({ postId: e6 }, []));
|
|
1264
1276
|
n2?.onSiteCall?.();
|
|
1265
1277
|
try {
|
|
1266
1278
|
let e7 = await t2.request(r2);
|
|
@@ -1270,90 +1282,90 @@ async function br(e6) {
|
|
|
1270
1282
|
throw n2?.onError?.(e7), t3;
|
|
1271
1283
|
}
|
|
1272
1284
|
}
|
|
1273
|
-
function
|
|
1274
|
-
return (t2) =>
|
|
1285
|
+
function Sr(e6) {
|
|
1286
|
+
return (t2) => xr(t2, { httpClient: e6 });
|
|
1275
1287
|
}
|
|
1276
|
-
var
|
|
1277
|
-
var
|
|
1278
|
-
var wr = async (e6) => {
|
|
1279
|
-
await pr({ like: { entityId: e6, fqdn: Cr } });
|
|
1280
|
-
};
|
|
1288
|
+
var Cr = Mt(Sr);
|
|
1289
|
+
var wr = `wix.blog.v3.post`;
|
|
1281
1290
|
var Tr = async (e6) => {
|
|
1282
|
-
await mr({
|
|
1291
|
+
await mr({ like: { entityId: e6, fqdn: wr } });
|
|
1292
|
+
};
|
|
1293
|
+
var Er = async (e6) => {
|
|
1294
|
+
await hr({ fqdn: wr, entityId: e6 });
|
|
1283
1295
|
};
|
|
1284
|
-
var
|
|
1285
|
-
var
|
|
1286
|
-
let [t2, n2] = await Promise.allSettled([
|
|
1287
|
-
return { liked: t2.status === `fulfilled` && t2.value.items.length > 0, likeCount:
|
|
1296
|
+
var Dr = (e6) => typeof e6 == `number` ? e6 : void 0;
|
|
1297
|
+
var Or = async (e6) => {
|
|
1298
|
+
let [t2, n2] = await Promise.allSettled([gr().eq(`fqdn`, wr).eq(`entityId`, e6).limit(1).find(), Cr(e6)]), r2 = n2.status === `fulfilled` ? n2.value.metrics : void 0;
|
|
1299
|
+
return { liked: t2.status === `fulfilled` && t2.value.items.length > 0, likeCount: Dr(r2?.likes), viewCount: Dr(r2?.views), commentCount: Dr(r2?.comments) };
|
|
1288
1300
|
};
|
|
1289
1301
|
function I(e6) {
|
|
1290
1302
|
return e6;
|
|
1291
1303
|
}
|
|
1292
|
-
var
|
|
1293
|
-
var
|
|
1304
|
+
var kr = I(`@wix/site-service-editor-context`);
|
|
1305
|
+
var Ar = () => {
|
|
1294
1306
|
try {
|
|
1295
|
-
return !!(0, import_services_manager_react.useService)(
|
|
1307
|
+
return !!(0, import_services_manager_react.useService)(kr).previewMode;
|
|
1296
1308
|
} catch {
|
|
1297
1309
|
return false;
|
|
1298
1310
|
}
|
|
1299
1311
|
};
|
|
1300
|
-
var
|
|
1301
|
-
var
|
|
1312
|
+
var jr = I(`@wix/viewer-service-site-members`);
|
|
1313
|
+
var Mr = () => {
|
|
1302
1314
|
try {
|
|
1303
|
-
return (0, import_services_manager_react.useService)(
|
|
1315
|
+
return (0, import_services_manager_react.useService)(jr);
|
|
1304
1316
|
} catch {
|
|
1305
1317
|
return;
|
|
1306
1318
|
}
|
|
1307
1319
|
};
|
|
1308
|
-
var
|
|
1320
|
+
var Nr = { liked: false, baselineLiked: false, freshLikeCount: void 0, viewCount: void 0, commentCount: void 0, isLikeCountLoaded: false };
|
|
1309
1321
|
var L = `wix-blog:post-like-toggled`;
|
|
1310
|
-
var
|
|
1322
|
+
var Pr = () => {
|
|
1311
1323
|
let e6 = window;
|
|
1312
1324
|
return e6[L] ??= /* @__PURE__ */ new Map();
|
|
1313
1325
|
};
|
|
1314
|
-
var
|
|
1315
|
-
|
|
1326
|
+
var Fr = (e6) => {
|
|
1327
|
+
Pr().set(e6.postId, e6.liked), window.dispatchEvent(new CustomEvent(L, { detail: e6 }));
|
|
1316
1328
|
};
|
|
1317
|
-
var
|
|
1318
|
-
var
|
|
1319
|
-
let u2 =
|
|
1329
|
+
var Ir = (e6, t2) => ({ isLiked: e6.liked, likeCount: Math.max(0, (e6.freshLikeCount ?? t2) + Number(e6.liked) - Number(e6.baselineLiked)), isLikeCountLoaded: e6.isLikeCountLoaded, viewCount: e6.viewCount, commentCount: e6.commentCount });
|
|
1330
|
+
var Lr = (e6, t2, n2 = false, a2) => {
|
|
1331
|
+
let u2 = Ar() || n2, [d2, f2] = (0, import_react.useState)(Nr), p2 = (0, import_react.useRef)(Nr), m2 = (0, import_react.useRef)(t2), h2 = (0, import_react.useRef)(/* @__PURE__ */ new Set()), g2 = (0, import_react.useRef)(false), _2 = (0, import_react.useRef)(false), v2 = (0, import_react.useRef)(void 0), y2 = Mr(), [b2, x2] = (0, import_react.useState)(0);
|
|
1320
1332
|
(0, import_react.useEffect)(() => {
|
|
1321
1333
|
let e7 = y2?.addMemberLoginListener?.(() => {
|
|
1322
|
-
|
|
1334
|
+
Pr().clear(), x2((e8) => e8 + 1);
|
|
1323
1335
|
});
|
|
1324
1336
|
return () => {
|
|
1325
1337
|
e7 !== void 0 && y2?.removeMemberLoginListener?.(e7);
|
|
1326
1338
|
};
|
|
1327
1339
|
}, [y2]);
|
|
1328
1340
|
let S2 = (0, import_react.useCallback)((e7) => {
|
|
1329
|
-
let t3 = p2.current,
|
|
1330
|
-
Object.keys(
|
|
1331
|
-
}, []), C2 = (0, import_react.useMemo)(() => ({ get: () =>
|
|
1341
|
+
let t3 = p2.current, n3 = { ...t3, ...e7 };
|
|
1342
|
+
Object.keys(n3).every((e8) => n3[e8] === t3[e8]) || (p2.current = n3, h2.current.forEach((e8) => e8()), (0, import_react.startTransition)(() => f2(n3)));
|
|
1343
|
+
}, []), C2 = (0, import_react.useMemo)(() => ({ get: () => Ir(p2.current, m2.current), subscribe: (e7) => (h2.current.add(e7), () => {
|
|
1332
1344
|
h2.current.delete(e7);
|
|
1333
1345
|
}) }), []);
|
|
1334
1346
|
(0, import_react.useEffect)(() => {
|
|
1335
1347
|
m2.current !== t2 && (m2.current = t2, h2.current.forEach((e7) => e7()));
|
|
1336
1348
|
}, [t2]), (0, import_react.useEffect)(() => {
|
|
1337
|
-
if (v2.current !== e6 && (v2.current = e6, S2(
|
|
1349
|
+
if (v2.current !== e6 && (v2.current = e6, S2(Nr)), _2.current = false, !e6 || u2) {
|
|
1338
1350
|
S2({ isLikeCountLoaded: true });
|
|
1339
1351
|
return;
|
|
1340
1352
|
}
|
|
1341
1353
|
let t3 = false;
|
|
1342
|
-
return
|
|
1343
|
-
t3 || S2({ isLikeCountLoaded: true, viewCount: r2, commentCount:
|
|
1344
|
-
}).catch((
|
|
1345
|
-
t3 || S2({ isLikeCountLoaded: true }),
|
|
1354
|
+
return Or(e6).then(({ liked: e7, likeCount: n3, viewCount: r2, commentCount: i2 }) => {
|
|
1355
|
+
t3 || S2({ isLikeCountLoaded: true, viewCount: r2, commentCount: i2, baselineLiked: e7, freshLikeCount: n3, ...!_2.current && { liked: e7 } });
|
|
1356
|
+
}).catch((n3) => {
|
|
1357
|
+
t3 || S2({ isLikeCountLoaded: true }), An(a2, n3, { feature: On.likes, action: `read-like-state`, level: `warning`, contexts: { likes: { postId: e6 } } });
|
|
1346
1358
|
}), () => {
|
|
1347
1359
|
t3 = true;
|
|
1348
1360
|
};
|
|
1349
|
-
}, [e6, u2,
|
|
1361
|
+
}, [e6, u2, a2, S2, b2]), (0, import_react.useEffect)(() => {
|
|
1350
1362
|
if (!e6) return;
|
|
1351
1363
|
let t3 = (e7) => {
|
|
1352
1364
|
_2.current = true, S2({ liked: e7 });
|
|
1353
|
-
},
|
|
1354
|
-
|
|
1355
|
-
let r2 = (
|
|
1356
|
-
let { detail: r3 } =
|
|
1365
|
+
}, n3 = Pr().get(e6);
|
|
1366
|
+
n3 !== void 0 && t3(n3);
|
|
1367
|
+
let r2 = (n4) => {
|
|
1368
|
+
let { detail: r3 } = n4;
|
|
1357
1369
|
r3.postId === e6 && t3(r3.liked);
|
|
1358
1370
|
};
|
|
1359
1371
|
return window.addEventListener(L, r2), () => window.removeEventListener(L, r2);
|
|
@@ -1361,36 +1373,36 @@ var Ir = (e6, t2, i2 = false, l2) => {
|
|
|
1361
1373
|
let ee2 = (0, import_react.useCallback)(async (t3) => {
|
|
1362
1374
|
if (!e6 || g2.current) return;
|
|
1363
1375
|
_2.current = true;
|
|
1364
|
-
let
|
|
1365
|
-
if (S2({ liked:
|
|
1376
|
+
let n3 = !p2.current.liked;
|
|
1377
|
+
if (S2({ liked: n3 }), Fr({ postId: e6, liked: n3 }), !u2) {
|
|
1366
1378
|
g2.current = true;
|
|
1367
1379
|
try {
|
|
1368
|
-
await (
|
|
1380
|
+
await (n3 ? Tr(e6) : Er(e6));
|
|
1369
1381
|
} catch (t4) {
|
|
1370
|
-
S2({ liked: !
|
|
1382
|
+
S2({ liked: !n3 }), Fr({ postId: e6, liked: !n3 }), An(a2, t4, { feature: On.likes, action: n3 ? `like-post` : `unlike-post`, contexts: { likes: { postId: e6 } } });
|
|
1371
1383
|
} finally {
|
|
1372
1384
|
g2.current = false;
|
|
1373
1385
|
}
|
|
1374
1386
|
}
|
|
1375
|
-
}, [e6, u2,
|
|
1376
|
-
return { ...
|
|
1387
|
+
}, [e6, u2, a2, S2]);
|
|
1388
|
+
return { ...Ir(d2, t2), toggleLike: ee2, liveLikes: C2 };
|
|
1377
1389
|
};
|
|
1378
|
-
var
|
|
1379
|
-
var
|
|
1390
|
+
var Rr = I(`@wix/site-service-locale`);
|
|
1391
|
+
var zr = () => {
|
|
1380
1392
|
try {
|
|
1381
|
-
let { locale: e6, language: t2 } = (0, import_services_manager_react.useService)(
|
|
1393
|
+
let { locale: e6, language: t2 } = (0, import_services_manager_react.useService)(Rr);
|
|
1382
1394
|
return e6 || t2;
|
|
1383
1395
|
} catch {
|
|
1384
1396
|
return;
|
|
1385
1397
|
}
|
|
1386
1398
|
};
|
|
1387
|
-
var
|
|
1399
|
+
var Br = () => {
|
|
1388
1400
|
let e6 = /* @__PURE__ */ new Map();
|
|
1389
1401
|
return { getOrInsert: (t2, n2) => (e6.has(t2) || e6.set(t2, n2().finally(() => {
|
|
1390
1402
|
e6.delete(t2);
|
|
1391
1403
|
})), e6.get(t2)) };
|
|
1392
1404
|
};
|
|
1393
|
-
var
|
|
1405
|
+
var Vr = async (e6) => {
|
|
1394
1406
|
try {
|
|
1395
1407
|
let { default: t2 } = await e6();
|
|
1396
1408
|
return t2;
|
|
@@ -1398,9 +1410,9 @@ var Br = async (e6) => {
|
|
|
1398
1410
|
return;
|
|
1399
1411
|
}
|
|
1400
1412
|
};
|
|
1401
|
-
var
|
|
1402
|
-
let r2 =
|
|
1403
|
-
let [i3, a2] = await Promise.all([
|
|
1413
|
+
var Hr = ({ isDev: e6, loadMessages: t2, loadDevMessages: n2 }) => {
|
|
1414
|
+
let r2 = Br(), i2 = async (r3) => {
|
|
1415
|
+
let [i3, a2] = await Promise.all([Vr(() => t2(r3)), !e6 || !n2 ? void 0 : Vr(() => n2(r3))]);
|
|
1404
1416
|
if (i3 && a2) return { ...i3, ...a2 };
|
|
1405
1417
|
if (i3) return i3;
|
|
1406
1418
|
if (a2) return a2;
|
|
@@ -1415,25 +1427,25 @@ var z = () => {
|
|
|
1415
1427
|
});
|
|
1416
1428
|
return n2.resolve = e6, n2.reject = t2, n2;
|
|
1417
1429
|
};
|
|
1418
|
-
var
|
|
1419
|
-
var
|
|
1430
|
+
var Ur = (e6) => e6 == null ? `` : String(e6);
|
|
1431
|
+
var Wr = (e6, t2, n2) => {
|
|
1420
1432
|
e6.forEach((e7) => {
|
|
1421
1433
|
t2[e7] && (n2[e7] = t2[e7]);
|
|
1422
1434
|
});
|
|
1423
1435
|
};
|
|
1424
|
-
var
|
|
1425
|
-
var
|
|
1426
|
-
var
|
|
1436
|
+
var Gr = /###/g;
|
|
1437
|
+
var Kr = (e6) => e6 && e6.includes(`###`) ? e6.replace(Gr, `.`) : e6;
|
|
1438
|
+
var qr = (e6) => !e6 || R(e6);
|
|
1427
1439
|
var B = (e6, t2, n2) => {
|
|
1428
1440
|
let r2 = R(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
1429
1441
|
for (; i2 < r2.length - 1; ) {
|
|
1430
|
-
if (
|
|
1431
|
-
let t3 =
|
|
1442
|
+
if (qr(e6)) return {};
|
|
1443
|
+
let t3 = Kr(r2[i2]);
|
|
1432
1444
|
!e6[t3] && n2 && (e6[t3] = new n2()), e6 = Object.prototype.hasOwnProperty.call(e6, t3) ? e6[t3] : {}, ++i2;
|
|
1433
1445
|
}
|
|
1434
|
-
return
|
|
1446
|
+
return qr(e6) ? {} : { obj: e6, k: Kr(r2[i2]) };
|
|
1435
1447
|
};
|
|
1436
|
-
var
|
|
1448
|
+
var Jr = (e6, t2, n2) => {
|
|
1437
1449
|
let { obj: r2, k: i2 } = B(e6, t2, Object);
|
|
1438
1450
|
if (r2 !== void 0 || t2.length === 1) {
|
|
1439
1451
|
r2[i2] = n2;
|
|
@@ -1443,7 +1455,7 @@ var qr = (e6, t2, n2) => {
|
|
|
1443
1455
|
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = B(e6, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
1444
1456
|
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
1445
1457
|
};
|
|
1446
|
-
var
|
|
1458
|
+
var Yr = (e6, t2, n2, r2) => {
|
|
1447
1459
|
let { obj: i2, k: a2 } = B(e6, t2, Object);
|
|
1448
1460
|
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
1449
1461
|
};
|
|
@@ -1451,18 +1463,18 @@ var V = (e6, t2) => {
|
|
|
1451
1463
|
let { obj: n2, k: r2 } = B(e6, t2);
|
|
1452
1464
|
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
1453
1465
|
};
|
|
1454
|
-
var
|
|
1466
|
+
var Xr = (e6, t2, n2) => {
|
|
1455
1467
|
let r2 = V(e6, n2);
|
|
1456
1468
|
return r2 === void 0 ? V(t2, n2) : r2;
|
|
1457
1469
|
};
|
|
1458
|
-
var
|
|
1459
|
-
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (Object.prototype.hasOwnProperty.call(e6, r2) ? R(e6[r2]) || e6[r2] instanceof String || R(t2[r2]) || t2[r2] instanceof String ? n2 && (e6[r2] = t2[r2]) :
|
|
1470
|
+
var Zr = (e6, t2, n2) => {
|
|
1471
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (Object.prototype.hasOwnProperty.call(e6, r2) ? R(e6[r2]) || e6[r2] instanceof String || R(t2[r2]) || t2[r2] instanceof String ? n2 && (e6[r2] = t2[r2]) : Zr(e6[r2], t2[r2], n2) : e6[r2] = t2[r2]);
|
|
1460
1472
|
return e6;
|
|
1461
1473
|
};
|
|
1462
1474
|
var H = (e6) => e6.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
1463
|
-
var
|
|
1464
|
-
var
|
|
1465
|
-
var
|
|
1475
|
+
var Qr = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
1476
|
+
var $r = (e6) => R(e6) ? e6.replace(/[&<>"'\/]/g, (e7) => Qr[e7]) : e6;
|
|
1477
|
+
var ei = class {
|
|
1466
1478
|
constructor(e6) {
|
|
1467
1479
|
this.capacity = e6, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1468
1480
|
}
|
|
@@ -1473,20 +1485,20 @@ var $r = class {
|
|
|
1473
1485
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e6, n2), this.regExpQueue.push(e6), n2;
|
|
1474
1486
|
}
|
|
1475
1487
|
};
|
|
1476
|
-
var
|
|
1477
|
-
var
|
|
1478
|
-
var
|
|
1488
|
+
var ti = [` `, `,`, `?`, `!`, `;`];
|
|
1489
|
+
var ni = new ei(20);
|
|
1490
|
+
var ri = (e6, t2, n2) => {
|
|
1479
1491
|
t2 ||= ``, n2 ||= ``;
|
|
1480
|
-
let r2 =
|
|
1492
|
+
let r2 = ti.filter((e7) => !t2.includes(e7) && !n2.includes(e7));
|
|
1481
1493
|
if (r2.length === 0) return true;
|
|
1482
|
-
let i2 =
|
|
1494
|
+
let i2 = ni.getRegExp(`(${r2.map((e7) => e7 === `?` ? `\\?` : e7).join(`|`)})`), a2 = !i2.test(e6);
|
|
1483
1495
|
if (!a2) {
|
|
1484
1496
|
let t3 = e6.indexOf(n2);
|
|
1485
1497
|
t3 > 0 && !i2.test(e6.substring(0, t3)) && (a2 = true);
|
|
1486
1498
|
}
|
|
1487
1499
|
return a2;
|
|
1488
1500
|
};
|
|
1489
|
-
var
|
|
1501
|
+
var ii = (e6, t2, n2 = `.`) => {
|
|
1490
1502
|
if (!e6) return;
|
|
1491
1503
|
if (e6[t2]) return Object.prototype.hasOwnProperty.call(e6, t2) ? e6[t2] : void 0;
|
|
1492
1504
|
let r2 = t2.split(n2), i2 = e6;
|
|
@@ -1503,7 +1515,7 @@ var ri = (e6, t2, n2 = `.`) => {
|
|
|
1503
1515
|
return i2;
|
|
1504
1516
|
};
|
|
1505
1517
|
var U = (e6) => e6?.replace(/_/g, `-`);
|
|
1506
|
-
var
|
|
1518
|
+
var ai = { type: `logger`, log(e6) {
|
|
1507
1519
|
this.output(`log`, e6);
|
|
1508
1520
|
}, warn(e6) {
|
|
1509
1521
|
this.output(`warn`, e6);
|
|
@@ -1517,7 +1529,7 @@ var W = new class e2 {
|
|
|
1517
1529
|
this.init(e6, t2);
|
|
1518
1530
|
}
|
|
1519
1531
|
init(e6, t2 = {}) {
|
|
1520
|
-
this.prefix = t2.prefix || `i18next:`, this.logger = e6 ||
|
|
1532
|
+
this.prefix = t2.prefix || `i18next:`, this.logger = e6 || ai, this.options = t2, this.debug = t2.debug;
|
|
1521
1533
|
}
|
|
1522
1534
|
log(...e6) {
|
|
1523
1535
|
return this.forward(e6, `log`, ``, true);
|
|
@@ -1569,8 +1581,8 @@ var G = class {
|
|
|
1569
1581
|
});
|
|
1570
1582
|
}
|
|
1571
1583
|
};
|
|
1572
|
-
var
|
|
1573
|
-
var
|
|
1584
|
+
var oi = /* @__PURE__ */ new WeakSet();
|
|
1585
|
+
var si = class extends G {
|
|
1574
1586
|
constructor(e6, t2 = { ns: [`translation`], defaultNS: `translation` }) {
|
|
1575
1587
|
super(), this.data = e6 || {}, this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
|
|
1576
1588
|
}
|
|
@@ -1585,11 +1597,11 @@ var oi = class extends G {
|
|
|
1585
1597
|
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
1586
1598
|
e6.includes(`.`) ? o2 = e6.split(`.`) : (o2 = [e6, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) : R(n2) && i2 ? o2.push(...n2.split(i2)) : o2.push(n2)));
|
|
1587
1599
|
let s2 = V(this.data, o2);
|
|
1588
|
-
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !R(n2) ? s2 :
|
|
1600
|
+
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !R(n2) ? s2 : ii(this.data?.[e6]?.[t2], n2, i2);
|
|
1589
1601
|
}
|
|
1590
1602
|
addResource(e6, t2, n2, r2, i2 = { silent: false }) {
|
|
1591
1603
|
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e6, t2];
|
|
1592
|
-
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e6.includes(`.`) && (o2 = e6.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2),
|
|
1604
|
+
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e6.includes(`.`) && (o2 = e6.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), Jr(this.data, o2, r2), i2.silent || this.emit(`added`, e6, t2, n2, r2);
|
|
1593
1605
|
}
|
|
1594
1606
|
addResources(e6, t2, n2, r2 = { silent: false }) {
|
|
1595
1607
|
for (let r3 in n2) (R(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e6, t2, r3, n2[r3], { silent: true });
|
|
@@ -1599,7 +1611,7 @@ var oi = class extends G {
|
|
|
1599
1611
|
let o2 = [e6, t2];
|
|
1600
1612
|
e6.includes(`.`) && (o2 = e6.split(`.`), r2 = n2, n2 = t2, t2 = o2[1]), this.addNamespaces(t2);
|
|
1601
1613
|
let s2 = V(this.data, o2) || {};
|
|
1602
|
-
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ?
|
|
1614
|
+
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? Zr(s2, n2, i2) : s2 = { ...s2, ...n2 }, Jr(this.data, o2, s2), a2.silent || this.emit(`added`, e6, t2, n2);
|
|
1603
1615
|
}
|
|
1604
1616
|
removeResourceBundle(e6, t2) {
|
|
1605
1617
|
this.hasResourceBundle(e6, t2) && delete this.data[e6][t2], this.removeNamespaces(t2), this.emit(`removed`, e6, t2);
|
|
@@ -1617,37 +1629,37 @@ var oi = class extends G {
|
|
|
1617
1629
|
let t2 = this.getDataByLanguage(e6);
|
|
1618
1630
|
return !!(t2 && Object.keys(t2) || []).find((e7) => {
|
|
1619
1631
|
let n2 = t2[e7];
|
|
1620
|
-
return
|
|
1632
|
+
return oi.has(n2) ? true : !n2 || Object.keys(n2).length === 0 ? false : (typeof n2 == `object` && oi.add(n2), true);
|
|
1621
1633
|
});
|
|
1622
1634
|
}
|
|
1623
1635
|
toJSON() {
|
|
1624
1636
|
return this.data;
|
|
1625
1637
|
}
|
|
1626
1638
|
};
|
|
1627
|
-
var
|
|
1639
|
+
var ci = { processors: {}, addPostProcessor(e6) {
|
|
1628
1640
|
this.processors[e6.name] = e6;
|
|
1629
1641
|
}, handle(e6, t2, n2, r2, i2) {
|
|
1630
1642
|
return e6.forEach((e7) => {
|
|
1631
1643
|
t2 = this.processors[e7]?.process(t2, n2, r2, i2) ?? t2;
|
|
1632
1644
|
}), t2;
|
|
1633
1645
|
} };
|
|
1634
|
-
var
|
|
1635
|
-
function
|
|
1646
|
+
var li = Symbol(`i18next/PATH_KEY`);
|
|
1647
|
+
function ui() {
|
|
1636
1648
|
let e6 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1637
|
-
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 ===
|
|
1649
|
+
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === li ? e6 : (e6.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
1638
1650
|
}
|
|
1639
1651
|
function K(e6, t2) {
|
|
1640
|
-
let { [
|
|
1652
|
+
let { [li]: n2 } = e6(ui()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`, a2 = t2?.enableSelector === `strict`;
|
|
1641
1653
|
if (n2.length > 1 && i2) {
|
|
1642
1654
|
let e7 = t2?.ns, o2 = a2 ? Array.isArray(e7) ? e7 : e7 ? [e7] : null : Array.isArray(e7) ? e7 : null;
|
|
1643
1655
|
if (o2 && (a2 ? o2 : o2.length > 1 ? o2.slice(1) : []).includes(n2[0])) return `${n2[0]}${i2}${n2.slice(1).join(r2)}`;
|
|
1644
1656
|
}
|
|
1645
1657
|
return n2.join(r2);
|
|
1646
1658
|
}
|
|
1647
|
-
var
|
|
1648
|
-
var
|
|
1659
|
+
var di = (e6) => !R(e6) && typeof e6 != `boolean` && typeof e6 != `number`;
|
|
1660
|
+
var fi = class e3 extends G {
|
|
1649
1661
|
constructor(e6, t2 = {}) {
|
|
1650
|
-
super(),
|
|
1662
|
+
super(), Wr([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e6, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = W.create(`translator`), this.checkedLoadedFor = {};
|
|
1651
1663
|
}
|
|
1652
1664
|
changeLanguage(e6) {
|
|
1653
1665
|
e6 && (this.language = e6);
|
|
@@ -1657,13 +1669,13 @@ var di = class e3 extends G {
|
|
|
1657
1669
|
if (e6 == null) return false;
|
|
1658
1670
|
let r2 = this.resolve(e6, n2);
|
|
1659
1671
|
if (r2?.res === void 0) return false;
|
|
1660
|
-
let i2 =
|
|
1672
|
+
let i2 = di(r2.res);
|
|
1661
1673
|
return !(n2.returnObjects === false && i2);
|
|
1662
1674
|
}
|
|
1663
1675
|
extractFromKey(e6, t2) {
|
|
1664
1676
|
let n2 = t2.nsSeparator === void 0 ? this.options.nsSeparator : t2.nsSeparator;
|
|
1665
1677
|
n2 === void 0 && (n2 = `:`);
|
|
1666
|
-
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 && !
|
|
1678
|
+
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 && !ri(e6, n2, r2);
|
|
1667
1679
|
if (a2 && !o2) {
|
|
1668
1680
|
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
1669
1681
|
if (t3 && t3.length > 0) return { key: e6, namespaces: R(i2) ? [i2] : i2 };
|
|
@@ -1682,7 +1694,7 @@ var di = class e3 extends G {
|
|
|
1682
1694
|
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;
|
|
1683
1695
|
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 && !R(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;
|
|
1684
1696
|
y2 && !m2 && x2 && (T2 = w2);
|
|
1685
|
-
let te2 =
|
|
1697
|
+
let te2 = di(T2), ne2 = Object.prototype.toString.apply(T2);
|
|
1686
1698
|
if (y2 && T2 && te2 && !_2.includes(ne2) && !(R(v2) && Array.isArray(T2))) {
|
|
1687
1699
|
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
1688
1700
|
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
@@ -1693,7 +1705,7 @@ var di = class e3 extends G {
|
|
|
1693
1705
|
let e6 = Array.isArray(T2), t3 = e6 ? [] : {}, n3 = e6 ? g2 : h2;
|
|
1694
1706
|
for (let e7 in T2) if (Object.prototype.hasOwnProperty.call(T2, e7)) {
|
|
1695
1707
|
let r3 = `${n3}${o2}${e7}`;
|
|
1696
|
-
t3[e7] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue:
|
|
1708
|
+
t3[e7] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue: di(w2) ? w2[e7] : void 0, joinArrays: false, ns: c2 }) : this.translate(r3, { ...i2, joinArrays: false, ns: c2 }), t3[e7] === r3 && (t3[e7] = T2[e7]);
|
|
1697
1709
|
}
|
|
1698
1710
|
m2 = t3;
|
|
1699
1711
|
}
|
|
@@ -1742,7 +1754,7 @@ var di = class e3 extends G {
|
|
|
1742
1754
|
!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();
|
|
1743
1755
|
}
|
|
1744
1756
|
let a2 = n2.postProcess || this.options.postProcess, o2 = R(a2) ? [a2] : a2;
|
|
1745
|
-
return e6 != null && o2?.length && n2.applyPostProcessor !== false && (e6 =
|
|
1757
|
+
return e6 != null && o2?.length && n2.applyPostProcessor !== false && (e6 = ci.handle(o2, e6, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e6;
|
|
1746
1758
|
}
|
|
1747
1759
|
resolve(e6, t2 = {}) {
|
|
1748
1760
|
let n2, r2, i2, a2, o2;
|
|
@@ -1793,7 +1805,7 @@ var di = class e3 extends G {
|
|
|
1793
1805
|
return false;
|
|
1794
1806
|
}
|
|
1795
1807
|
};
|
|
1796
|
-
var
|
|
1808
|
+
var pi = class {
|
|
1797
1809
|
constructor(e6) {
|
|
1798
1810
|
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger = W.create(`languageUtils`), this.resolveHierarchyCache = {};
|
|
1799
1811
|
}
|
|
@@ -1867,9 +1879,9 @@ var fi = class {
|
|
|
1867
1879
|
}), s2 === null ? l2 : (this.resolveHierarchyCache[s2] = l2, l2.slice());
|
|
1868
1880
|
}
|
|
1869
1881
|
};
|
|
1870
|
-
var
|
|
1871
|
-
var
|
|
1872
|
-
var
|
|
1882
|
+
var mi = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
1883
|
+
var hi = { select: (e6) => e6 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1884
|
+
var gi = class {
|
|
1873
1885
|
constructor(e6, t2 = {}) {
|
|
1874
1886
|
this.languageUtils = e6, this.options = t2, this.logger = W.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1875
1887
|
}
|
|
@@ -1883,8 +1895,8 @@ var hi = class {
|
|
|
1883
1895
|
try {
|
|
1884
1896
|
a2 = new Intl.PluralRules(n2, { type: r2 });
|
|
1885
1897
|
} catch {
|
|
1886
|
-
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`),
|
|
1887
|
-
if (!e6.match(/-|_/)) return
|
|
1898
|
+
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`), hi;
|
|
1899
|
+
if (!e6.match(/-|_/)) return hi;
|
|
1888
1900
|
let n3 = this.languageUtils.getLanguagePartFromCode(e6);
|
|
1889
1901
|
a2 = this.getRule(n3, t2);
|
|
1890
1902
|
}
|
|
@@ -1899,26 +1911,26 @@ var hi = class {
|
|
|
1899
1911
|
}
|
|
1900
1912
|
getSuffixes(e6, t2 = {}) {
|
|
1901
1913
|
let n2 = this.getRule(e6, t2);
|
|
1902
|
-
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e7, t3) =>
|
|
1914
|
+
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e7, t3) => mi[e7] - mi[t3]).map((e7) => `${this.options.prepend}${t2.ordinal ? `ordinal${this.options.prepend}` : ``}${e7}`) : [];
|
|
1903
1915
|
}
|
|
1904
1916
|
getSuffix(e6, t2, n2 = {}) {
|
|
1905
1917
|
let r2 = this.getRule(e6, n2);
|
|
1906
1918
|
return r2 ? `${this.options.prepend}${n2.ordinal ? `ordinal${this.options.prepend}` : ``}${r2.select(t2)}` : (this.logger.warn(`no plural rule found for: ${e6}`), this.getSuffix(`dev`, t2, n2));
|
|
1907
1919
|
}
|
|
1908
1920
|
};
|
|
1909
|
-
var
|
|
1910
|
-
let a2 =
|
|
1911
|
-
return !a2 && i2 && R(n2) && (a2 =
|
|
1921
|
+
var _i = (e6, t2, n2, r2 = `.`, i2 = true) => {
|
|
1922
|
+
let a2 = Xr(e6, t2, n2);
|
|
1923
|
+
return !a2 && i2 && R(n2) && (a2 = ii(e6, n2, r2), a2 === void 0 && (a2 = ii(t2, n2, r2))), a2;
|
|
1912
1924
|
};
|
|
1913
|
-
var
|
|
1914
|
-
var
|
|
1925
|
+
var vi = (e6) => e6.replace(/\$/g, `$$$$`);
|
|
1926
|
+
var yi = class {
|
|
1915
1927
|
constructor(e6 = {}) {
|
|
1916
1928
|
this.logger = W.create(`interpolator`), this.options = e6, this.format = e6?.interpolation?.format || ((e7) => e7), this.init(e6);
|
|
1917
1929
|
}
|
|
1918
1930
|
init(e6 = {}) {
|
|
1919
1931
|
e6.interpolation ||= { escapeValue: true };
|
|
1920
1932
|
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;
|
|
1921
|
-
this.escape = t2 === void 0 ?
|
|
1933
|
+
this.escape = t2 === void 0 ? $r : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? H(i2) : a2 || `{{`, this.suffix = o2 ? H(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 ? H(u2) : `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 ? H(l2) : ``, this.nestingPrefix = d2 ? H(d2) : f2 || H(`$t(`), this.nestingSuffix = p2 ? H(p2) : m2 || H(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
1922
1934
|
}
|
|
1923
1935
|
reset() {
|
|
1924
1936
|
this.options && this.init(this.options);
|
|
@@ -1930,11 +1942,11 @@ var vi = class {
|
|
|
1930
1942
|
interpolate(e6, t2, n2, r2) {
|
|
1931
1943
|
let i2, a2, o2, s2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c2 = (e7) => {
|
|
1932
1944
|
if (!e7.includes(this.formatSeparator)) {
|
|
1933
|
-
let i4 =
|
|
1945
|
+
let i4 = _i(t2, s2, e7, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1934
1946
|
return this.alwaysFormat ? this.format(i4, void 0, n2, { ...r2, ...t2, interpolationkey: e7 }) : i4;
|
|
1935
1947
|
}
|
|
1936
1948
|
let i3 = e7.split(this.formatSeparator), a3 = i3.shift().trim(), o3 = i3.join(this.formatSeparator).trim();
|
|
1937
|
-
return this.format(
|
|
1949
|
+
return this.format(_i(t2, s2, a3, this.options.keySeparator, this.options.ignoreJSONStructure), o3, n2, { ...r2, ...t2, interpolationkey: a3 });
|
|
1938
1950
|
};
|
|
1939
1951
|
this.resetRegExp(), !this.escapeValue && typeof e6 == `string` && /\$t\([^)]*\{[^}]*\{\{/.test(e6) && this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false \u2014 if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);
|
|
1940
1952
|
let l2 = r2?.missingInterpolationHandler || this.options.missingInterpolationHandler, u2 = r2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r2.interpolation.skipOnVariables;
|
|
@@ -1950,9 +1962,9 @@ var vi = class {
|
|
|
1950
1962
|
a2 = i2[0];
|
|
1951
1963
|
continue;
|
|
1952
1964
|
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e6}`), a2 = ``;
|
|
1953
|
-
} else !R(a2) && !this.useRawValueToEscape && (a2 =
|
|
1965
|
+
} else !R(a2) && !this.useRawValueToEscape && (a2 = Ur(a2));
|
|
1954
1966
|
let s3 = t3.safeValue(a2);
|
|
1955
|
-
if (e6 = e6.replace(i2[0],
|
|
1967
|
+
if (e6 = e6.replace(i2[0], vi(s3)), u2 ? (t3.regex.lastIndex += s3.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, o2++, o2 >= this.maxReplaces) break;
|
|
1956
1968
|
}
|
|
1957
1969
|
}), e6;
|
|
1958
1970
|
}
|
|
@@ -1976,12 +1988,12 @@ var vi = class {
|
|
|
1976
1988
|
a2 = { ...n2 }, a2 = a2.replace && !R(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1977
1989
|
let d2 = /{.*}/s.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1978
1990
|
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 && !R(i2)) return i2;
|
|
1979
|
-
R(i2) || (i2 =
|
|
1991
|
+
R(i2) || (i2 = Ur(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) + Ur(i2), l2 = s2.lastIndex, this.regexp.lastIndex = 0;
|
|
1980
1992
|
}
|
|
1981
1993
|
return l2 ? c2 + e6.slice(l2) : e6;
|
|
1982
1994
|
}
|
|
1983
1995
|
};
|
|
1984
|
-
var
|
|
1996
|
+
var bi = (e6) => {
|
|
1985
1997
|
let t2 = e6.toLowerCase().trim(), n2 = {};
|
|
1986
1998
|
if (e6.includes(`(`)) {
|
|
1987
1999
|
let r2 = e6.split(`(`);
|
|
@@ -1996,7 +2008,7 @@ var yi = (e6) => {
|
|
|
1996
2008
|
}
|
|
1997
2009
|
return { formatName: t2, formatOptions: n2 };
|
|
1998
2010
|
};
|
|
1999
|
-
var
|
|
2011
|
+
var xi = (e6) => {
|
|
2000
2012
|
let t2 = {};
|
|
2001
2013
|
return (n2, r2, i2) => {
|
|
2002
2014
|
let a2 = i2;
|
|
@@ -2005,14 +2017,14 @@ var bi = (e6) => {
|
|
|
2005
2017
|
return s2 || (s2 = e6(U(r2), i2), t2[o2] = s2), s2(n2);
|
|
2006
2018
|
};
|
|
2007
2019
|
};
|
|
2008
|
-
var
|
|
2009
|
-
var
|
|
2020
|
+
var Si = (e6) => (t2, n2, r2) => e6(U(n2), r2)(t2);
|
|
2021
|
+
var Ci = class {
|
|
2010
2022
|
constructor(e6 = {}) {
|
|
2011
2023
|
this.logger = W.create(`formatter`), this.options = e6, this.init(e6);
|
|
2012
2024
|
}
|
|
2013
2025
|
init(e6, t2 = { interpolation: {} }) {
|
|
2014
2026
|
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
2015
|
-
let n2 = t2.cacheInBuiltFormats ?
|
|
2027
|
+
let n2 = t2.cacheInBuiltFormats ? xi : Si;
|
|
2016
2028
|
this.formats = { number: n2((e7, t3) => {
|
|
2017
2029
|
let n3 = new Intl.NumberFormat(e7, { ...t3 });
|
|
2018
2030
|
return (e8) => n3.format(e8);
|
|
@@ -2034,7 +2046,7 @@ var Si = class {
|
|
|
2034
2046
|
this.formats[e6.toLowerCase().trim()] = t2;
|
|
2035
2047
|
}
|
|
2036
2048
|
addCached(e6, t2) {
|
|
2037
|
-
this.formats[e6.toLowerCase().trim()] =
|
|
2049
|
+
this.formats[e6.toLowerCase().trim()] = xi(t2);
|
|
2038
2050
|
}
|
|
2039
2051
|
format(e6, t2, n2, r2 = {}) {
|
|
2040
2052
|
if (!t2 || e6 == null) return e6;
|
|
@@ -2045,7 +2057,7 @@ var Si = class {
|
|
|
2045
2057
|
a2.push(t3);
|
|
2046
2058
|
}
|
|
2047
2059
|
return a2.reduce((e7, t3) => {
|
|
2048
|
-
let { formatName: i3, formatOptions: a3 } =
|
|
2060
|
+
let { formatName: i3, formatOptions: a3 } = bi(t3);
|
|
2049
2061
|
if (this.formats[i3]) {
|
|
2050
2062
|
let t4 = e7;
|
|
2051
2063
|
try {
|
|
@@ -2060,10 +2072,10 @@ var Si = class {
|
|
|
2060
2072
|
}, e6);
|
|
2061
2073
|
}
|
|
2062
2074
|
};
|
|
2063
|
-
var
|
|
2075
|
+
var wi = (e6, t2) => {
|
|
2064
2076
|
e6.pending[t2] !== void 0 && (delete e6.pending[t2], e6.pendingCount--);
|
|
2065
2077
|
};
|
|
2066
|
-
var
|
|
2078
|
+
var Ti = class extends G {
|
|
2067
2079
|
constructor(e6, t2, n2, r2 = {}) {
|
|
2068
2080
|
super(), this.backend = e6, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = W.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);
|
|
2069
2081
|
}
|
|
@@ -2082,7 +2094,7 @@ var wi = class extends G {
|
|
|
2082
2094
|
t2 && this.emit(`failedLoading`, i2, a2, t2), !t2 && n2 && this.store.addResourceBundle(i2, a2, n2, void 0, void 0, { skipCopy: true }), this.state[e6] = t2 ? -1 : 2, t2 && n2 && (this.state[e6] = 0);
|
|
2083
2095
|
let o2 = {};
|
|
2084
2096
|
this.queue.forEach((n3) => {
|
|
2085
|
-
|
|
2097
|
+
Yr(n3.loaded, [i2], a2), wi(n3, e6), t2 && n3.errors.push(t2), n3.pendingCount === 0 && !n3.done && (Object.keys(n3.loaded).forEach((e7) => {
|
|
2086
2098
|
o2[e7] || (o2[e7] = {});
|
|
2087
2099
|
let t3 = n3.loaded[e7];
|
|
2088
2100
|
t3.length && t3.forEach((t4) => {
|
|
@@ -2154,7 +2166,7 @@ var wi = class extends G {
|
|
|
2154
2166
|
}
|
|
2155
2167
|
}
|
|
2156
2168
|
};
|
|
2157
|
-
var
|
|
2169
|
+
var Ei = () => ({ 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) => {
|
|
2158
2170
|
let t2 = {};
|
|
2159
2171
|
if (typeof e6[1] == `object` && (t2 = e6[1]), R(e6[1]) && (t2.defaultValue = e6[1]), R(e6[2]) && (t2.tDescription = e6[2]), typeof e6[2] == `object` || typeof e6[3] == `object`) {
|
|
2160
2172
|
let n2 = e6[3] || e6[2];
|
|
@@ -2164,17 +2176,17 @@ var Ti = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS:
|
|
|
2164
2176
|
}
|
|
2165
2177
|
return t2;
|
|
2166
2178
|
}, interpolation: { escapeValue: true, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
2167
|
-
var
|
|
2179
|
+
var Di = (e6) => (R(e6.ns) && (e6.ns = [e6.ns]), R(e6.fallbackLng) && (e6.fallbackLng = [e6.fallbackLng]), R(e6.fallbackNS) && (e6.fallbackNS = [e6.fallbackNS]), e6.supportedLngs && !e6.supportedLngs.includes(`cimode`) && (e6.supportedLngs = e6.supportedLngs.concat([`cimode`])), e6);
|
|
2168
2180
|
var q = () => {
|
|
2169
2181
|
};
|
|
2170
|
-
var
|
|
2182
|
+
var Oi = (e6) => {
|
|
2171
2183
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e6)).forEach((t2) => {
|
|
2172
2184
|
typeof e6[t2] == `function` && (e6[t2] = e6[t2].bind(e6));
|
|
2173
2185
|
});
|
|
2174
2186
|
};
|
|
2175
2187
|
var J = class e4 extends G {
|
|
2176
2188
|
constructor(e6 = {}, t2) {
|
|
2177
|
-
if (super(), this.options =
|
|
2189
|
+
if (super(), this.options = Di(e6), this.services = {}, this.logger = W, this.modules = { external: [] }, Oi(this), t2 && !this.isInitialized && !e6.isClone) {
|
|
2178
2190
|
if (!this.options.initAsync) return this.init(e6, t2), this;
|
|
2179
2191
|
setTimeout(() => {
|
|
2180
2192
|
this.init(e6, t2);
|
|
@@ -2183,19 +2195,19 @@ var J = class e4 extends G {
|
|
|
2183
2195
|
}
|
|
2184
2196
|
init(e6 = {}, t2) {
|
|
2185
2197
|
this.isInitializing = true, typeof e6 == `function` && (t2 = e6, e6 = {}), e6.defaultNS == null && e6.ns && (R(e6.ns) ? e6.defaultNS = e6.ns : e6.ns.includes(`translation`) || (e6.defaultNS = e6.ns[0]));
|
|
2186
|
-
let n2 =
|
|
2187
|
-
this.options = { ...n2, ...this.options, ...
|
|
2198
|
+
let n2 = Ei();
|
|
2199
|
+
this.options = { ...n2, ...this.options, ...Di(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);
|
|
2188
2200
|
let r2 = (e7) => e7 ? typeof e7 == `function` ? new e7() : e7 : null;
|
|
2189
2201
|
if (!this.options.isClone) {
|
|
2190
2202
|
this.modules.logger ? W.init(r2(this.modules.logger), this.options) : W.init(null, this.options);
|
|
2191
2203
|
let e7;
|
|
2192
|
-
e7 = this.modules.formatter ? this.modules.formatter :
|
|
2193
|
-
let t3 = new
|
|
2194
|
-
this.store = new
|
|
2204
|
+
e7 = this.modules.formatter ? this.modules.formatter : Ci;
|
|
2205
|
+
let t3 = new pi(this.options);
|
|
2206
|
+
this.store = new si(this.options.resources, this.options);
|
|
2195
2207
|
let n3 = this.services;
|
|
2196
|
-
n3.logger = W, n3.resourceStore = this.store, n3.languageUtils = t3, n3.pluralResolver = new
|
|
2208
|
+
n3.logger = W, n3.resourceStore = this.store, n3.languageUtils = t3, n3.pluralResolver = new gi(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 yi(this.options), n3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n3.backendConnector = new Ti(r2(this.modules.backend), n3.resourceStore, n3, this.options), n3.backendConnector.on(`*`, (e8, ...t4) => {
|
|
2197
2209
|
this.emit(e8, ...t4);
|
|
2198
|
-
}), 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
|
|
2210
|
+
}), 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 fi(this.services, this.options), this.translator.on(`*`, (e8, ...t4) => {
|
|
2199
2211
|
this.emit(e8, ...t4);
|
|
2200
2212
|
}), this.modules.external.forEach((e8) => {
|
|
2201
2213
|
e8.init && e8.init(this);
|
|
@@ -2242,7 +2254,7 @@ var J = class e4 extends G {
|
|
|
2242
2254
|
use(e6) {
|
|
2243
2255
|
if (!e6) throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
|
|
2244
2256
|
if (!e6.type) throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);
|
|
2245
|
-
return e6.type === `backend` && (this.modules.backend = e6), (e6.type === `logger` || e6.log && e6.warn && e6.error) && (this.modules.logger = e6), e6.type === `languageDetector` && (this.modules.languageDetector = e6), e6.type === `i18nFormat` && (this.modules.i18nFormat = e6), e6.type === `postProcessor` &&
|
|
2257
|
+
return e6.type === `backend` && (this.modules.backend = e6), (e6.type === `logger` || e6.log && e6.warn && e6.error) && (this.modules.logger = e6), e6.type === `languageDetector` && (this.modules.languageDetector = e6), e6.type === `i18nFormat` && (this.modules.i18nFormat = e6), e6.type === `postProcessor` && ci.addPostProcessor(e6), e6.type === `formatter` && (this.modules.formatter = e6), e6.type === `3rdParty` && this.modules.external.push(e6), this;
|
|
2246
2258
|
}
|
|
2247
2259
|
setResolvedLanguage(e6) {
|
|
2248
2260
|
if (e6 && this.languages && ![`cimode`, `dev`].includes(e6)) {
|
|
@@ -2336,7 +2348,7 @@ var J = class e4 extends G {
|
|
|
2336
2348
|
}
|
|
2337
2349
|
} catch {
|
|
2338
2350
|
}
|
|
2339
|
-
let t2 = `ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`), n2 = this.services?.languageUtils || new
|
|
2351
|
+
let t2 = `ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`), n2 = this.services?.languageUtils || new pi(Ei());
|
|
2340
2352
|
return e6.toLowerCase().indexOf(`-latn`) > 1 ? `ltr` : t2.includes(n2.getLanguagePartFromCode(e6)) || e6.toLowerCase().indexOf(`-arab`) > 1 ? `rtl` : `ltr`;
|
|
2341
2353
|
}
|
|
2342
2354
|
static createInstance(t2 = {}, n2) {
|
|
@@ -2349,11 +2361,11 @@ var J = class e4 extends G {
|
|
|
2349
2361
|
let i2 = { ...this.options, ...t2, isClone: true }, a2 = new e4(i2);
|
|
2350
2362
|
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e6) => {
|
|
2351
2363
|
a2[e6] = this[e6];
|
|
2352
|
-
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new
|
|
2353
|
-
let e6 = { ...
|
|
2354
|
-
a2.services.interpolator = new
|
|
2364
|
+
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new si(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) {
|
|
2365
|
+
let e6 = { ...Ei().interpolation, ...this.options.interpolation, ...t2.interpolation }, n3 = { ...i2, interpolation: e6 };
|
|
2366
|
+
a2.services.interpolator = new yi(n3);
|
|
2355
2367
|
}
|
|
2356
|
-
return a2.translator = new
|
|
2368
|
+
return a2.translator = new fi(a2.services, i2), a2.translator.on(`*`, (e6, ...t3) => {
|
|
2357
2369
|
a2.emit(e6, ...t3);
|
|
2358
2370
|
}), a2.init(i2, n2), a2.translator.options = i2, a2.translator.backendConnector.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, a2;
|
|
2359
2371
|
}
|
|
@@ -2362,7 +2374,7 @@ var J = class e4 extends G {
|
|
|
2362
2374
|
}
|
|
2363
2375
|
}.createInstance();
|
|
2364
2376
|
J.createInstance, J.dir, J.init, J.loadResources, J.reloadResources, J.use, J.changeLanguage, J.getFixedT, J.t, J.exists, J.setDefaultNamespace, J.hasLoadedNamespace, J.loadNamespaces, J.loadLanguages;
|
|
2365
|
-
var
|
|
2377
|
+
var ki = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 = false, disableAutoInit: i2 = false, bindI18n: a2 }, { icu: o2 } = {}) => {
|
|
2366
2378
|
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 = J.createInstance(i2 ? s2 : void 0);
|
|
2367
2379
|
return o2 && c2.use(o2), t2 && c2.use({ type: `backend`, read: async (e7, n3, r3) => {
|
|
2368
2380
|
try {
|
|
@@ -2372,8 +2384,8 @@ var Oi = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 =
|
|
|
2372
2384
|
}
|
|
2373
2385
|
} }), n2 && (s2.resources = { [e6]: { translation: n2 } }), i2 || c2.init(s2), c2;
|
|
2374
2386
|
};
|
|
2375
|
-
var
|
|
2376
|
-
function
|
|
2387
|
+
var Ai = [`__proto__`, `constructor`, `prototype`];
|
|
2388
|
+
function ji(e6, t2, n2) {
|
|
2377
2389
|
function r2(e7) {
|
|
2378
2390
|
return e7 && e7.indexOf(`###`) > -1 ? e7.replace(/###/g, `.`) : e7;
|
|
2379
2391
|
}
|
|
@@ -2383,64 +2395,64 @@ function Ai(e6, t2, n2) {
|
|
|
2383
2395
|
for (var a2 = typeof t2 == `string` ? t2.split(`.`) : [].concat(t2); a2.length > 1; ) {
|
|
2384
2396
|
if (i2()) return {};
|
|
2385
2397
|
var o2 = r2(a2.shift());
|
|
2386
|
-
if (
|
|
2398
|
+
if (Ai.indexOf(o2) > -1) return {};
|
|
2387
2399
|
!e6[o2] && n2 && (e6[o2] = new n2()), e6 = e6[o2];
|
|
2388
2400
|
}
|
|
2389
2401
|
if (i2()) return {};
|
|
2390
2402
|
var s2 = r2(a2.shift());
|
|
2391
|
-
return
|
|
2403
|
+
return Ai.indexOf(s2) > -1 ? {} : { obj: e6, k: s2 };
|
|
2392
2404
|
}
|
|
2393
|
-
function
|
|
2394
|
-
var r2 =
|
|
2405
|
+
function Mi(e6, t2, n2) {
|
|
2406
|
+
var r2 = ji(e6, t2, Object), i2 = r2.obj, a2 = r2.k;
|
|
2395
2407
|
i2 !== void 0 && (i2[a2] = n2);
|
|
2396
2408
|
}
|
|
2397
|
-
function
|
|
2398
|
-
var n2 =
|
|
2409
|
+
function Ni(e6, t2) {
|
|
2410
|
+
var n2 = ji(e6, t2), r2 = n2.obj, i2 = n2.k;
|
|
2399
2411
|
if (r2) return r2[i2];
|
|
2400
2412
|
}
|
|
2401
|
-
var
|
|
2402
|
-
var
|
|
2403
|
-
var
|
|
2404
|
-
function
|
|
2405
|
-
return
|
|
2413
|
+
var Pi = [];
|
|
2414
|
+
var Fi = Pi.forEach;
|
|
2415
|
+
var Ii = Pi.slice;
|
|
2416
|
+
function Li(e6) {
|
|
2417
|
+
return Fi.call(Ii.call(arguments, 1), function(t2) {
|
|
2406
2418
|
if (t2) for (var n2 = 0, r2 = Object.keys(t2); n2 < r2.length; n2++) {
|
|
2407
2419
|
var i2 = r2[n2];
|
|
2408
|
-
|
|
2420
|
+
Ai.indexOf(i2) > -1 || e6[i2] === void 0 && (e6[i2] = t2[i2]);
|
|
2409
2421
|
}
|
|
2410
2422
|
}), e6;
|
|
2411
2423
|
}
|
|
2412
|
-
function
|
|
2413
|
-
let n2 = t2 && t2.cache ? t2.cache :
|
|
2414
|
-
return (t2 && t2.strategy ? t2.strategy :
|
|
2424
|
+
function Ri(e6, t2) {
|
|
2425
|
+
let n2 = t2 && t2.cache ? t2.cache : Ji, r2 = t2 && t2.serializer ? t2.serializer : Ki;
|
|
2426
|
+
return (t2 && t2.strategy ? t2.strategy : Ui)(e6, { cache: n2, serializer: r2 });
|
|
2415
2427
|
}
|
|
2416
|
-
function
|
|
2428
|
+
function zi(e6) {
|
|
2417
2429
|
return e6 == null || typeof e6 == `number` || typeof e6 == `boolean`;
|
|
2418
2430
|
}
|
|
2419
|
-
function
|
|
2420
|
-
let i2 =
|
|
2431
|
+
function Bi(e6, t2, n2, r2) {
|
|
2432
|
+
let i2 = zi(r2) ? r2 : n2(r2), a2 = t2.get(i2);
|
|
2421
2433
|
return a2 === void 0 && (a2 = e6.call(this, r2), t2.set(i2, a2)), a2;
|
|
2422
2434
|
}
|
|
2423
|
-
function
|
|
2435
|
+
function Vi(e6, t2, n2) {
|
|
2424
2436
|
let r2 = Array.prototype.slice.call(arguments, 3), i2 = n2(r2), a2 = t2.get(i2);
|
|
2425
2437
|
return a2 === void 0 && (a2 = e6.apply(this, r2), t2.set(i2, a2)), a2;
|
|
2426
2438
|
}
|
|
2427
|
-
function
|
|
2439
|
+
function Hi(e6, t2, n2, r2, i2) {
|
|
2428
2440
|
return n2.bind(t2, e6, r2, i2);
|
|
2429
2441
|
}
|
|
2430
|
-
function Hi(e6, t2) {
|
|
2431
|
-
let n2 = e6.length === 1 ? zi : Bi;
|
|
2432
|
-
return Vi(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2433
|
-
}
|
|
2434
2442
|
function Ui(e6, t2) {
|
|
2435
|
-
|
|
2443
|
+
let n2 = e6.length === 1 ? Bi : Vi;
|
|
2444
|
+
return Hi(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2436
2445
|
}
|
|
2437
2446
|
function Wi(e6, t2) {
|
|
2438
|
-
return
|
|
2447
|
+
return Hi(e6, this, Vi, t2.cache.create(), t2.serializer);
|
|
2439
2448
|
}
|
|
2440
|
-
|
|
2449
|
+
function Gi(e6, t2) {
|
|
2450
|
+
return Hi(e6, this, Bi, t2.cache.create(), t2.serializer);
|
|
2451
|
+
}
|
|
2452
|
+
var Ki = function() {
|
|
2441
2453
|
return JSON.stringify(arguments);
|
|
2442
2454
|
};
|
|
2443
|
-
var
|
|
2455
|
+
var qi = class {
|
|
2444
2456
|
constructor() {
|
|
2445
2457
|
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2446
2458
|
}
|
|
@@ -2451,14 +2463,14 @@ var Ki = class {
|
|
|
2451
2463
|
this.cache[e6] = t2;
|
|
2452
2464
|
}
|
|
2453
2465
|
};
|
|
2454
|
-
var
|
|
2455
|
-
return new
|
|
2466
|
+
var Ji = { create: function() {
|
|
2467
|
+
return new qi();
|
|
2456
2468
|
} };
|
|
2457
|
-
var
|
|
2458
|
-
var
|
|
2459
|
-
function
|
|
2469
|
+
var Yi = { variadic: Wi, monadic: Gi };
|
|
2470
|
+
var Xi = /(?:[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;
|
|
2471
|
+
function Zi(e6) {
|
|
2460
2472
|
let t2 = {};
|
|
2461
|
-
return e6.replace(
|
|
2473
|
+
return e6.replace(Xi, (e7) => {
|
|
2462
2474
|
let n2 = e7.length;
|
|
2463
2475
|
switch (e7[0]) {
|
|
2464
2476
|
case `G`:
|
|
@@ -2545,10 +2557,10 @@ function Xi(e6) {
|
|
|
2545
2557
|
return ``;
|
|
2546
2558
|
}), t2;
|
|
2547
2559
|
}
|
|
2548
|
-
var
|
|
2549
|
-
function
|
|
2560
|
+
var Qi = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
2561
|
+
function $i(e6) {
|
|
2550
2562
|
if (e6.length === 0) throw Error(`Number skeleton cannot be empty`);
|
|
2551
|
-
let t2 = e6.split(
|
|
2563
|
+
let t2 = e6.split(Qi).filter((e7) => e7.length > 0), n2 = [];
|
|
2552
2564
|
for (let e7 of t2) {
|
|
2553
2565
|
let t3 = e7.split(`/`);
|
|
2554
2566
|
if (t3.length === 0) throw Error(`Invalid number skeleton`);
|
|
@@ -2558,20 +2570,20 @@ function Qi(e6) {
|
|
|
2558
2570
|
}
|
|
2559
2571
|
return n2;
|
|
2560
2572
|
}
|
|
2561
|
-
function
|
|
2573
|
+
function ea(e6) {
|
|
2562
2574
|
return e6.replace(/^(.*?)-/, ``);
|
|
2563
2575
|
}
|
|
2564
|
-
var
|
|
2565
|
-
var
|
|
2566
|
-
var
|
|
2567
|
-
var
|
|
2568
|
-
function
|
|
2576
|
+
var ta = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
2577
|
+
var na = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
2578
|
+
var ra = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
2579
|
+
var ia = /^(0+)$/;
|
|
2580
|
+
function aa(e6) {
|
|
2569
2581
|
let t2 = {};
|
|
2570
|
-
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(
|
|
2582
|
+
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(na, function(e7, n2, r2) {
|
|
2571
2583
|
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), ``;
|
|
2572
2584
|
}), t2;
|
|
2573
2585
|
}
|
|
2574
|
-
function
|
|
2586
|
+
function oa(e6) {
|
|
2575
2587
|
switch (e6) {
|
|
2576
2588
|
case `sign-auto`:
|
|
2577
2589
|
return { signDisplay: `auto` };
|
|
@@ -2595,19 +2607,19 @@ function aa(e6) {
|
|
|
2595
2607
|
return { signDisplay: `never` };
|
|
2596
2608
|
}
|
|
2597
2609
|
}
|
|
2598
|
-
function
|
|
2610
|
+
function sa(e6) {
|
|
2599
2611
|
let t2;
|
|
2600
2612
|
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) {
|
|
2601
2613
|
let n2 = e6.slice(0, 2);
|
|
2602
|
-
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !
|
|
2614
|
+
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !ia.test(e6)) throw Error(`Malformed concise eng/scientific notation`);
|
|
2603
2615
|
t2.minimumIntegerDigits = e6.length;
|
|
2604
2616
|
}
|
|
2605
2617
|
return t2;
|
|
2606
2618
|
}
|
|
2607
|
-
function sa(e6) {
|
|
2608
|
-
return aa(e6) || {};
|
|
2609
|
-
}
|
|
2610
2619
|
function ca(e6) {
|
|
2620
|
+
return oa(e6) || {};
|
|
2621
|
+
}
|
|
2622
|
+
function la(e6) {
|
|
2611
2623
|
let t2 = {};
|
|
2612
2624
|
for (let n2 of e6) {
|
|
2613
2625
|
switch (n2.stem) {
|
|
@@ -2631,7 +2643,7 @@ function ca(e6) {
|
|
|
2631
2643
|
continue;
|
|
2632
2644
|
case `measure-unit`:
|
|
2633
2645
|
case `unit`:
|
|
2634
|
-
t2.style = `unit`, t2.unit =
|
|
2646
|
+
t2.style = `unit`, t2.unit = ea(n2.options[0]);
|
|
2635
2647
|
continue;
|
|
2636
2648
|
case `compact-short`:
|
|
2637
2649
|
case `K`:
|
|
@@ -2642,10 +2654,10 @@ function ca(e6) {
|
|
|
2642
2654
|
t2.notation = `compact`, t2.compactDisplay = `long`;
|
|
2643
2655
|
continue;
|
|
2644
2656
|
case `scientific`:
|
|
2645
|
-
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2657
|
+
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...ca(t3) }), {}) };
|
|
2646
2658
|
continue;
|
|
2647
2659
|
case `engineering`:
|
|
2648
|
-
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2660
|
+
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...ca(t3) }), {}) };
|
|
2649
2661
|
continue;
|
|
2650
2662
|
case `notation-simple`:
|
|
2651
2663
|
t2.notation = `standard`;
|
|
@@ -2688,7 +2700,7 @@ function ca(e6) {
|
|
|
2688
2700
|
continue;
|
|
2689
2701
|
case `integer-width`:
|
|
2690
2702
|
if (n2.options.length > 1) throw RangeError(`integer-width stems only accept a single optional option`);
|
|
2691
|
-
n2.options[0].replace(
|
|
2703
|
+
n2.options[0].replace(ra, function(e8, n3, r3, i2, a2, o2) {
|
|
2692
2704
|
if (n3) t2.minimumIntegerDigits = r3.length;
|
|
2693
2705
|
else if (i2 && a2) throw Error(`We currently do not support maximum integer digits`);
|
|
2694
2706
|
else if (o2) throw Error(`We currently do not support exact integer digits`);
|
|
@@ -2696,83 +2708,83 @@ function ca(e6) {
|
|
|
2696
2708
|
});
|
|
2697
2709
|
continue;
|
|
2698
2710
|
}
|
|
2699
|
-
if (
|
|
2711
|
+
if (ia.test(n2.stem)) {
|
|
2700
2712
|
t2.minimumIntegerDigits = n2.stem.length;
|
|
2701
2713
|
continue;
|
|
2702
2714
|
}
|
|
2703
|
-
if (
|
|
2715
|
+
if (ta.test(n2.stem)) {
|
|
2704
2716
|
if (n2.options.length > 1) throw RangeError(`Fraction-precision stems only accept a single optional option`);
|
|
2705
|
-
n2.stem.replace(
|
|
2717
|
+
n2.stem.replace(ta, function(e9, n3, r3, i2, a2, o2) {
|
|
2706
2718
|
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), ``;
|
|
2707
2719
|
});
|
|
2708
2720
|
let e8 = n2.options[0];
|
|
2709
|
-
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...
|
|
2721
|
+
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...aa(e8) });
|
|
2710
2722
|
continue;
|
|
2711
2723
|
}
|
|
2712
|
-
if (
|
|
2713
|
-
t2 = { ...t2, ...
|
|
2724
|
+
if (na.test(n2.stem)) {
|
|
2725
|
+
t2 = { ...t2, ...aa(n2.stem) };
|
|
2714
2726
|
continue;
|
|
2715
2727
|
}
|
|
2716
|
-
let e7 =
|
|
2728
|
+
let e7 = oa(n2.stem);
|
|
2717
2729
|
e7 && (t2 = { ...t2, ...e7 });
|
|
2718
|
-
let r2 =
|
|
2730
|
+
let r2 = sa(n2.stem);
|
|
2719
2731
|
r2 && (t2 = { ...t2, ...r2 });
|
|
2720
2732
|
}
|
|
2721
2733
|
return t2;
|
|
2722
2734
|
}
|
|
2723
|
-
var
|
|
2735
|
+
var ua = function(e6) {
|
|
2724
2736
|
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;
|
|
2725
2737
|
}({});
|
|
2726
|
-
function
|
|
2738
|
+
function da(e6) {
|
|
2727
2739
|
return e6.type === 0;
|
|
2728
2740
|
}
|
|
2729
|
-
function
|
|
2741
|
+
function fa(e6) {
|
|
2730
2742
|
return e6.type === 1;
|
|
2731
2743
|
}
|
|
2732
|
-
function
|
|
2744
|
+
function pa(e6) {
|
|
2733
2745
|
return e6.type === 2;
|
|
2734
2746
|
}
|
|
2735
|
-
function
|
|
2747
|
+
function ma(e6) {
|
|
2736
2748
|
return e6.type === 3;
|
|
2737
2749
|
}
|
|
2738
|
-
function
|
|
2750
|
+
function ha(e6) {
|
|
2739
2751
|
return e6.type === 4;
|
|
2740
2752
|
}
|
|
2741
|
-
function
|
|
2753
|
+
function ga(e6) {
|
|
2742
2754
|
return e6.type === 5;
|
|
2743
2755
|
}
|
|
2744
|
-
function
|
|
2756
|
+
function _a(e6) {
|
|
2745
2757
|
return e6.type === 6;
|
|
2746
2758
|
}
|
|
2747
|
-
function
|
|
2759
|
+
function va(e6) {
|
|
2748
2760
|
return e6.type === 7;
|
|
2749
2761
|
}
|
|
2750
|
-
function
|
|
2762
|
+
function ya(e6) {
|
|
2751
2763
|
return e6.type === 8;
|
|
2752
2764
|
}
|
|
2753
|
-
function
|
|
2765
|
+
function ba(e6) {
|
|
2754
2766
|
return !!(e6 && typeof e6 == `object` && e6.type === 0);
|
|
2755
2767
|
}
|
|
2756
|
-
function
|
|
2768
|
+
function xa(e6) {
|
|
2757
2769
|
return !!(e6 && typeof e6 == `object` && e6.type === 1);
|
|
2758
2770
|
}
|
|
2759
|
-
var
|
|
2771
|
+
var Sa = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
2760
2772
|
var Y = { "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`] };
|
|
2761
|
-
function
|
|
2773
|
+
function Ca(e6, t2) {
|
|
2762
2774
|
let n2 = ``;
|
|
2763
2775
|
for (let r2 = 0; r2 < e6.length; r2++) {
|
|
2764
2776
|
let i2 = e6.charAt(r2);
|
|
2765
2777
|
if (i2 === `j`) {
|
|
2766
2778
|
let a2 = 0;
|
|
2767
2779
|
for (; r2 + 1 < e6.length && e6.charAt(r2 + 1) === i2; ) a2++, r2++;
|
|
2768
|
-
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 =
|
|
2780
|
+
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 = wa(t2);
|
|
2769
2781
|
for ((c2 == `H` || c2 == `k`) && (s2 = 0); s2-- > 0; ) n2 += `a`;
|
|
2770
2782
|
for (; o2-- > 0; ) n2 = c2 + n2;
|
|
2771
2783
|
} else n2 += i2 === `J` ? `H` : i2;
|
|
2772
2784
|
}
|
|
2773
2785
|
return n2;
|
|
2774
2786
|
}
|
|
2775
|
-
function
|
|
2787
|
+
function wa(e6) {
|
|
2776
2788
|
let t2 = e6.hourCycle;
|
|
2777
2789
|
if (t2 === void 0) {
|
|
2778
2790
|
let n3 = e6;
|
|
@@ -2793,34 +2805,34 @@ function Ca(e6) {
|
|
|
2793
2805
|
let n2 = e6.language, r2;
|
|
2794
2806
|
return n2 !== `root` && (r2 = e6.maximize().region), (Y[`${n2}-${r2}`] || Y[r2 || ``] || Y[n2 || ``] || Y[`${n2}-001`] || Y[`001`])[0].charAt(0);
|
|
2795
2807
|
}
|
|
2796
|
-
var
|
|
2797
|
-
var
|
|
2808
|
+
var Ta = RegExp(`^${Sa.source}*`);
|
|
2809
|
+
var Ea = RegExp(`${Sa.source}*$`);
|
|
2798
2810
|
function X(e6, t2) {
|
|
2799
2811
|
return { start: e6, end: t2 };
|
|
2800
2812
|
}
|
|
2801
|
-
var
|
|
2802
|
-
var
|
|
2803
|
-
var
|
|
2804
|
-
var
|
|
2813
|
+
var Da = !!Object.fromEntries;
|
|
2814
|
+
var Oa = !!String.prototype.trimStart;
|
|
2815
|
+
var ka = !!String.prototype.trimEnd;
|
|
2816
|
+
var Aa = Da ? Object.fromEntries : function(e6) {
|
|
2805
2817
|
let t2 = {};
|
|
2806
2818
|
for (let [n2, r2] of e6) t2[n2] = r2;
|
|
2807
2819
|
return t2;
|
|
2808
2820
|
};
|
|
2809
|
-
var
|
|
2821
|
+
var ja = Oa ? function(e6) {
|
|
2810
2822
|
return e6.trimStart();
|
|
2811
2823
|
} : function(e6) {
|
|
2812
|
-
return e6.replace(
|
|
2824
|
+
return e6.replace(Ta, ``);
|
|
2813
2825
|
};
|
|
2814
|
-
var
|
|
2826
|
+
var Ma = ka ? function(e6) {
|
|
2815
2827
|
return e6.trimEnd();
|
|
2816
2828
|
} : function(e6) {
|
|
2817
|
-
return e6.replace(
|
|
2829
|
+
return e6.replace(Ea, ``);
|
|
2818
2830
|
};
|
|
2819
|
-
var
|
|
2820
|
-
function
|
|
2821
|
-
return
|
|
2831
|
+
var Na = RegExp(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`);
|
|
2832
|
+
function Pa(e6, t2) {
|
|
2833
|
+
return Na.lastIndex = t2, Na.exec(e6)[1] ?? ``;
|
|
2822
2834
|
}
|
|
2823
|
-
function
|
|
2835
|
+
function Fa(e6) {
|
|
2824
2836
|
if (e6.length === 0) return null;
|
|
2825
2837
|
let t2 = 1, n2 = 1;
|
|
2826
2838
|
for (let r2 = 0; r2 < e6.length; ) {
|
|
@@ -2841,7 +2853,7 @@ function Pa(e6) {
|
|
|
2841
2853
|
}
|
|
2842
2854
|
return { offset: e6.length, line: t2, column: n2 };
|
|
2843
2855
|
}
|
|
2844
|
-
var
|
|
2856
|
+
var Ia = class {
|
|
2845
2857
|
constructor(e6, t2 = {}) {
|
|
2846
2858
|
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;
|
|
2847
2859
|
}
|
|
@@ -2850,7 +2862,7 @@ var Fa = class {
|
|
|
2850
2862
|
if (this.message.length > 0) {
|
|
2851
2863
|
let e6 = this.message.charCodeAt(0);
|
|
2852
2864
|
if (e6 !== 35 && e6 !== 39 && e6 !== 60 && e6 !== 123 && e6 !== 125) {
|
|
2853
|
-
let e7 =
|
|
2865
|
+
let e7 = Fa(this.message);
|
|
2854
2866
|
if (e7) {
|
|
2855
2867
|
let t2 = this.clonePosition();
|
|
2856
2868
|
return this.position = e7, { val: [{ type: 0, value: this.message, location: X(t2, this.clonePosition()) }], err: null };
|
|
@@ -2874,7 +2886,7 @@ var Fa = class {
|
|
|
2874
2886
|
} else if (i2 === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
2875
2887
|
if (n2) break;
|
|
2876
2888
|
return this.error(26, X(this.clonePosition(), this.clonePosition()));
|
|
2877
|
-
} else if (i2 === 60 && !this.ignoreTag &&
|
|
2889
|
+
} else if (i2 === 60 && !this.ignoreTag && La(this.peek() || 0)) {
|
|
2878
2890
|
let n3 = this.parseTag(e6, t2);
|
|
2879
2891
|
if (n3.err) return n3;
|
|
2880
2892
|
r2.push(n3.val);
|
|
@@ -2896,7 +2908,7 @@ var Fa = class {
|
|
|
2896
2908
|
if (i2.err) return i2;
|
|
2897
2909
|
let a2 = i2.val, o2 = this.clonePosition();
|
|
2898
2910
|
if (this.bumpIf(`</`)) {
|
|
2899
|
-
if (this.isEOF() || !
|
|
2911
|
+
if (this.isEOF() || !La(this.char())) return this.error(23, X(o2, this.clonePosition()));
|
|
2900
2912
|
let e7 = this.clonePosition();
|
|
2901
2913
|
return r2 === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? { val: { type: 8, value: r2, children: a2, location: X(n2, this.clonePosition()) }, err: null } : this.error(23, X(o2, this.clonePosition()))) : this.error(26, X(e7, this.clonePosition()));
|
|
2902
2914
|
}
|
|
@@ -2906,7 +2918,7 @@ var Fa = class {
|
|
|
2906
2918
|
}
|
|
2907
2919
|
parseTagName() {
|
|
2908
2920
|
let e6 = this.offset();
|
|
2909
|
-
for (this.bump(); !this.isEOF() &&
|
|
2921
|
+
for (this.bump(); !this.isEOF() && za(this.char()); ) this.bump();
|
|
2910
2922
|
return this.message.slice(e6, this.offset());
|
|
2911
2923
|
}
|
|
2912
2924
|
parseLiteral(e6, t2) {
|
|
@@ -2930,7 +2942,7 @@ var Fa = class {
|
|
|
2930
2942
|
return { val: { type: 0, value: r2, location: i2 }, err: null };
|
|
2931
2943
|
}
|
|
2932
2944
|
tryParseLeftAngleBracket() {
|
|
2933
|
-
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !
|
|
2945
|
+
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !Ra(this.peek() || 0)) ? (this.bump(), `<`) : null;
|
|
2934
2946
|
}
|
|
2935
2947
|
tryParseQuote(e6) {
|
|
2936
2948
|
if (this.isEOF() || this.char() !== 39) return null;
|
|
@@ -2985,7 +2997,7 @@ var Fa = class {
|
|
|
2985
2997
|
}
|
|
2986
2998
|
}
|
|
2987
2999
|
parseIdentifierIfPossible() {
|
|
2988
|
-
let e6 = this.clonePosition(), t2 = this.offset(), n2 =
|
|
3000
|
+
let e6 = this.clonePosition(), t2 = this.offset(), n2 = Pa(this.message, t2), r2 = t2 + n2.length;
|
|
2989
3001
|
return this.bumpTo(r2), { value: n2, location: X(e6, this.clonePosition()) };
|
|
2990
3002
|
}
|
|
2991
3003
|
parseArgumentOptions(e6, t2, n2, r2) {
|
|
@@ -3002,7 +3014,7 @@ var Fa = class {
|
|
|
3002
3014
|
this.bumpSpace();
|
|
3003
3015
|
let t4 = this.clonePosition(), n3 = this.parseSimpleArgStyleIfPossible();
|
|
3004
3016
|
if (n3.err) return n3;
|
|
3005
|
-
let r3 =
|
|
3017
|
+
let r3 = Ma(n3.val);
|
|
3006
3018
|
if (r3.length === 0) return this.error(6, X(this.clonePosition(), this.clonePosition()));
|
|
3007
3019
|
e7 = { style: r3, styleLocation: X(t4, this.clonePosition()) };
|
|
3008
3020
|
}
|
|
@@ -3010,7 +3022,7 @@ var Fa = class {
|
|
|
3010
3022
|
if (t3.err) return t3;
|
|
3011
3023
|
let i3 = X(r2, this.clonePosition());
|
|
3012
3024
|
if (e7 && e7.style.startsWith(`::`)) {
|
|
3013
|
-
let t4 =
|
|
3025
|
+
let t4 = ja(e7.style.slice(2));
|
|
3014
3026
|
if (a2 === `number`) {
|
|
3015
3027
|
let r3 = this.parseNumberSkeletonFromString(t4, e7.styleLocation);
|
|
3016
3028
|
return r3.err ? r3 : { val: { type: 2, value: n2, location: i3, style: r3.val }, err: null };
|
|
@@ -3018,8 +3030,8 @@ var Fa = class {
|
|
|
3018
3030
|
{
|
|
3019
3031
|
if (t4.length === 0) return this.error(10, i3);
|
|
3020
3032
|
let r3 = t4;
|
|
3021
|
-
this.locale && (r3 =
|
|
3022
|
-
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ?
|
|
3033
|
+
this.locale && (r3 = Ca(t4, this.locale));
|
|
3034
|
+
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ? Zi(r3) : {} };
|
|
3023
3035
|
return { val: { type: a2 === `date` ? 3 : 4, value: n2, location: i3, style: o3 }, err: null };
|
|
3024
3036
|
}
|
|
3025
3037
|
}
|
|
@@ -3044,7 +3056,7 @@ var Fa = class {
|
|
|
3044
3056
|
let l2 = this.tryParseArgumentClose(r2);
|
|
3045
3057
|
if (l2.err) return l2;
|
|
3046
3058
|
let u2 = X(r2, this.clonePosition());
|
|
3047
|
-
return a2 === `select` ? { val: { type: 5, value: n2, options:
|
|
3059
|
+
return a2 === `select` ? { val: { type: 5, value: n2, options: Aa(c2.val), location: u2 }, err: null } : { val: { type: 6, value: n2, options: Aa(c2.val), offset: s2, pluralType: a2 === `plural` ? `cardinal` : `ordinal`, location: u2 }, err: null };
|
|
3048
3060
|
}
|
|
3049
3061
|
default:
|
|
3050
3062
|
return this.error(5, X(i2, o2));
|
|
@@ -3078,11 +3090,11 @@ var Fa = class {
|
|
|
3078
3090
|
parseNumberSkeletonFromString(e6, t2) {
|
|
3079
3091
|
let n2 = [];
|
|
3080
3092
|
try {
|
|
3081
|
-
n2 =
|
|
3093
|
+
n2 = $i(e6);
|
|
3082
3094
|
} catch {
|
|
3083
3095
|
return this.error(7, t2);
|
|
3084
3096
|
}
|
|
3085
|
-
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ?
|
|
3097
|
+
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ? la(n2) : {} }, err: null };
|
|
3086
3098
|
}
|
|
3087
3099
|
tryParsePluralOrSelectOptions(e6, t2, n2, r2) {
|
|
3088
3100
|
let i2 = false, a2 = [], o2 = /* @__PURE__ */ new Set(), { value: s2, location: c2 } = r2;
|
|
@@ -3164,7 +3176,7 @@ var Fa = class {
|
|
|
3164
3176
|
}
|
|
3165
3177
|
}
|
|
3166
3178
|
bumpSpace() {
|
|
3167
|
-
for (; !this.isEOF() &&
|
|
3179
|
+
for (; !this.isEOF() && Ba(this.char()); ) this.bump();
|
|
3168
3180
|
}
|
|
3169
3181
|
peek() {
|
|
3170
3182
|
if (this.isEOF()) return null;
|
|
@@ -3172,34 +3184,34 @@ var Fa = class {
|
|
|
3172
3184
|
return this.message.charCodeAt(t2 + (e6 >= 65536 ? 2 : 1)) ?? null;
|
|
3173
3185
|
}
|
|
3174
3186
|
};
|
|
3175
|
-
function Ia(e6) {
|
|
3176
|
-
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
3177
|
-
}
|
|
3178
3187
|
function La(e6) {
|
|
3179
|
-
return
|
|
3188
|
+
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
3180
3189
|
}
|
|
3181
3190
|
function Ra(e6) {
|
|
3182
|
-
return e6
|
|
3191
|
+
return La(e6) || e6 === 47;
|
|
3183
3192
|
}
|
|
3184
3193
|
function za(e6) {
|
|
3185
|
-
return e6 >=
|
|
3194
|
+
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;
|
|
3186
3195
|
}
|
|
3187
3196
|
function Ba(e6) {
|
|
3197
|
+
return e6 >= 9 && e6 <= 13 || e6 === 32 || e6 === 133 || e6 >= 8206 && e6 <= 8207 || e6 === 8232 || e6 === 8233;
|
|
3198
|
+
}
|
|
3199
|
+
function Va(e6) {
|
|
3188
3200
|
e6.forEach((e7) => {
|
|
3189
|
-
if (delete e7.location,
|
|
3190
|
-
else
|
|
3201
|
+
if (delete e7.location, ga(e7) || _a(e7)) for (let t2 in e7.options) delete e7.options[t2].location, Va(e7.options[t2].value);
|
|
3202
|
+
else pa(e7) && ba(e7.style) || (ma(e7) || ha(e7)) && xa(e7.style) ? delete e7.style.location : ya(e7) && Va(e7.children);
|
|
3191
3203
|
});
|
|
3192
3204
|
}
|
|
3193
|
-
function
|
|
3205
|
+
function Ha(e6, t2 = {}) {
|
|
3194
3206
|
t2 = { shouldParseSkeletons: true, requiresOtherClause: true, ...t2 };
|
|
3195
|
-
let n2 = new
|
|
3207
|
+
let n2 = new Ia(e6, t2).parse();
|
|
3196
3208
|
if (n2.err) {
|
|
3197
|
-
let e7 = SyntaxError(
|
|
3209
|
+
let e7 = SyntaxError(ua[n2.err.kind]);
|
|
3198
3210
|
throw e7.location = n2.err.location, e7.originalMessage = n2.err.message, e7;
|
|
3199
3211
|
}
|
|
3200
|
-
return t2?.captureLocation ||
|
|
3212
|
+
return t2?.captureLocation || Va(n2.val), n2.val;
|
|
3201
3213
|
}
|
|
3202
|
-
var
|
|
3214
|
+
var Ua = class extends Error {
|
|
3203
3215
|
constructor(e6, t2, n2) {
|
|
3204
3216
|
super(e6), this.code = t2, this.originalMessage = n2;
|
|
3205
3217
|
}
|
|
@@ -3207,54 +3219,54 @@ var Ha = class extends Error {
|
|
|
3207
3219
|
return `[formatjs Error: ${this.code}] ${this.message}`;
|
|
3208
3220
|
}
|
|
3209
3221
|
};
|
|
3210
|
-
var
|
|
3222
|
+
var Wa = class extends Ua {
|
|
3211
3223
|
constructor(e6, t2, n2, r2) {
|
|
3212
3224
|
super(`Invalid values for "${e6}": "${t2}". Options are "${Object.keys(n2).join(`", "`)}"`, `INVALID_VALUE`, r2);
|
|
3213
3225
|
}
|
|
3214
3226
|
};
|
|
3215
|
-
var
|
|
3227
|
+
var Ga = class extends Ua {
|
|
3216
3228
|
constructor(e6, t2, n2) {
|
|
3217
3229
|
super(`Value for "${e6}" must be of type ${t2}`, `INVALID_VALUE`, n2);
|
|
3218
3230
|
}
|
|
3219
3231
|
};
|
|
3220
|
-
var
|
|
3232
|
+
var Ka = class extends Ua {
|
|
3221
3233
|
constructor(e6, t2) {
|
|
3222
3234
|
super(`The intl string context variable "${e6}" was not provided to the string "${t2}"`, `MISSING_VALUE`, t2);
|
|
3223
3235
|
}
|
|
3224
3236
|
};
|
|
3225
|
-
function
|
|
3237
|
+
function qa(e6) {
|
|
3226
3238
|
return e6.length < 2 ? e6 : e6.reduce((e7, t2) => {
|
|
3227
3239
|
let n2 = e7[e7.length - 1];
|
|
3228
3240
|
return !n2 || n2.type !== 0 || t2.type !== 0 ? e7.push(t2) : n2.value += t2.value, e7;
|
|
3229
3241
|
}, []);
|
|
3230
3242
|
}
|
|
3231
|
-
function
|
|
3243
|
+
function Ja(e6) {
|
|
3232
3244
|
return typeof e6 == `function`;
|
|
3233
3245
|
}
|
|
3234
|
-
function
|
|
3235
|
-
if (e6.length === 1 &&
|
|
3246
|
+
function Ya(e6, t2, n2, r2, i2, a2, o2) {
|
|
3247
|
+
if (e6.length === 1 && da(e6[0])) return [{ type: 0, value: e6[0].value }];
|
|
3236
3248
|
let s2 = [];
|
|
3237
3249
|
for (let c2 of e6) {
|
|
3238
|
-
if (
|
|
3250
|
+
if (da(c2)) {
|
|
3239
3251
|
s2.push({ type: 0, value: c2.value });
|
|
3240
3252
|
continue;
|
|
3241
3253
|
}
|
|
3242
|
-
if (
|
|
3254
|
+
if (va(c2)) {
|
|
3243
3255
|
typeof a2 == `number` && s2.push({ type: 0, value: n2.getNumberFormat(t2).format(a2) });
|
|
3244
3256
|
continue;
|
|
3245
3257
|
}
|
|
3246
3258
|
let { value: e7 } = c2;
|
|
3247
|
-
if (!(i2 && e7 in i2)) throw new
|
|
3259
|
+
if (!(i2 && e7 in i2)) throw new Ka(e7, o2);
|
|
3248
3260
|
let l2 = i2[e7];
|
|
3249
|
-
if (
|
|
3250
|
-
else if (
|
|
3251
|
-
let e8 = typeof c2.style == `string` ? r2.date[c2.style] :
|
|
3261
|
+
if (fa(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 });
|
|
3262
|
+
else if (ma(c2)) {
|
|
3263
|
+
let e8 = typeof c2.style == `string` ? r2.date[c2.style] : xa(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3252
3264
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3253
|
-
} else if (
|
|
3254
|
-
let e8 = typeof c2.style == `string` ? r2.time[c2.style] :
|
|
3265
|
+
} else if (ha(c2)) {
|
|
3266
|
+
let e8 = typeof c2.style == `string` ? r2.time[c2.style] : xa(c2.style) ? c2.style.parsedOptions : r2.time.medium;
|
|
3255
3267
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3256
|
-
} else if (
|
|
3257
|
-
let e8 = typeof c2.style == `string` ? r2.number[c2.style] :
|
|
3268
|
+
} else if (pa(c2)) {
|
|
3269
|
+
let e8 = typeof c2.style == `string` ? r2.number[c2.style] : ba(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3258
3270
|
if (e8 && e8.scale) {
|
|
3259
3271
|
let t3 = e8.scale || 1;
|
|
3260
3272
|
if (typeof l2 == `bigint`) {
|
|
@@ -3264,40 +3276,40 @@ function Ja(e6, t2, n2, r2, i2, a2, o2) {
|
|
|
3264
3276
|
}
|
|
3265
3277
|
s2.push({ type: 0, value: n2.getNumberFormat(t2, e8).format(l2) });
|
|
3266
3278
|
} else {
|
|
3267
|
-
if (
|
|
3279
|
+
if (ya(c2)) {
|
|
3268
3280
|
let { children: e8, value: l3 } = c2, u2 = i2[l3];
|
|
3269
|
-
if (!
|
|
3270
|
-
let d2 = u2(
|
|
3281
|
+
if (!Ja(u2)) throw new Ga(l3, `function`, o2);
|
|
3282
|
+
let d2 = u2(Ya(e8, t2, n2, r2, i2, a2).map((e9) => e9.value));
|
|
3271
3283
|
Array.isArray(d2) || (d2 = [d2]), s2.push(...d2.map((e9) => ({ type: typeof e9 == `string` ? 0 : 1, value: e9 })));
|
|
3272
3284
|
}
|
|
3273
|
-
if (
|
|
3285
|
+
if (ga(c2)) {
|
|
3274
3286
|
let e8 = l2, a3 = (Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0) || c2.options.other;
|
|
3275
|
-
if (!a3) throw new
|
|
3276
|
-
s2.push(...
|
|
3277
|
-
} else if (
|
|
3287
|
+
if (!a3) throw new Wa(c2.value, l2, Object.keys(c2.options), o2);
|
|
3288
|
+
s2.push(...Ya(a3.value, t2, n2, r2, i2));
|
|
3289
|
+
} else if (_a(c2)) {
|
|
3278
3290
|
let e8 = `=${l2}`, a3 = Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0;
|
|
3279
3291
|
if (!a3) {
|
|
3280
|
-
if (!Intl.PluralRules) throw new
|
|
3292
|
+
if (!Intl.PluralRules) throw new Ua(`Intl.PluralRules is not available in this environment.
|
|
3281
3293
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3282
3294
|
`, `MISSING_INTL_API`, o2);
|
|
3283
3295
|
let e9 = typeof l2 == `bigint` ? Number(l2) : l2, r3 = n2.getPluralRules(t2, { type: c2.pluralType }).select(e9 - (c2.offset || 0));
|
|
3284
3296
|
a3 = (Object.prototype.hasOwnProperty.call(c2.options, r3) ? c2.options[r3] : void 0) || c2.options.other;
|
|
3285
3297
|
}
|
|
3286
|
-
if (!a3) throw new
|
|
3298
|
+
if (!a3) throw new Wa(c2.value, l2, Object.keys(c2.options), o2);
|
|
3287
3299
|
let u2 = typeof l2 == `bigint` ? Number(l2) : l2;
|
|
3288
|
-
s2.push(...
|
|
3300
|
+
s2.push(...Ya(a3.value, t2, n2, r2, i2, u2 - (c2.offset || 0)));
|
|
3289
3301
|
}
|
|
3290
3302
|
}
|
|
3291
3303
|
}
|
|
3292
|
-
return
|
|
3304
|
+
return qa(s2);
|
|
3293
3305
|
}
|
|
3294
|
-
function
|
|
3306
|
+
function Xa(e6, t2) {
|
|
3295
3307
|
return t2 ? { ...e6, ...t2, ...Object.keys(e6).reduce((n2, r2) => (n2[r2] = { ...e6[r2], ...t2[r2] }, n2), {}) } : e6;
|
|
3296
3308
|
}
|
|
3297
|
-
function
|
|
3298
|
-
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] =
|
|
3309
|
+
function Za(e6, t2) {
|
|
3310
|
+
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] = Xa(e6[r2], t2[r2]), n2), { ...e6 }) : e6;
|
|
3299
3311
|
}
|
|
3300
|
-
function
|
|
3312
|
+
function Qa(e6) {
|
|
3301
3313
|
return { create() {
|
|
3302
3314
|
return { get(t2) {
|
|
3303
3315
|
return e6[t2];
|
|
@@ -3306,23 +3318,23 @@ function Za(e6) {
|
|
|
3306
3318
|
} };
|
|
3307
3319
|
} };
|
|
3308
3320
|
}
|
|
3309
|
-
function
|
|
3310
|
-
return { getNumberFormat:
|
|
3321
|
+
function $a(e6 = { number: {}, dateTime: {}, pluralRules: {} }) {
|
|
3322
|
+
return { getNumberFormat: Ri((...e7) => new Intl.NumberFormat(...e7), { cache: Qa(e6.number), strategy: Yi.variadic }), getDateTimeFormat: Ri((...e7) => new Intl.DateTimeFormat(...e7), { cache: Qa(e6.dateTime), strategy: Yi.variadic }), getPluralRules: Ri((...e7) => new Intl.PluralRules(...e7), { cache: Qa(e6.pluralRules), strategy: Yi.variadic }) };
|
|
3311
3323
|
}
|
|
3312
|
-
var
|
|
3324
|
+
var eo = class e5 {
|
|
3313
3325
|
constructor(t2, n2 = e5.defaultLocale, r2, i2) {
|
|
3314
3326
|
if (this.formatterCache = { number: {}, dateTime: {}, pluralRules: {} }, this.format = (e6) => {
|
|
3315
3327
|
let t3 = this.formatToParts(e6);
|
|
3316
3328
|
if (t3.length === 1) return t3[0].value;
|
|
3317
3329
|
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), []);
|
|
3318
3330
|
return n3.length <= 1 ? n3[0] || `` : n3;
|
|
3319
|
-
}, this.formatToParts = (e6) =>
|
|
3331
|
+
}, this.formatToParts = (e6) => Ya(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`) {
|
|
3320
3332
|
if (this.message = t2, !e5.__parse) throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3321
3333
|
let { ...n3 } = i2 || {};
|
|
3322
3334
|
this.ast = e5.__parse(t2, { ...n3, locale: this.resolvedLocale });
|
|
3323
3335
|
} else this.ast = t2;
|
|
3324
3336
|
if (!Array.isArray(this.ast)) throw TypeError(`A message must be provided as a String or AST.`);
|
|
3325
|
-
this.formats =
|
|
3337
|
+
this.formats = Za(e5.formats, r2), this.formatters = i2 && i2.formatters || $a(this.formatterCache);
|
|
3326
3338
|
}
|
|
3327
3339
|
static {
|
|
3328
3340
|
this.memoizedDefaultLocale = null;
|
|
@@ -3338,32 +3350,32 @@ var $a = class e5 {
|
|
|
3338
3350
|
};
|
|
3339
3351
|
}
|
|
3340
3352
|
static {
|
|
3341
|
-
this.__parse =
|
|
3353
|
+
this.__parse = Ha;
|
|
3342
3354
|
}
|
|
3343
3355
|
static {
|
|
3344
3356
|
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` } } };
|
|
3345
3357
|
}
|
|
3346
3358
|
};
|
|
3347
|
-
function
|
|
3348
|
-
return
|
|
3359
|
+
function to(e6, t2) {
|
|
3360
|
+
return oo(e6) || ao(e6, t2) || ro(e6, t2) || no();
|
|
3349
3361
|
}
|
|
3350
|
-
function
|
|
3362
|
+
function no() {
|
|
3351
3363
|
throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3352
3364
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
3353
3365
|
}
|
|
3354
|
-
function
|
|
3366
|
+
function ro(e6, t2) {
|
|
3355
3367
|
if (e6) {
|
|
3356
|
-
if (typeof e6 == `string`) return
|
|
3368
|
+
if (typeof e6 == `string`) return io(e6, t2);
|
|
3357
3369
|
var n2 = {}.toString.call(e6).slice(8, -1);
|
|
3358
|
-
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) ?
|
|
3370
|
+
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) ? io(e6, t2) : void 0;
|
|
3359
3371
|
}
|
|
3360
3372
|
}
|
|
3361
|
-
function
|
|
3373
|
+
function io(e6, t2) {
|
|
3362
3374
|
(t2 == null || t2 > e6.length) && (t2 = e6.length);
|
|
3363
3375
|
for (var n2 = 0, r2 = Array(t2); n2 < t2; n2++) r2[n2] = e6[n2];
|
|
3364
3376
|
return r2;
|
|
3365
3377
|
}
|
|
3366
|
-
function
|
|
3378
|
+
function ao(e6, t2) {
|
|
3367
3379
|
var n2 = e6 == null ? null : typeof Symbol < `u` && e6[Symbol.iterator] || e6[`@@iterator`];
|
|
3368
3380
|
if (n2 != null) {
|
|
3369
3381
|
var r2, i2, a2, o2, s2 = [], c2 = true, l2 = false;
|
|
@@ -3384,7 +3396,7 @@ function io(e6, t2) {
|
|
|
3384
3396
|
return s2;
|
|
3385
3397
|
}
|
|
3386
3398
|
}
|
|
3387
|
-
function
|
|
3399
|
+
function oo(e6) {
|
|
3388
3400
|
if (Array.isArray(e6)) return e6;
|
|
3389
3401
|
}
|
|
3390
3402
|
function Z(e6) {
|
|
@@ -3395,7 +3407,7 @@ function Z(e6) {
|
|
|
3395
3407
|
return e7 && typeof Symbol == `function` && e7.constructor === Symbol && e7 !== Symbol.prototype ? `symbol` : typeof e7;
|
|
3396
3408
|
}, Z(e6);
|
|
3397
3409
|
}
|
|
3398
|
-
function
|
|
3410
|
+
function so(e6, t2) {
|
|
3399
3411
|
var n2 = Object.keys(e6);
|
|
3400
3412
|
if (Object.getOwnPropertySymbols) {
|
|
3401
3413
|
var r2 = Object.getOwnPropertySymbols(e6);
|
|
@@ -3405,37 +3417,37 @@ function oo(e6, t2) {
|
|
|
3405
3417
|
}
|
|
3406
3418
|
return n2;
|
|
3407
3419
|
}
|
|
3408
|
-
function
|
|
3420
|
+
function co(e6) {
|
|
3409
3421
|
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
3410
3422
|
var n2 = arguments[t2] == null ? {} : arguments[t2];
|
|
3411
|
-
t2 % 2 ?
|
|
3412
|
-
|
|
3413
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) :
|
|
3423
|
+
t2 % 2 ? so(Object(n2), true).forEach(function(t3) {
|
|
3424
|
+
lo(e6, t3, n2[t3]);
|
|
3425
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) : so(Object(n2)).forEach(function(t3) {
|
|
3414
3426
|
Object.defineProperty(e6, t3, Object.getOwnPropertyDescriptor(n2, t3));
|
|
3415
3427
|
});
|
|
3416
3428
|
}
|
|
3417
3429
|
return e6;
|
|
3418
3430
|
}
|
|
3419
|
-
function
|
|
3420
|
-
return (t2 =
|
|
3431
|
+
function lo(e6, t2, n2) {
|
|
3432
|
+
return (t2 = mo(t2)) in e6 ? Object.defineProperty(e6, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e6[t2] = n2, e6;
|
|
3421
3433
|
}
|
|
3422
|
-
function
|
|
3434
|
+
function uo(e6, t2) {
|
|
3423
3435
|
if (!(e6 instanceof t2)) throw TypeError(`Cannot call a class as a function`);
|
|
3424
3436
|
}
|
|
3425
|
-
function
|
|
3437
|
+
function fo(e6, t2) {
|
|
3426
3438
|
for (var n2 = 0; n2 < t2.length; n2++) {
|
|
3427
3439
|
var r2 = t2[n2];
|
|
3428
|
-
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6,
|
|
3440
|
+
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6, mo(r2.key), r2);
|
|
3429
3441
|
}
|
|
3430
3442
|
}
|
|
3431
|
-
function
|
|
3432
|
-
return t2 &&
|
|
3443
|
+
function po(e6, t2, n2) {
|
|
3444
|
+
return t2 && fo(e6.prototype, t2), n2 && fo(e6, n2), Object.defineProperty(e6, "prototype", { writable: false }), e6;
|
|
3433
3445
|
}
|
|
3434
|
-
function
|
|
3435
|
-
var t2 =
|
|
3446
|
+
function mo(e6) {
|
|
3447
|
+
var t2 = ho(e6, `string`);
|
|
3436
3448
|
return Z(t2) == `symbol` ? t2 : t2 + ``;
|
|
3437
3449
|
}
|
|
3438
|
-
function
|
|
3450
|
+
function ho(e6, t2) {
|
|
3439
3451
|
if (Z(e6) != `object` || !e6) return e6;
|
|
3440
3452
|
var n2 = e6[Symbol.toPrimitive];
|
|
3441
3453
|
if (n2 !== void 0) {
|
|
@@ -3445,34 +3457,34 @@ function mo(e6, t2) {
|
|
|
3445
3457
|
}
|
|
3446
3458
|
return (t2 === `string` ? String : Number)(e6);
|
|
3447
3459
|
}
|
|
3448
|
-
function
|
|
3460
|
+
function go() {
|
|
3449
3461
|
return { memoize: true, memoizeFallback: false, bindI18n: ``, bindI18nStore: ``, parseErrorHandler: function(e6, t2, n2, r2) {
|
|
3450
3462
|
return n2;
|
|
3451
3463
|
}, parseLngForICU: function(e6) {
|
|
3452
3464
|
return e6;
|
|
3453
3465
|
}, escapeVariables: false };
|
|
3454
3466
|
}
|
|
3455
|
-
var
|
|
3467
|
+
var _o = function() {
|
|
3456
3468
|
function e6(t2) {
|
|
3457
|
-
|
|
3469
|
+
uo(this, e6), this.type = `i18nFormat`, this.mem = {}, this.init(null, t2);
|
|
3458
3470
|
}
|
|
3459
|
-
return
|
|
3471
|
+
return po(e6, [{ key: `init`, value: function(e7, t2) {
|
|
3460
3472
|
var n2 = this, r2 = e7 && e7.options && e7.options.i18nFormat || {};
|
|
3461
|
-
if (this.options =
|
|
3473
|
+
if (this.options = Li(r2, t2, this.options || {}, go()), this.formats = this.options.formats, e7) {
|
|
3462
3474
|
var i2 = this.options, a2 = i2.bindI18n, o2 = i2.bindI18nStore, s2 = i2.memoize;
|
|
3463
|
-
e7.IntlMessageFormat =
|
|
3475
|
+
e7.IntlMessageFormat = eo, e7.ICU = this, s2 && (a2 && e7.on(a2, function() {
|
|
3464
3476
|
return n2.clearCache();
|
|
3465
3477
|
}), o2 && e7.store.on(o2, function() {
|
|
3466
3478
|
return n2.clearCache();
|
|
3467
3479
|
}));
|
|
3468
3480
|
}
|
|
3469
3481
|
} }, { key: `addUserDefinedFormats`, value: function(e7) {
|
|
3470
|
-
this.formats = this.formats ?
|
|
3482
|
+
this.formats = this.formats ? co(co({}, this.formats), e7) : e7;
|
|
3471
3483
|
} }, { key: `parse`, value: function(e7, t2, n2, r2, i2, a2) {
|
|
3472
3484
|
var o2 = a2 && a2.resolved && a2.resolved.res, s2 = this.options.memoize && `${n2}.${r2}.${i2.replace(/\./g, `###`)}`, c2;
|
|
3473
|
-
this.options.memoize && (c2 =
|
|
3485
|
+
this.options.memoize && (c2 = Ni(this.mem, s2));
|
|
3474
3486
|
try {
|
|
3475
|
-
return c2 || (c2 = new
|
|
3487
|
+
return c2 || (c2 = new eo(e7, this.options.parseLngForICU(n2), this.formats, { ignoreTag: true }), this.options.memoize && (this.options.memoizeFallback || !a2 || o2) && Mi(this.mem, s2, c2)), c2.format(this.escapeVariableValues(t2));
|
|
3476
3488
|
} catch (n3) {
|
|
3477
3489
|
return this.options.parseErrorHandler(n3, i2, e7, t2);
|
|
3478
3490
|
}
|
|
@@ -3483,27 +3495,27 @@ var go = function() {
|
|
|
3483
3495
|
} }, { key: `escapeVariableValues`, value: function(e7) {
|
|
3484
3496
|
if (!this.options.escapeVariables || !e7 || Z(e7) !== `object`) return e7;
|
|
3485
3497
|
for (var t2 = {}, n2 = 0, r2 = Object.entries(e7); n2 < r2.length; n2++) {
|
|
3486
|
-
var i2 =
|
|
3498
|
+
var i2 = to(r2[n2], 2), a2 = i2[0], o2 = i2[1];
|
|
3487
3499
|
t2[a2] = typeof o2 == `string` ? o2.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`) : o2;
|
|
3488
3500
|
}
|
|
3489
3501
|
return t2;
|
|
3490
3502
|
} }]), e6;
|
|
3491
3503
|
}();
|
|
3492
|
-
|
|
3493
|
-
function
|
|
3504
|
+
_o.type = `i18nFormat`;
|
|
3505
|
+
function vo({ icuOptions: e6 = {}, ...t2 }) {
|
|
3494
3506
|
let { parseErrorHandler: n2 = void 0 } = t2;
|
|
3495
|
-
return
|
|
3507
|
+
return ki(t2, { icu: new _o({ parseErrorHandler: n2, bindI18n: t2.bindI18n, ...e6 }) });
|
|
3496
3508
|
}
|
|
3497
|
-
var
|
|
3509
|
+
var yo = (e6, t2, n2, r2) => {
|
|
3498
3510
|
let i2 = [n2, { code: t2, ...r2 || {} }];
|
|
3499
3511
|
if (e6?.services?.logger?.forward) return e6.services.logger.forward(i2, `warn`, `react-i18next::`, true);
|
|
3500
3512
|
Q(i2[0]) && (i2[0] = `react-i18next:: ${i2[0]}`), e6?.services?.logger?.warn ? e6.services.logger.warn(...i2) : console?.warn && console.warn(...i2);
|
|
3501
3513
|
};
|
|
3502
|
-
var
|
|
3503
|
-
var
|
|
3504
|
-
Q(n2) &&
|
|
3514
|
+
var bo = {};
|
|
3515
|
+
var xo = (e6, t2, n2, r2) => {
|
|
3516
|
+
Q(n2) && bo[n2] || (Q(n2) && (bo[n2] = /* @__PURE__ */ new Date()), yo(e6, t2, n2, r2));
|
|
3505
3517
|
};
|
|
3506
|
-
var
|
|
3518
|
+
var So = (e6, t2) => () => {
|
|
3507
3519
|
if (e6.isInitialized) t2();
|
|
3508
3520
|
else {
|
|
3509
3521
|
let n2 = () => {
|
|
@@ -3514,29 +3526,29 @@ var xo = (e6, t2) => () => {
|
|
|
3514
3526
|
e6.on(`initialized`, n2);
|
|
3515
3527
|
}
|
|
3516
3528
|
};
|
|
3517
|
-
var
|
|
3518
|
-
e6.loadNamespaces(t2,
|
|
3529
|
+
var Co = (e6, t2, n2) => {
|
|
3530
|
+
e6.loadNamespaces(t2, So(e6, n2));
|
|
3519
3531
|
};
|
|
3520
|
-
var
|
|
3521
|
-
if (Q(n2) && (n2 = [n2]), e6.options.preload && e6.options.preload.indexOf(t2) > -1) return
|
|
3532
|
+
var wo = (e6, t2, n2, r2) => {
|
|
3533
|
+
if (Q(n2) && (n2 = [n2]), e6.options.preload && e6.options.preload.indexOf(t2) > -1) return Co(e6, n2, r2);
|
|
3522
3534
|
n2.forEach((t3) => {
|
|
3523
3535
|
e6.options.ns.indexOf(t3) < 0 && e6.options.ns.push(t3);
|
|
3524
|
-
}), e6.loadLanguages(t2,
|
|
3536
|
+
}), e6.loadLanguages(t2, So(e6, r2));
|
|
3525
3537
|
};
|
|
3526
|
-
var
|
|
3538
|
+
var To = (e6, t2, n2 = {}) => !t2.languages || !t2.languages.length ? (xo(t2, `NO_LANGUAGES`, `i18n.languages were undefined or empty`, { languages: t2.languages }), true) : t2.hasLoadedNamespace(e6, { lng: n2.lng, precheck: (t3, r2) => {
|
|
3527
3539
|
if (n2.bindI18n && n2.bindI18n.indexOf(`languageChanging`) > -1 && t3.services.backendConnector.backend && t3.isLanguageChangingTo && !r2(t3.isLanguageChangingTo, e6)) return false;
|
|
3528
3540
|
} });
|
|
3529
3541
|
var Q = (e6) => typeof e6 == `string`;
|
|
3530
|
-
var
|
|
3531
|
-
var
|
|
3532
|
-
var
|
|
3533
|
-
var
|
|
3534
|
-
var
|
|
3535
|
-
var
|
|
3536
|
-
var
|
|
3537
|
-
var
|
|
3538
|
-
var
|
|
3539
|
-
var
|
|
3542
|
+
var Eo = (e6) => typeof e6 == `object` && !!e6;
|
|
3543
|
+
var Do = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3544
|
+
var Oo = { "&": `&`, "&": `&`, "<": `<`, "<": `<`, ">": `>`, ">": `>`, "'": `'`, "'": `'`, """: `"`, """: `"`, " ": ` `, " ": ` `, "©": `\xA9`, "©": `\xA9`, "®": `\xAE`, "®": `\xAE`, "…": `\u2026`, "…": `\u2026`, "/": `/`, "/": `/` };
|
|
3545
|
+
var ko = (e6) => Oo[e6];
|
|
3546
|
+
var Ao = { bindI18n: `languageChanged`, bindI18nStore: ``, transEmptyNodeValue: ``, transSupportBasicHtmlNodes: true, transWrapTextNodes: ``, transKeepBasicHtmlNodesFor: [`br`, `strong`, `i`, `p`], useSuspense: true, unescape: (e6) => e6.replace(Do, ko) };
|
|
3547
|
+
var jo = () => Ao;
|
|
3548
|
+
var Mo;
|
|
3549
|
+
var No = () => Mo;
|
|
3550
|
+
var Po = (0, import_react.createContext)();
|
|
3551
|
+
var Fo = class {
|
|
3540
3552
|
constructor() {
|
|
3541
3553
|
this.usedNamespaces = {};
|
|
3542
3554
|
}
|
|
@@ -3549,134 +3561,138 @@ var Po = class {
|
|
|
3549
3561
|
return Object.keys(this.usedNamespaces);
|
|
3550
3562
|
}
|
|
3551
3563
|
};
|
|
3552
|
-
var
|
|
3564
|
+
var Io = (e6, t2) => {
|
|
3553
3565
|
let n2 = (0, import_react.useRef)();
|
|
3554
3566
|
return (0, import_react.useEffect)(() => {
|
|
3555
3567
|
n2.current = t2 ? n2.current : e6;
|
|
3556
3568
|
}, [e6, t2]), n2.current;
|
|
3557
3569
|
};
|
|
3558
|
-
var
|
|
3559
|
-
var
|
|
3560
|
-
var
|
|
3561
|
-
let { i18n: n2 } = t2, { i18n: r2, defaultNS:
|
|
3562
|
-
if (
|
|
3563
|
-
|
|
3564
|
-
let e7 = (e8, t4) => Q(t4) ? t4 :
|
|
3570
|
+
var Lo = (e6, t2, n2, r2) => e6.getFixedT(t2, n2, r2);
|
|
3571
|
+
var Ro = (e6, t2, n2, r2) => (0, import_react.useCallback)(Lo(e6, t2, n2, r2), [e6, t2, n2, r2]);
|
|
3572
|
+
var zo = (e6, t2 = {}) => {
|
|
3573
|
+
let { i18n: n2 } = t2, { i18n: r2, defaultNS: i2 } = (0, import_react.useContext)(Po) || {}, s2 = n2 || r2 || No();
|
|
3574
|
+
if (s2 && !s2.reportNamespaces && (s2.reportNamespaces = new Fo()), !s2) {
|
|
3575
|
+
xo(s2, `NO_I18NEXT_INSTANCE`, `useTranslation: You will need to pass in an i18next instance by using initReactI18next`);
|
|
3576
|
+
let e7 = (e8, t4) => Q(t4) ? t4 : Eo(t4) && Q(t4.defaultValue) ? t4.defaultValue : Array.isArray(e8) ? e8[e8.length - 1] : e8, t3 = [e7, {}, false];
|
|
3565
3577
|
return t3.t = e7, t3.i18n = {}, t3.ready = false, t3;
|
|
3566
3578
|
}
|
|
3567
|
-
|
|
3568
|
-
let u2 = { ...
|
|
3569
|
-
p2 = Q(p2) ? [p2] : p2 || [`translation`],
|
|
3570
|
-
let m2 = (
|
|
3579
|
+
s2.options.react?.wait && xo(s2, `DEPRECATED_OPTION`, `useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.`);
|
|
3580
|
+
let u2 = { ...jo(), ...s2.options.react, ...t2 }, { useSuspense: d2, keyPrefix: f2 } = u2, p2 = e6 || i2 || s2.options?.defaultNS;
|
|
3581
|
+
p2 = Q(p2) ? [p2] : p2 || [`translation`], s2.reportNamespaces.addUsedNamespaces?.(p2);
|
|
3582
|
+
let m2 = (s2.isInitialized || s2.initializedStoreOnce) && p2.every((e7) => To(e7, s2, u2)), h2 = Ro(s2, t2.lng || null, u2.nsMode === `fallback` ? p2 : p2[0], f2), g2 = () => h2, _2 = () => Lo(s2, t2.lng || null, u2.nsMode === `fallback` ? p2 : p2[0], f2), [v2, y2] = (0, import_react.useState)(g2), b2 = p2.join();
|
|
3571
3583
|
t2.lng && (b2 = `${t2.lng}${b2}`);
|
|
3572
|
-
let x2 =
|
|
3584
|
+
let x2 = Io(b2), S2 = (0, import_react.useRef)(true);
|
|
3573
3585
|
(0, import_react.useEffect)(() => {
|
|
3574
3586
|
let { bindI18n: e7, bindI18nStore: n3 } = u2;
|
|
3575
|
-
S2.current = true, !m2 && !d2 && (t2.lng ?
|
|
3587
|
+
S2.current = true, !m2 && !d2 && (t2.lng ? wo(s2, t2.lng, p2, () => {
|
|
3576
3588
|
S2.current && y2(_2);
|
|
3577
|
-
}) :
|
|
3589
|
+
}) : Co(s2, p2, () => {
|
|
3578
3590
|
S2.current && y2(_2);
|
|
3579
3591
|
})), m2 && x2 && x2 !== b2 && S2.current && y2(_2);
|
|
3580
3592
|
let r3 = () => {
|
|
3581
3593
|
S2.current && y2(_2);
|
|
3582
3594
|
};
|
|
3583
|
-
return e7 &&
|
|
3584
|
-
S2.current = false,
|
|
3595
|
+
return e7 && s2?.on(e7, r3), n3 && s2?.store.on(n3, r3), () => {
|
|
3596
|
+
S2.current = false, s2 && e7 && e7?.split(` `).forEach((e8) => s2.off(e8, r3)), n3 && s2 && n3.split(` `).forEach((e8) => s2.store.off(e8, r3));
|
|
3585
3597
|
};
|
|
3586
|
-
}, [
|
|
3598
|
+
}, [s2, b2]), (0, import_react.useEffect)(() => {
|
|
3587
3599
|
S2.current && m2 && y2(g2);
|
|
3588
|
-
}, [
|
|
3589
|
-
let C2 = [v2,
|
|
3590
|
-
if (C2.t = v2, C2.i18n =
|
|
3600
|
+
}, [s2, f2, m2]);
|
|
3601
|
+
let C2 = [v2, s2, m2];
|
|
3602
|
+
if (C2.t = v2, C2.i18n = s2, C2.ready = m2, m2 || !m2 && !d2) return C2;
|
|
3591
3603
|
throw new Promise((e7) => {
|
|
3592
|
-
t2.lng ?
|
|
3604
|
+
t2.lng ? wo(s2, t2.lng, p2, () => e7()) : Co(s2, p2, () => e7());
|
|
3593
3605
|
});
|
|
3594
3606
|
};
|
|
3595
|
-
function
|
|
3596
|
-
let i2 = (0, import_react.useMemo)(() => ({ i18n: e6, defaultNS:
|
|
3597
|
-
return (0, import_react.createElement)(
|
|
3607
|
+
function Bo({ i18n: e6, defaultNS: t2, children: r2 }) {
|
|
3608
|
+
let i2 = (0, import_react.useMemo)(() => ({ i18n: e6, defaultNS: t2 }), [e6, t2]);
|
|
3609
|
+
return (0, import_react.createElement)(Po.Provider, { value: i2 }, r2);
|
|
3598
3610
|
}
|
|
3599
|
-
var
|
|
3600
|
-
var
|
|
3611
|
+
var Vo = I(`@wix/site-service-renderer-configuration`);
|
|
3612
|
+
var Ho = () => {
|
|
3601
3613
|
let e6, t2;
|
|
3602
3614
|
try {
|
|
3603
|
-
e6 = (0, import_services_manager_react.useService)(
|
|
3615
|
+
e6 = (0, import_services_manager_react.useService)(Vo).languageCode;
|
|
3604
3616
|
} catch {
|
|
3605
3617
|
}
|
|
3606
3618
|
try {
|
|
3607
|
-
t2 = (0, import_services_manager_react.useService)(
|
|
3619
|
+
t2 = (0, import_services_manager_react.useService)(Rr).language;
|
|
3608
3620
|
} catch {
|
|
3609
3621
|
}
|
|
3610
3622
|
return e6 || t2;
|
|
3611
3623
|
};
|
|
3612
|
-
var
|
|
3613
|
-
var
|
|
3614
|
-
function
|
|
3624
|
+
var Uo = `wix-warmup-data`;
|
|
3625
|
+
var Wo = null;
|
|
3626
|
+
function Go(e6) {
|
|
3615
3627
|
if (typeof document < `u`) try {
|
|
3616
|
-
let t2 = document.getElementById(
|
|
3617
|
-
return t2 ? (
|
|
3628
|
+
let t2 = document.getElementById(Uo)?.textContent;
|
|
3629
|
+
return t2 ? (Wo?.text !== t2 && (Wo = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Wo.data[e6] ?? void 0) : void 0;
|
|
3618
3630
|
} catch {
|
|
3619
3631
|
return;
|
|
3620
3632
|
}
|
|
3621
3633
|
}
|
|
3622
|
-
var
|
|
3623
|
-
var
|
|
3624
|
-
var
|
|
3625
|
-
function
|
|
3626
|
-
let n2 =
|
|
3634
|
+
var Ko = `blog-builder:i18n`;
|
|
3635
|
+
var qo = () => Go(Ko);
|
|
3636
|
+
var Jo = /* @__PURE__ */ new Map();
|
|
3637
|
+
function Yo(e6, t2) {
|
|
3638
|
+
let n2 = Jo.get(e6);
|
|
3627
3639
|
if (n2) return n2;
|
|
3628
|
-
let r2 =
|
|
3629
|
-
return
|
|
3640
|
+
let r2 = qo(), i2 = r2?.locale === e6 ? r2.messages : void 0, a2 = vo({ locale: e6, useSuspense: true, ...i2 ? { messages: i2 } : { asyncMessagesLoader: t2 } });
|
|
3641
|
+
return Jo.set(e6, a2), a2;
|
|
3630
3642
|
}
|
|
3631
|
-
var
|
|
3643
|
+
var Xo = (e6, t2, n2) => {
|
|
3632
3644
|
let r2 = t2.lastIndexOf(`?`), i2 = e6[r2 === -1 || r2 < t2.lastIndexOf(`/`) ? t2 : t2.slice(0, r2)];
|
|
3633
3645
|
return i2 ? typeof i2 == `function` ? i2() : Promise.resolve(i2) : new Promise((e7, r3) => {
|
|
3634
3646
|
(typeof queueMicrotask == `function` ? queueMicrotask : setTimeout)(r3.bind(null, Error(`Unknown variable dynamic import: ` + t2 + (t2.split(`/`).length === n2 ? `` : `. Note that variables only represent file names one level deep.`))));
|
|
3635
3647
|
});
|
|
3636
3648
|
};
|
|
3637
|
-
var
|
|
3638
|
-
|
|
3639
|
-
function
|
|
3640
|
-
let t2 =
|
|
3641
|
-
return { i18n:
|
|
3642
|
-
}
|
|
3643
|
-
var
|
|
3644
|
-
var
|
|
3645
|
-
var
|
|
3646
|
-
var
|
|
3647
|
-
var
|
|
3648
|
-
var
|
|
3649
|
-
var
|
|
3650
|
-
let n2 =
|
|
3649
|
+
var Zo = (e6) => e6.split(`-`)[0] ?? e6;
|
|
3650
|
+
Hr({ isDev: false, loadMessages: (e6) => Xo(Object.assign({ "../assets/locale/messages_en.dev.json": () => pn(() => Promise.resolve().then(() => $o), void 0, import_meta.url), "../assets/locale/messages_en.json": () => pn(() => Promise.resolve().then(() => ts), void 0, import_meta.url) }), `../assets/locale/messages_${Zo(e6)}.json`, 4), loadDevMessages: (e6) => Xo(Object.assign({ "../assets/locale/messages_en.dev.json": () => pn(() => Promise.resolve().then(() => $o), void 0, import_meta.url) }), `../assets/locale/messages_${Zo(e6)}.dev.json`, 4) });
|
|
3651
|
+
function Qo(e6) {
|
|
3652
|
+
let t2 = Ho(), n2 = qo()?.locale ?? t2 ?? `en`;
|
|
3653
|
+
return { i18n: Yo(n2, e6), locale: n2 };
|
|
3654
|
+
}
|
|
3655
|
+
var $o = m({ default: () => es });
|
|
3656
|
+
var es = { "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` };
|
|
3657
|
+
var ts = m({ default: () => rs, title: () => ns });
|
|
3658
|
+
var ns = `My App`;
|
|
3659
|
+
var rs = { "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: ns, "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.` };
|
|
3660
|
+
var is = Object.assign({ "../assets/locale/messages_en.dev.json": $o, "../assets/locale/messages_en.json": ts });
|
|
3661
|
+
var as = (e6, t2) => {
|
|
3662
|
+
let n2 = is[`../assets/locale/messages_${Zo(e6)}${t2}.json`];
|
|
3651
3663
|
return n2 ? Promise.resolve(n2) : Promise.reject(Error(`no messages file`));
|
|
3652
3664
|
};
|
|
3653
|
-
var
|
|
3654
|
-
var
|
|
3665
|
+
var os = Hr({ isDev: false, loadMessages: (e6) => as(e6, ``), loadDevMessages: (e6) => as(e6, `.dev`) });
|
|
3666
|
+
var ss = (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);
|
|
3655
3667
|
var $ = { 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` };
|
|
3656
|
-
var
|
|
3657
|
-
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted:
|
|
3668
|
+
var cs = (e6, t2) => {
|
|
3669
|
+
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: ss(r2, `full`, t2) });
|
|
3658
3670
|
return { timeToRead: (t3) => e6($.timeToRead, { count: t3 }), viewCount: n2($.viewCount), commentCount: n2($.commentCount), likeCount: n2($.likeCount), noPostsEmptyState: () => ({ title: e6($.noPostsTitle), description: e6($.noPostsDescription) }), noRelatedPostsEmptyState: () => ({ title: e6($.noRelatedPostsTitle), description: e6($.noRelatedPostsDescription) }), canvas: { postTitle: () => e6($.canvasPostTitle), authorName: () => e6($.canvasAuthorName), excerpt: () => e6($.canvasExcerpt), content: () => e6($.canvasContent), category: () => e6($.canvasCategory), categoryNumbered: (t3) => e6($.canvasCategoryNumbered, { number: t3 }), tagNumbered: (t3) => e6($.canvasTagNumbered, { number: t3 }), coverAlt: () => e6($.canvasCoverAlt), authorPhotoAlt: () => e6($.canvasAuthorPhotoAlt) } };
|
|
3659
3671
|
};
|
|
3660
|
-
var
|
|
3661
|
-
var
|
|
3662
|
-
var
|
|
3663
|
-
|
|
3664
|
-
function
|
|
3665
|
-
return (0, import_react.useContext)(
|
|
3666
|
-
}
|
|
3667
|
-
function
|
|
3668
|
-
let
|
|
3669
|
-
|
|
3670
|
-
}
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
}
|
|
3675
|
-
|
|
3672
|
+
var ls = (e6) => e6.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`);
|
|
3673
|
+
var us = (e6) => ({ text: e6, html: `<p>${ls(e6)}</p>`, linkList: [] });
|
|
3674
|
+
var ds = (0, import_react.createContext)(null);
|
|
3675
|
+
ds.displayName = `PostItemContext`;
|
|
3676
|
+
function fs() {
|
|
3677
|
+
return (0, import_react.useContext)(ds);
|
|
3678
|
+
}
|
|
3679
|
+
function ps({ postData: t2, children: n2 }) {
|
|
3680
|
+
let r2 = zr(), { t: i2, ready: a2 } = zo(void 0, { useSuspense: false }), o2 = (0, import_react.useMemo)(() => cs(i2, r2), [i2, r2]), { isLiked: c2, likeCount: l2, isLikeCountLoaded: u2, viewCount: d2, commentCount: p2, toggleLike: m2, liveLikes: h2 } = Lr(t2.recentPostItem.slug ? t2._id : void 0, 0), g2 = (0, import_react.useMemo)(() => ({ ...t2, isLiked: c2, isLikeCountLoaded: u2, toggleLike: m2, liveLikes: h2, likeCountValue: l2, viewCountValue: d2 ?? t2.initialViewCount, commentCountValue: p2 ?? t2.initialCommentCount, likeCount: us(a2 ? o2.likeCount(l2) : ``), viewCount: d2 === void 0 || !a2 ? t2.viewCount : us(o2.viewCount(d2)), commentCount: p2 === void 0 || !a2 ? t2.commentCount : us(o2.commentCount(p2)) }), [t2, c2, l2, u2, d2, p2, m2, h2, o2, a2]), _2 = (0, import_react.useMemo)(() => ({ currentPostId: t2.recentPostItem.slug ? t2._id : void 0, categoryIds: void 0, relatedPostIds: void 0 }), [t2]), v2 = (0, import_react.useMemo)(() => {
|
|
3681
|
+
let e6 = g2.itemCategoryLabel.text;
|
|
3682
|
+
return { title: g2.itemTitle, excerpt: g2.itemExcerpt, coverImage: g2.itemCoverImage, coverMedia: g2.itemCoverMedia, richContent: { nodes: [] }, authorName: g2.authorName, authorImage: g2.authorImage, timeToRead: g2.timeToRead, publishedDate: g2.itemPublishedDate, viewCount: g2.viewCount, commentCount: g2.commentCount, likeCount: g2.likeCount, postCategories: e6 ? [{ _id: e6, label: e6, itemCategoryLabel: g2.itemCategoryLabel, itemCategoryLink: void 0, categoryItem: { label: e6, slug: `` } }] : [], itemCategoryLabel: g2.itemCategoryLabel, postTags: [], hasCoverImage: g2.itemCoverMedia !== void 0 && g2.itemCoverImage !== void 0, hasExcerpt: !!g2.itemExcerpt.text.trim(), hasTags: false, publishedDateValue: g2.publishedDateValue, minutesToReadValue: g2.minutesToReadValue, viewCountValue: g2.viewCountValue, commentCountValue: g2.commentCountValue, isLiked: g2.isLiked, likeCountValue: g2.likeCountValue, isLikeCountLoaded: g2.isLikeCountLoaded, toggleLike: g2.toggleLike, liveLikes: g2.liveLikes, clockValue: g2.clockValue, postUrl: g2.itemLink?.href, itemLink: g2.itemLink, commentingEnabled: g2.commentingEnabled, relatedPostsSource: _2, isLoadingPost: false, hasError: false, isEmpty: false };
|
|
3683
|
+
}, [g2, _2]);
|
|
3684
|
+
return (0, import_jsx_runtime.jsx)(ds.Provider, { value: g2, children: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: v2, children: n2 }) });
|
|
3685
|
+
}
|
|
3686
|
+
function ms({ postData: e6, children: t2 }) {
|
|
3687
|
+
let { i18n: n2 } = Qo(os);
|
|
3688
|
+
return e6 === void 0 ? (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: t2 }) : (0, import_jsx_runtime.jsx)(Bo, { i18n: n2, children: (0, import_jsx_runtime.jsx)(ps, { postData: e6, children: t2 }) });
|
|
3689
|
+
}
|
|
3690
|
+
var hs = Dn(`bd5dc6d6-7a0d-48d5-99da-457340ce6f2d`);
|
|
3676
3691
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3677
3692
|
0 && (module.exports = {
|
|
3678
3693
|
PostItemContextProvider,
|
|
3679
3694
|
injectAccessTokenGetter,
|
|
3680
|
-
usePostItemContext
|
|
3695
|
+
usePostItemContext,
|
|
3696
|
+
usePostListItemContext
|
|
3681
3697
|
});
|
|
3682
3698
|
//# sourceMappingURL=context-post-item.js.map
|