@wix/blog 1.0.702 → 1.0.703
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 +2 -3
- package/_sdk-exports/context-post-item/runtime.js +4 -4
- 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 +2 -3
- package/build/cjs/context-post-item.js +801 -787
- package/build/cjs/context-post-item.js.map +1 -1
- 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 +2 -3
- package/build/es/context-post-item.mjs +802 -798
- package/build/es/context-post-item.mjs.map +1 -1
- 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 +2 -3
- 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 +2 -3
- package/build/internal/es/context-post.d.mts +195 -115
- package/context/post-by-slug/package.json +3 -0
- package/package.json +14 -2
- package/post-by-slug-context-provider/package.json +3 -0
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
// _sdk-exports/context-post-item/runtime.js
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
var p =
|
|
2
|
+
import e from "@wix/blog/post-context-provider";
|
|
3
|
+
import { createContext as t, createElement as n, startTransition as r, useCallback as i, useContext as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
4
|
+
import { useService as u } from "@wix/services-manager-react";
|
|
5
|
+
import { Fragment as d, jsx as f } from "react/jsx-runtime";
|
|
6
|
+
var p = Object.defineProperty;
|
|
7
|
+
var m = (e6, t2) => {
|
|
7
8
|
let n2 = {};
|
|
8
|
-
for (var r2 in e6)
|
|
9
|
-
return t2 ||
|
|
9
|
+
for (var r2 in e6) p(n2, r2, { get: e6[r2], enumerable: true });
|
|
10
|
+
return t2 || p(n2, Symbol.toStringTag, { value: `Module` }), n2;
|
|
10
11
|
};
|
|
11
|
-
var
|
|
12
|
-
function
|
|
12
|
+
var h = {};
|
|
13
|
+
function g(e6, t2 = false, n2 = (e7) => e7) {
|
|
13
14
|
return () => ({ __type: `event-definition`, type: e6, isDomainEvent: t2, transformations: n2 });
|
|
14
15
|
}
|
|
15
|
-
var
|
|
16
|
+
var _ = (e6) => {
|
|
16
17
|
switch (e6) {
|
|
17
18
|
case `get`:
|
|
18
19
|
case `GET`:
|
|
@@ -39,11 +40,11 @@ var g = (e6) => {
|
|
|
39
40
|
throw Error(`Unknown method: ${e6}`);
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
|
-
var
|
|
43
|
+
var v = (e6) => (t2) => async (n2) => {
|
|
43
44
|
let r2, i2 = (t3) => {
|
|
44
45
|
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.`);
|
|
45
46
|
let { method: i3, url: a2, params: o2 } = r2;
|
|
46
|
-
return { ...r2, method:
|
|
47
|
+
return { ...r2, method: _(i3), url: a2, data: r2.data, params: o2 };
|
|
47
48
|
};
|
|
48
49
|
try {
|
|
49
50
|
let e7 = await t2.request(i2);
|
|
@@ -56,10 +57,10 @@ var _ = (e6) => (t2) => async (n2) => {
|
|
|
56
57
|
throw typeof e7 == `object` && e7 && `response` in e7 && typeof e7.response == `object` && e7.response !== null && `data` in e7.response ? e7.response.data : e7;
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
60
|
+
var y = (e6) => e6.__isAmbassador ? true : !!e6().__isAmbassador;
|
|
61
|
+
var b = `__metadata`;
|
|
62
|
+
var x = `edge.wixapis.com`;
|
|
63
|
+
var S = class extends Error {
|
|
63
64
|
message;
|
|
64
65
|
response;
|
|
65
66
|
constructor(e6, t2) {
|
|
@@ -67,108 +68,108 @@ var x = class extends Error {
|
|
|
67
68
|
}
|
|
68
69
|
async details() {
|
|
69
70
|
let e6 = await this.response.json();
|
|
70
|
-
return
|
|
71
|
+
return C(this.response.status, e6?.message, e6?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e6 });
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
var
|
|
77
|
-
function
|
|
74
|
+
var C = (e6, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e6, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
75
|
+
var ee = (e6) => e6?.method && [`post`, `put`, `patch`].includes(e6.method.toLocaleLowerCase()) && e6.body ? { "Content-Type": `application/json` } : {};
|
|
76
|
+
var w = (e6) => e6 && typeof e6 == `object` && !Array.isArray(e6);
|
|
77
|
+
var T = (e6) => e6.__type === `host`;
|
|
78
|
+
function te(e6, t2) {
|
|
78
79
|
return e6.create(t2);
|
|
79
80
|
}
|
|
80
|
-
var
|
|
81
|
-
function
|
|
82
|
-
return { [
|
|
81
|
+
var ne = `x-wix-bi-gateway`;
|
|
82
|
+
function re(e6, t2, n2) {
|
|
83
|
+
return { [ne]: ie({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e6.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e6.methodFqn, entity: e6.entityFqdn }) };
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
+
function ie(e6) {
|
|
85
86
|
return Object.entries(e6).filter(([e7, t2]) => !!t2).map(([e7, t2]) => `${e7}=${t2}`).join(`,`);
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
89
|
-
globalThis.__wix_context__ = void 0,
|
|
88
|
+
function ae(e6) {
|
|
89
|
+
let t2 = globalThis.__wix_context__, n2 = { client: h.client, elevatedClient: h.elevatedClient }, r2;
|
|
90
|
+
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);
|
|
90
91
|
try {
|
|
91
92
|
return e6();
|
|
92
93
|
} finally {
|
|
93
|
-
globalThis.__wix_context__ = t2,
|
|
94
|
+
globalThis.__wix_context__ = t2, h.client = n2.client, h.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
|
-
var
|
|
97
|
-
function
|
|
98
|
-
return
|
|
97
|
+
var oe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
98
|
+
function se(e6) {
|
|
99
|
+
return fe(e6).map((e7) => e7.toLocaleUpperCase()).join(`_`);
|
|
99
100
|
}
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
var
|
|
104
|
-
function
|
|
101
|
+
var ce = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
102
|
+
var le = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
103
|
+
var ue = `$1\0$2`;
|
|
104
|
+
var de = /[^\p{L}\d]+/giu;
|
|
105
|
+
function fe(e6) {
|
|
105
106
|
let t2 = e6.trim();
|
|
106
|
-
t2 = t2.replace(
|
|
107
|
+
t2 = t2.replace(ce, ue).replace(le, ue), t2 = t2.replace(de, `\0`);
|
|
107
108
|
let n2 = 0, r2 = t2.length;
|
|
108
109
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
109
110
|
if (n2 === r2) return [];
|
|
110
111
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
111
112
|
return t2.slice(n2, r2).split(/\0/g);
|
|
112
113
|
}
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
function
|
|
114
|
+
var pe = (e6) => `validationError` in (e6.response?.data?.details ?? {});
|
|
115
|
+
var me = (e6) => `applicationError` in (e6.response?.data?.details ?? {});
|
|
116
|
+
var he = (e6) => (e6.response?.status ?? -1) >= 400 && (e6.response?.status ?? -1) < 500;
|
|
117
|
+
function ge(e6, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
117
118
|
if (typeof e6 != `object` || !e6) throw e6;
|
|
118
|
-
if (
|
|
119
|
-
if (
|
|
120
|
-
if (
|
|
121
|
-
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
122
|
-
return
|
|
119
|
+
if (pe(e6)) return _e(e6, t2, n2);
|
|
120
|
+
if (me(e6)) return ye(e6);
|
|
121
|
+
if (he(e6)) {
|
|
122
|
+
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 };
|
|
123
|
+
return ve(e6, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
123
124
|
}
|
|
124
|
-
return
|
|
125
|
+
return be(e6);
|
|
125
126
|
}
|
|
126
|
-
var
|
|
127
|
-
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
128
|
-
return
|
|
127
|
+
var _e = (e6, t2, n2) => {
|
|
128
|
+
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 };
|
|
129
|
+
return ve(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e6.response?.status, requestId: i2 } });
|
|
129
130
|
};
|
|
130
|
-
var
|
|
131
|
-
var
|
|
132
|
-
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 ??
|
|
133
|
-
return
|
|
131
|
+
var ve = (e6, { message: t2, extraProperties: n2 }) => Object.assign(e6, { ...n2, message: t2 });
|
|
132
|
+
var ye = (e6) => {
|
|
133
|
+
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 };
|
|
134
|
+
return ve(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e6.requestId } });
|
|
134
135
|
};
|
|
135
|
-
var
|
|
136
|
-
var
|
|
136
|
+
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 } } });
|
|
137
|
+
var xe = ({ spreadPathsToArguments: e6, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
137
138
|
let a2 = { ...e6, ...t2 }, o2 = Object.keys(a2);
|
|
138
139
|
return r2?.filter((e7) => !r2.some((t3) => t3.field.length > e7.field.length && t3.field.startsWith(e7.field) && o2.includes(t3.field))).map((e7) => {
|
|
139
140
|
let r3 = t2[e7.field];
|
|
140
|
-
if (r3) return { ...e7, field:
|
|
141
|
+
if (r3) return { ...e7, field: Se(r3, i2) };
|
|
141
142
|
let s2 = o2?.sort((e8, t3) => t3.length - e8.length)?.find((t3) => e7.field.startsWith(t3));
|
|
142
143
|
if (s2) {
|
|
143
144
|
let t3 = a2[s2];
|
|
144
|
-
if (t3) return { ...e7, field: e7.field.replace(s2,
|
|
145
|
+
if (t3) return { ...e7, field: e7.field.replace(s2, Se(t3, i2)) };
|
|
145
146
|
}
|
|
146
147
|
return n2 ? { ...e7, field: `${i2[0]}.${e7.field}` } : e7;
|
|
147
148
|
});
|
|
148
149
|
};
|
|
149
|
-
var
|
|
150
|
-
let n2 =
|
|
150
|
+
var Se = (e6, t2) => {
|
|
151
|
+
let n2 = Ce(e6);
|
|
151
152
|
return n2 == null ? e6 : e6.replace(`$[${n2}]`, t2[n2]);
|
|
152
153
|
};
|
|
153
|
-
var
|
|
154
|
+
var Ce = (e6) => {
|
|
154
155
|
let t2 = e6.match(/\$\[(?<argIndex>\d+)\]/);
|
|
155
156
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
156
157
|
};
|
|
157
|
-
function
|
|
158
|
-
return
|
|
158
|
+
function we(e6, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
159
|
+
return ae(() => e6({ request: async (e7) => {
|
|
159
160
|
let i3 = e7({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
160
161
|
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
161
|
-
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ?
|
|
162
|
+
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? x : o3}${a3.url}`;
|
|
162
163
|
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
163
164
|
try {
|
|
164
|
-
let e8 =
|
|
165
|
+
let e8 = re(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e8 } }, s3 = await n2(u3, o4);
|
|
165
166
|
if (s3.status !== 200) {
|
|
166
167
|
let e9 = null;
|
|
167
168
|
try {
|
|
168
169
|
e9 = await s3.json();
|
|
169
170
|
} catch {
|
|
170
171
|
}
|
|
171
|
-
let t3 =
|
|
172
|
+
let t3 = Ee(s3.status, e9?.message ?? s3.statusText, e9?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e9 }), n3 = ge(t3);
|
|
172
173
|
throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
|
|
173
174
|
}
|
|
174
175
|
let l3 = await s3.json();
|
|
@@ -178,18 +179,18 @@ function Ce(e6, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
178
179
|
}
|
|
179
180
|
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
180
181
|
}
|
|
181
|
-
var
|
|
182
|
+
var Te = class extends Error {
|
|
182
183
|
response;
|
|
183
184
|
requestId;
|
|
184
185
|
constructor(e6) {
|
|
185
186
|
super(), this.response = e6.response, this.requestId = e6.requestId;
|
|
186
187
|
}
|
|
187
188
|
};
|
|
188
|
-
var
|
|
189
|
-
var
|
|
190
|
-
function
|
|
189
|
+
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 });
|
|
190
|
+
var De = `.`;
|
|
191
|
+
function Oe(e6, t2, n2) {
|
|
191
192
|
if (e6 == null) throw Error(`Cannot set value on null or undefined`);
|
|
192
|
-
let r2 =
|
|
193
|
+
let r2 = ke(t2), i2 = e6;
|
|
193
194
|
for (let e7 = 0; e7 < r2.length; e7++) {
|
|
194
195
|
let t3 = r2[e7];
|
|
195
196
|
if (e7 === r2.length - 1) {
|
|
@@ -201,21 +202,21 @@ function De(e6, t2, n2) {
|
|
|
201
202
|
}
|
|
202
203
|
return e6;
|
|
203
204
|
}
|
|
204
|
-
function Oe(e6) {
|
|
205
|
-
return Array.isArray(e6) ? e6 : e6.split(Ee).map((e7) => ke(e7) ? Number(e7) : e7);
|
|
206
|
-
}
|
|
207
205
|
function ke(e6) {
|
|
208
|
-
return
|
|
206
|
+
return Array.isArray(e6) ? e6 : e6.split(De).map((e7) => Ae(e7) ? Number(e7) : e7);
|
|
209
207
|
}
|
|
210
208
|
function Ae(e6) {
|
|
209
|
+
return /^\d+$/.test(e6);
|
|
210
|
+
}
|
|
211
|
+
function je(e6) {
|
|
211
212
|
let t2 = {};
|
|
212
|
-
for (let [n2, r2] of Object.entries(e6))
|
|
213
|
+
for (let [n2, r2] of Object.entries(e6)) Me(n2) || Oe(t2, ke(n2), r2);
|
|
213
214
|
return t2;
|
|
214
215
|
}
|
|
215
|
-
function
|
|
216
|
+
function Me(e6) {
|
|
216
217
|
return e6 === `__proto__` || e6 === `constructor` || e6 === `prototype`;
|
|
217
218
|
}
|
|
218
|
-
var
|
|
219
|
+
var Ne = class {
|
|
219
220
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
220
221
|
NUMERIC_PATTERN = /^\d+$/;
|
|
221
222
|
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
@@ -238,7 +239,7 @@ var Me = class {
|
|
|
238
239
|
return e6.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
239
240
|
}
|
|
240
241
|
unflatten() {
|
|
241
|
-
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e6, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e6)), t2])),
|
|
242
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e6, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e6)), t2])), je(this.cleanedModifiedFields);
|
|
242
243
|
}
|
|
243
244
|
flatten(e6) {
|
|
244
245
|
let t2 = {};
|
|
@@ -258,12 +259,12 @@ var Me = class {
|
|
|
258
259
|
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
259
260
|
r2.push(`[${e7}]`), n2 = n2[parseInt(e7, 10)];
|
|
260
261
|
}, a2 = (e7, t3) => {
|
|
261
|
-
let i3 = e7 in
|
|
262
|
+
let i3 = e7 in oe ? oe[e7] : void 0;
|
|
262
263
|
if (i3 && i3 in t3) {
|
|
263
264
|
r2.push(i3), n2 = t3[i3];
|
|
264
265
|
return;
|
|
265
266
|
}
|
|
266
|
-
let a3 =
|
|
267
|
+
let a3 = Le(e7);
|
|
267
268
|
if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
|
|
268
269
|
else throw Error(`Cannot find key '${e7}' or its transformations at path ${this.buildPathString(r2)}`);
|
|
269
270
|
}, o2 = (e7, t3) => {
|
|
@@ -287,28 +288,28 @@ var Me = class {
|
|
|
287
288
|
return e6.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e6[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
288
289
|
}
|
|
289
290
|
};
|
|
290
|
-
function
|
|
291
|
+
function Pe(e6, t2) {
|
|
291
292
|
let n2 = e6?.modifiedFields;
|
|
292
293
|
if (!n2) return null;
|
|
293
|
-
let r2 =
|
|
294
|
+
let r2 = Fe(n2);
|
|
294
295
|
if (!r2) return null;
|
|
295
296
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
296
297
|
e6 = { ...e6, modifiedFields: i2 };
|
|
297
298
|
let o2 = t2(e6), s2 = o2?.modifiedFields;
|
|
298
299
|
if (!s2) return null;
|
|
299
|
-
let c2 =
|
|
300
|
+
let c2 = Ie(s2, a2);
|
|
300
301
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
301
302
|
}
|
|
302
|
-
function
|
|
303
|
+
function Fe(e6) {
|
|
303
304
|
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) try {
|
|
304
|
-
let t2 = new
|
|
305
|
+
let t2 = new Ne(e6);
|
|
305
306
|
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
306
307
|
} catch {
|
|
307
308
|
return null;
|
|
308
309
|
}
|
|
309
310
|
return null;
|
|
310
311
|
}
|
|
311
|
-
function
|
|
312
|
+
function Ie(e6, t2) {
|
|
312
313
|
if (typeof e6 == `object` && e6 && !Array.isArray(e6)) try {
|
|
313
314
|
return t2.flatten(e6);
|
|
314
315
|
} catch {
|
|
@@ -316,10 +317,10 @@ function Fe(e6, t2) {
|
|
|
316
317
|
}
|
|
317
318
|
return null;
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
+
function Le(e6) {
|
|
320
321
|
return e6.replace(/[-_\s]+(.)?/g, (e7, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e7) => e7.toLowerCase());
|
|
321
322
|
}
|
|
322
|
-
function
|
|
323
|
+
function Re() {
|
|
323
324
|
return { emit(e6, ...t2) {
|
|
324
325
|
for (let n2 = 0, r2 = this.events[e6] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
325
326
|
}, events: {}, on(e6, t2) {
|
|
@@ -328,8 +329,8 @@ function Le() {
|
|
|
328
329
|
};
|
|
329
330
|
} };
|
|
330
331
|
}
|
|
331
|
-
var
|
|
332
|
-
function
|
|
332
|
+
var ze = (e6) => e6.__type === `event-definition`;
|
|
333
|
+
function Be(e6, t2, n2, r2) {
|
|
333
334
|
let i2;
|
|
334
335
|
if (e6.isDomainEvent) {
|
|
335
336
|
let { deletedEvent: e7, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
@@ -340,14 +341,14 @@ function ze(e6, t2, n2, r2) {
|
|
|
340
341
|
let e7 = s2.modifiedFields;
|
|
341
342
|
if (typeof e7 == `object` && e7 && !Array.isArray(e7)) {
|
|
342
343
|
o2 = structuredClone(i2);
|
|
343
|
-
let e8 =
|
|
344
|
+
let e8 = Pe(s2, a2);
|
|
344
345
|
if (e8) return t2(e8);
|
|
345
346
|
}
|
|
346
347
|
}
|
|
347
348
|
return t2(a2(o2));
|
|
348
349
|
}
|
|
349
|
-
function
|
|
350
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
350
|
+
function Ve(e6) {
|
|
351
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Re();
|
|
351
352
|
return { initModule(e7) {
|
|
352
353
|
return (r2) => {
|
|
353
354
|
let i2 = t2.get(e7.type) ?? [];
|
|
@@ -357,7 +358,7 @@ function Be(e6) {
|
|
|
357
358
|
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 }))];
|
|
358
359
|
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(`, `)}`);
|
|
359
360
|
let l2 = t2.get(r2) ?? [];
|
|
360
|
-
return await Promise.all(l2.map(({ eventDefinition: e8, handler: t3 }) =>
|
|
361
|
+
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 };
|
|
361
362
|
}, async processRequest(e7, t3) {
|
|
362
363
|
let n3 = await e7.text();
|
|
363
364
|
return this.process(n3, t3);
|
|
@@ -376,12 +377,12 @@ function Be(e6) {
|
|
|
376
377
|
let n3 = Array.from(t2.keys()).map((e8) => ({ type: e8 }));
|
|
377
378
|
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(`, `)}`);
|
|
378
379
|
let r2 = t2.get(e7.eventType) ?? [];
|
|
379
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) =>
|
|
380
|
-
}, apps: { AppInstalled:
|
|
380
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Be(t3, n4, e7.payload, { instanceId: e7.instanceId, identity: e7.identity })));
|
|
381
|
+
}, apps: { AppInstalled: g(`AppInstalled`)(), AppRemoved: g(`AppRemoved`)() } } };
|
|
381
382
|
}
|
|
382
|
-
var
|
|
383
|
-
function
|
|
384
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
383
|
+
var He = (e6) => e6.__type === `service-plugin-definition`;
|
|
384
|
+
function Ue(e6) {
|
|
385
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Re();
|
|
385
386
|
return { initModule(e7) {
|
|
386
387
|
return (r2) => {
|
|
387
388
|
let i2 = t2.get(e7.componentType.toLowerCase()) ?? [];
|
|
@@ -423,76 +424,76 @@ function He(e6) {
|
|
|
423
424
|
} } };
|
|
424
425
|
}
|
|
425
426
|
var E = `X-Wix-Consistent`;
|
|
426
|
-
function
|
|
427
|
+
function We(e6) {
|
|
427
428
|
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) => {
|
|
428
429
|
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?.();
|
|
429
430
|
try {
|
|
430
431
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
431
432
|
let e7 = await i3(n3, { ...r3, headers: c3 });
|
|
432
433
|
l3?.handleError(e7, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
433
|
-
let a3 =
|
|
434
|
+
let a3 = Ge(e7);
|
|
434
435
|
return a3 && (t2[E] = a3), e7;
|
|
435
436
|
}
|
|
436
437
|
{
|
|
437
438
|
for (let [e8, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e8, t3);
|
|
438
439
|
let e7 = await i3(n3, r3);
|
|
439
440
|
l3?.handleError(e7, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
440
|
-
let a3 =
|
|
441
|
+
let a3 = Ge(e7);
|
|
441
442
|
return a3 && (t2[E] = a3), e7;
|
|
442
443
|
}
|
|
443
444
|
} catch (e7) {
|
|
444
445
|
throw l3?.handleError(e7, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e7;
|
|
445
446
|
}
|
|
446
|
-
}, { client: c2, initModule: l2 } =
|
|
447
|
-
let i3 = o2(), s3 = await a2(), c3 =
|
|
447
|
+
}, { client: c2, initModule: l2 } = Ue(i2), { client: u2, initModule: d2 } = Ve(i2), f2 = async (n3, r3) => {
|
|
448
|
+
let i3 = o2(), s3 = await a2(), c3 = ee(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e6.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [E]: t2[E] } : {} } }), u3 = Ge(l3);
|
|
448
449
|
return u3 && (t2[E] = u3), l3;
|
|
449
450
|
}, p2 = (t3, n3) => {
|
|
450
|
-
if (
|
|
451
|
-
if (
|
|
452
|
-
if (
|
|
451
|
+
if (ze(t3)) return d2(t3);
|
|
452
|
+
if (He(t3)) return l2(t3);
|
|
453
|
+
if (T(t3) && e6.host) return te(t3, e6.host);
|
|
453
454
|
if (typeof t3 == `function`) {
|
|
454
455
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
455
456
|
let r3 = e6.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e6.useCDN === void 0 ? i2().shouldUseCDN : e6.useCDN;
|
|
456
|
-
return
|
|
457
|
+
return we(ae(() => y(t3)) ? v(t3) : t3, n3 ?? {}, f2, e6.host?.getErrorHandler?.(), (e7, t4) => {
|
|
457
458
|
let n4 = new URL(e7, `https://${r3}`);
|
|
458
459
|
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
459
460
|
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e6.host?.name, o3, e6.validateRequestSchema);
|
|
460
461
|
}
|
|
461
|
-
return
|
|
462
|
-
},
|
|
462
|
+
return w(t3) ? Object.fromEntries(Object.entries(t3).map(([e7, n4]) => [e7, p2(n4, t3[b])])) : t3;
|
|
463
|
+
}, m2 = (e7) => {
|
|
463
464
|
for (let n3 in e7) t2[n3] = e7[n3];
|
|
464
465
|
};
|
|
465
466
|
return { ...e6.modules ? p2(e6.modules) : {}, get auth() {
|
|
466
467
|
let t3 = i2();
|
|
467
468
|
return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e6.host), t3;
|
|
468
|
-
}, setHeaders:
|
|
469
|
-
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 ?
|
|
469
|
+
}, setHeaders: m2, use: p2, enableContext(e7, t3 = { elevated: false }) {
|
|
470
|
+
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;
|
|
470
471
|
}, fetch: (t3, n3) => {
|
|
471
472
|
let r3 = e6.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
|
|
472
473
|
return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
|
|
473
474
|
}, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
|
|
474
475
|
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 }) });
|
|
475
|
-
if (a3.status !== 200) throw new
|
|
476
|
+
if (a3.status !== 200) throw new S(`GraphQL request failed with status ${a3.status}`, a3);
|
|
476
477
|
let { data: o3, errors: s3 } = await a3.json();
|
|
477
478
|
return { data: o3 ?? {}, errors: s3 };
|
|
478
479
|
}, webhooks: u2, servicePlugins: c2 };
|
|
479
480
|
}
|
|
480
|
-
function
|
|
481
|
+
function Ge(e6) {
|
|
481
482
|
return e6.headers?.get(`X-Wix-Consistent`) ?? e6.headers?.get(`x-wix-consistent`);
|
|
482
483
|
}
|
|
483
|
-
var
|
|
484
|
-
var
|
|
485
|
-
var
|
|
486
|
-
var
|
|
487
|
-
var
|
|
488
|
-
function
|
|
484
|
+
var Ke = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
485
|
+
var qe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
486
|
+
var Je = `items`;
|
|
487
|
+
var Ye = `pagingMetadata`;
|
|
488
|
+
var Xe = Ke;
|
|
489
|
+
function Ze(e6, t2) {
|
|
489
490
|
return e6?.split(`.`).map((e7) => t2?.[e7] ?? e7).join(`.`);
|
|
490
491
|
}
|
|
491
|
-
var
|
|
492
|
-
function Qe(e6, t2, n2) {
|
|
493
|
-
return (e6 === Ze || e6.endsWith(`.${Ze}`)) && typeof t2 == `string` ? Xe(t2, n2) : t2;
|
|
494
|
-
}
|
|
492
|
+
var Qe = `sort.fieldName`;
|
|
495
493
|
function $e(e6, t2, n2) {
|
|
494
|
+
return (e6 === Qe || e6.endsWith(`.${Qe}`)) && typeof t2 == `string` ? Ze(t2, n2) : t2;
|
|
495
|
+
}
|
|
496
|
+
function et(e6, t2, n2) {
|
|
496
497
|
let r2 = (e7) => n2.includes(e7), i2 = (e7, n3) => {
|
|
497
498
|
if (Array.isArray(e7)) e7.forEach((e8) => {
|
|
498
499
|
i2(e8, n3);
|
|
@@ -502,160 +503,160 @@ function $e(e6, t2, n2) {
|
|
|
502
503
|
Object.keys(a2).forEach((e8) => {
|
|
503
504
|
let o2 = n3 === `` ? e8 : `${n3}.${e8}`;
|
|
504
505
|
if (r2(o2)) return;
|
|
505
|
-
let s2 =
|
|
506
|
-
s2 !== e8 && !(s2 in a2) && (a2[s2] = a2[e8], delete a2[e8]), a2[s2] =
|
|
506
|
+
let s2 = tt(e8, t2);
|
|
507
|
+
s2 !== e8 && !(s2 in a2) && (a2[s2] = a2[e8], delete a2[e8]), a2[s2] = $e(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
507
508
|
});
|
|
508
509
|
}
|
|
509
510
|
};
|
|
510
511
|
return i2(e6, ``), e6;
|
|
511
512
|
}
|
|
512
|
-
function
|
|
513
|
+
function tt(e6, t2) {
|
|
513
514
|
let n2;
|
|
514
515
|
return n2 = e6.includes(`.`) ? e6.split(`.`).map((e7) => t2[e7] ?? e7).join(`.`) : t2[e6] ?? e6, n2;
|
|
515
516
|
}
|
|
516
517
|
function D(e6, t2 = []) {
|
|
517
|
-
return
|
|
518
|
+
return et(e6, Ke, t2);
|
|
518
519
|
}
|
|
519
520
|
function O(e6, t2 = []) {
|
|
520
|
-
return
|
|
521
|
+
return et(e6, qe, t2);
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
+
function nt(e6) {
|
|
523
524
|
return e6?.toISOString();
|
|
524
525
|
}
|
|
525
|
-
function
|
|
526
|
+
function rt(e6) {
|
|
526
527
|
return e6 ? new Date(e6) : void 0;
|
|
527
528
|
}
|
|
528
|
-
var
|
|
529
|
-
function
|
|
529
|
+
var it = /* @__PURE__ */ new WeakMap();
|
|
530
|
+
function at() {
|
|
530
531
|
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
531
532
|
}
|
|
532
|
-
function
|
|
533
|
+
function ot(e6, t2) {
|
|
533
534
|
let n2 = e6.get(t2);
|
|
534
|
-
return n2 || (n2 =
|
|
535
|
+
return n2 || (n2 = at(), e6.set(t2, n2)), n2;
|
|
535
536
|
}
|
|
536
|
-
function
|
|
537
|
-
return t2 === `*` ? (e6.anyField ??=
|
|
537
|
+
function st(e6, t2) {
|
|
538
|
+
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));
|
|
538
539
|
}
|
|
539
|
-
function
|
|
540
|
-
let t2 =
|
|
540
|
+
function ct(e6) {
|
|
541
|
+
let t2 = at();
|
|
541
542
|
for (let n2 of e6) {
|
|
542
|
-
let e7 = n2.path.split(`.`).reduce(
|
|
543
|
+
let e7 = n2.path.split(`.`).reduce(st, t2);
|
|
543
544
|
e7.leaves ??= [], e7.leaves.push(n2);
|
|
544
545
|
}
|
|
545
546
|
return t2;
|
|
546
547
|
}
|
|
547
|
-
function
|
|
548
|
-
let t2 =
|
|
549
|
-
return t2 || (t2 =
|
|
548
|
+
function lt(e6) {
|
|
549
|
+
let t2 = it.get(e6);
|
|
550
|
+
return t2 || (t2 = ct(e6), it.set(e6, t2)), t2;
|
|
550
551
|
}
|
|
551
552
|
function k(e6) {
|
|
552
553
|
return typeof e6 == `object` && !!e6;
|
|
553
554
|
}
|
|
554
|
-
function
|
|
555
|
+
function ut(e6, { isRepeated: t2, isMap: n2 }, r2) {
|
|
555
556
|
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);
|
|
556
557
|
}
|
|
557
558
|
function A(e6, t2, n2) {
|
|
558
|
-
k(e6) &&
|
|
559
|
+
k(e6) && pt(e6, t2, n2);
|
|
559
560
|
}
|
|
560
|
-
function
|
|
561
|
+
function dt(e6, t2, n2) {
|
|
561
562
|
for (let [r2, i2] of t2) {
|
|
562
563
|
if (!(r2 in e6)) continue;
|
|
563
|
-
if (i2.leaves) for (let t4 of i2.leaves) e6[r2] =
|
|
564
|
+
if (i2.leaves) for (let t4 of i2.leaves) e6[r2] = ut(e6[r2], t4, n2);
|
|
564
565
|
let t3 = e6[r2];
|
|
565
566
|
Array.isArray(t3) ? t3.forEach((e7) => A(e7, i2, n2)) : A(t3, i2, n2);
|
|
566
567
|
}
|
|
567
568
|
}
|
|
568
|
-
function
|
|
569
|
+
function ft(e6, t2, n2) {
|
|
569
570
|
for (let [r2, i2] of t2) {
|
|
570
571
|
let t3 = e6[r2];
|
|
571
572
|
k(t3) && Object.values(t3).forEach((e7) => A(e7, i2, n2));
|
|
572
573
|
}
|
|
573
574
|
}
|
|
574
|
-
function
|
|
575
|
-
t2 &&
|
|
575
|
+
function pt(e6, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
576
|
+
t2 && dt(e6, t2, i2), n2 && ft(e6, n2, i2), r2 && Object.values(e6).forEach((e7) => A(e7, r2, i2));
|
|
576
577
|
}
|
|
577
578
|
function j(e6, t2) {
|
|
578
579
|
if (!k(e6)) return e6;
|
|
579
|
-
for (let { paths: n2, transformFn: r2 } of t2)
|
|
580
|
+
for (let { paths: n2, transformFn: r2 } of t2) pt(e6, lt(n2), r2);
|
|
580
581
|
return e6;
|
|
581
582
|
}
|
|
582
|
-
function
|
|
583
|
-
return
|
|
583
|
+
function mt(e6) {
|
|
584
|
+
return yt(e6).map((e7) => e7.toLocaleUpperCase()).join(`_`);
|
|
584
585
|
}
|
|
585
|
-
var
|
|
586
|
-
var
|
|
587
|
-
var
|
|
588
|
-
var
|
|
589
|
-
function
|
|
586
|
+
var ht = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
587
|
+
var gt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
588
|
+
var _t = `$1\0$2`;
|
|
589
|
+
var vt = /[^\p{L}\d]+/giu;
|
|
590
|
+
function yt(e6) {
|
|
590
591
|
let t2 = e6.trim();
|
|
591
|
-
t2 = t2.replace(
|
|
592
|
+
t2 = t2.replace(ht, _t).replace(gt, _t), t2 = t2.replace(vt, `\0`);
|
|
592
593
|
let n2 = 0, r2 = t2.length;
|
|
593
594
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
594
595
|
if (n2 === r2) return [];
|
|
595
596
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
596
597
|
return t2.slice(n2, r2).split(/\0/g);
|
|
597
598
|
}
|
|
598
|
-
var
|
|
599
|
-
var
|
|
600
|
-
var
|
|
599
|
+
var bt = (e6) => `validationError` in (e6.response?.data?.details ?? {});
|
|
600
|
+
var xt = (e6) => `applicationError` in (e6.response?.data?.details ?? {});
|
|
601
|
+
var St = (e6) => (e6.response?.status ?? -1) >= 400 && (e6.response?.status ?? -1) < 500;
|
|
601
602
|
function M(e6, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
602
603
|
if (typeof e6 != `object` || !e6) throw e6;
|
|
603
|
-
if (
|
|
604
|
-
if (
|
|
605
|
-
if (
|
|
606
|
-
let t3 = e6.response?.status, n3 = e6.response?.statusText ?? `UNKNOWN`, r2 = e6.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
604
|
+
if (bt(e6)) return Ct(e6, t2, n2);
|
|
605
|
+
if (xt(e6)) return wt(e6);
|
|
606
|
+
if (St(e6)) {
|
|
607
|
+
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 };
|
|
607
608
|
return N(e6, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
608
609
|
}
|
|
609
|
-
return
|
|
610
|
+
return Tt(e6);
|
|
610
611
|
}
|
|
611
|
-
var
|
|
612
|
-
let r2 = e6.response?.data, i2 = e6.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
612
|
+
var Ct = (e6, t2, n2) => {
|
|
613
|
+
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 };
|
|
613
614
|
return N(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e6.response?.status, requestId: i2 } });
|
|
614
615
|
};
|
|
615
616
|
var N = (e6, { message: t2, extraProperties: n2 }) => Object.assign(e6, { ...n2, message: t2 });
|
|
616
|
-
var
|
|
617
|
-
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 ??
|
|
617
|
+
var wt = (e6) => {
|
|
618
|
+
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 };
|
|
618
619
|
return N(e6, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e6.requestId } });
|
|
619
620
|
};
|
|
620
|
-
var
|
|
621
|
-
var
|
|
621
|
+
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 } } });
|
|
622
|
+
var Et = ({ spreadPathsToArguments: e6, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
622
623
|
let a2 = { ...e6, ...t2 }, o2 = Object.keys(a2);
|
|
623
624
|
return r2?.filter((e7) => !r2.some((t3) => t3.field.length > e7.field.length && t3.field.startsWith(e7.field) && o2.includes(t3.field))).map((e7) => {
|
|
624
625
|
let r3 = t2[e7.field];
|
|
625
|
-
if (r3) return { ...e7, field:
|
|
626
|
+
if (r3) return { ...e7, field: Dt(r3, i2) };
|
|
626
627
|
let s2 = o2?.sort((e8, t3) => t3.length - e8.length)?.find((t3) => e7.field.startsWith(t3));
|
|
627
628
|
if (s2) {
|
|
628
629
|
let t3 = a2[s2];
|
|
629
|
-
if (t3) return { ...e7, field: e7.field.replace(s2,
|
|
630
|
+
if (t3) return { ...e7, field: e7.field.replace(s2, Dt(t3, i2)) };
|
|
630
631
|
}
|
|
631
632
|
return n2 ? { ...e7, field: `${i2[0]}.${e7.field}` } : e7;
|
|
632
633
|
});
|
|
633
634
|
};
|
|
634
|
-
var
|
|
635
|
-
let n2 =
|
|
635
|
+
var Dt = (e6, t2) => {
|
|
636
|
+
let n2 = Ot(e6);
|
|
636
637
|
return n2 == null ? e6 : e6.replace(`$[${n2}]`, t2[n2]);
|
|
637
638
|
};
|
|
638
|
-
var
|
|
639
|
+
var Ot = (e6) => {
|
|
639
640
|
let t2 = e6.match(/\$\[(?<argIndex>\d+)\]/);
|
|
640
641
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
641
642
|
};
|
|
642
|
-
function
|
|
643
|
+
function kt() {
|
|
643
644
|
let e6 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
644
645
|
if (e6) return { initWixModules(t3, n3) {
|
|
645
|
-
return
|
|
646
|
+
return At(() => e6(t3, n3));
|
|
646
647
|
}, fetchWithAuth() {
|
|
647
648
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
648
649
|
}, graphql() {
|
|
649
650
|
throw Error(`graphql is not available in this context`);
|
|
650
651
|
} };
|
|
651
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
652
|
+
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;
|
|
652
653
|
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
653
654
|
if (r2) {
|
|
654
655
|
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`);
|
|
655
|
-
return
|
|
656
|
+
return At(() => n2.use(e7));
|
|
656
657
|
}
|
|
657
658
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
658
|
-
return
|
|
659
|
+
return At(() => t2.use(e7));
|
|
659
660
|
}, fetchWithAuth: (e7, n3) => {
|
|
660
661
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
661
662
|
return t2.fetchWithAuth(e7, n3);
|
|
@@ -667,110 +668,110 @@ function Ot() {
|
|
|
667
668
|
return t2.graphql(e7, n3, r2);
|
|
668
669
|
} };
|
|
669
670
|
}
|
|
670
|
-
function
|
|
671
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
672
|
-
globalThis.__wix_context__ = void 0,
|
|
671
|
+
function At(e6) {
|
|
672
|
+
let t2 = globalThis.__wix_context__, n2 = { client: h.client, elevatedClient: h.elevatedClient }, r2;
|
|
673
|
+
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);
|
|
673
674
|
try {
|
|
674
675
|
return e6();
|
|
675
676
|
} finally {
|
|
676
|
-
globalThis.__wix_context__ = t2,
|
|
677
|
+
globalThis.__wix_context__ = t2, h.client = n2.client, h.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
677
678
|
}
|
|
678
679
|
}
|
|
679
|
-
function
|
|
680
|
+
function jt(e6, t2) {
|
|
680
681
|
return (...n2) => {
|
|
681
|
-
let r2 =
|
|
682
|
+
let r2 = kt();
|
|
682
683
|
return r2 ? r2.initWixModules(e6, t2).apply(void 0, n2) : e6.apply(void 0, n2);
|
|
683
684
|
};
|
|
684
685
|
}
|
|
685
|
-
function
|
|
686
|
-
return
|
|
686
|
+
function Mt(e6, t2 = false) {
|
|
687
|
+
return jt(e6, t2);
|
|
687
688
|
}
|
|
688
|
-
function
|
|
689
|
-
let n2 =
|
|
690
|
-
return t2 && r2 ? new URLSearchParams({ ".r":
|
|
689
|
+
function Nt(e6, t2) {
|
|
690
|
+
let n2 = Ft(e6), r2 = Object.entries(n2).some(([e7, t3]) => e7.includes(`.`) || Array.isArray(t3) && t3.some((e8) => typeof e8 == `object`));
|
|
691
|
+
return t2 && r2 ? new URLSearchParams({ ".r": Lt(JSON.stringify(e6)) }) : Object.entries(n2).reduce((e7, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
|
|
691
692
|
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e7.append(t3, r3);
|
|
692
693
|
}), e7), new URLSearchParams());
|
|
693
694
|
}
|
|
694
|
-
function
|
|
695
|
-
let t2 =
|
|
696
|
-
return
|
|
695
|
+
function Pt(e6) {
|
|
696
|
+
let t2 = Xt(Jt(e6.host), e6.domainToMappings);
|
|
697
|
+
return on(nn(e6.protoPath, e6.data || {}), t2);
|
|
697
698
|
}
|
|
698
|
-
function
|
|
699
|
+
function Ft(e6, t2 = ``) {
|
|
699
700
|
let n2 = {};
|
|
700
701
|
return Object.entries(e6).forEach(([e7, r2]) => {
|
|
701
|
-
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 =
|
|
702
|
+
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = It(t2, e7);
|
|
702
703
|
if (i2) {
|
|
703
|
-
let e8 =
|
|
704
|
+
let e8 = Ft(r2, a2);
|
|
704
705
|
Object.assign(n2, e8);
|
|
705
706
|
} else n2[a2] = r2;
|
|
706
707
|
}), n2;
|
|
707
708
|
}
|
|
708
|
-
function
|
|
709
|
+
function It(e6, t2) {
|
|
709
710
|
return `${e6}${e6 ? `.` : ``}${t2}`;
|
|
710
711
|
}
|
|
711
|
-
var
|
|
712
|
+
var Lt = (e6) => {
|
|
712
713
|
let t2 = new TextEncoder().encode(e6);
|
|
713
714
|
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e6, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
|
|
714
715
|
};
|
|
715
|
-
var
|
|
716
|
-
var
|
|
717
|
-
var
|
|
718
|
-
var
|
|
719
|
-
var
|
|
720
|
-
var
|
|
721
|
-
var
|
|
722
|
-
var
|
|
723
|
-
var
|
|
724
|
-
var
|
|
725
|
-
function qt(e6) {
|
|
726
|
-
return Jt(e6).replace(Bt, `._base_domain_`).replace(Gt, `._api_base_domain_`).replace(Kt, `*.dev.wix-code.com`);
|
|
727
|
-
}
|
|
716
|
+
var Rt = [`wix.com`, `editorx.com`];
|
|
717
|
+
var zt = `_`;
|
|
718
|
+
var Bt = `*.`;
|
|
719
|
+
var Vt = RegExp(`\\.(${Rt.join(`|`)})$`);
|
|
720
|
+
var Ht = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
721
|
+
var Ut = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
722
|
+
var Wt = `dev.wix-code.com`;
|
|
723
|
+
var Gt = /{(.*)}/;
|
|
724
|
+
var Kt = RegExp(`\\.(${Ht.join(`|`)})$`);
|
|
725
|
+
var qt = RegExp(`.*\\.${Wt}$`);
|
|
728
726
|
function Jt(e6) {
|
|
729
|
-
return
|
|
727
|
+
return Yt(e6).replace(Vt, `._base_domain_`).replace(Kt, `._api_base_domain_`).replace(qt, `*.dev.wix-code.com`);
|
|
728
|
+
}
|
|
729
|
+
function Yt(e6) {
|
|
730
|
+
return Ut[e6] ?? e6;
|
|
730
731
|
}
|
|
731
|
-
function
|
|
732
|
+
function Xt(e6, t2) {
|
|
732
733
|
let n2 = t2[e6];
|
|
733
734
|
if (n2) return n2;
|
|
734
|
-
let r2 =
|
|
735
|
+
let r2 = Zt(e6, t2) ?? Qt(e6, t2);
|
|
735
736
|
if (!r2) {
|
|
736
|
-
if (
|
|
737
|
-
let e7 = t2[
|
|
737
|
+
if (en(e6)) {
|
|
738
|
+
let e7 = t2[tn];
|
|
738
739
|
if (e7) return e7;
|
|
739
740
|
}
|
|
740
|
-
let n3 = t2[
|
|
741
|
+
let n3 = t2[zt];
|
|
741
742
|
if (n3) return n3;
|
|
742
743
|
}
|
|
743
744
|
return r2 ?? [];
|
|
744
745
|
}
|
|
745
|
-
function
|
|
746
|
+
function Zt(e6, t2) {
|
|
746
747
|
return Object.entries(t2).find(([t3]) => {
|
|
747
748
|
let [, ...n2] = e6.split(`.`);
|
|
748
749
|
return n2.join(`.`) === t3;
|
|
749
750
|
})?.[1];
|
|
750
751
|
}
|
|
751
|
-
function
|
|
752
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
752
|
+
function Qt(e6, t2) {
|
|
753
|
+
let [n2] = Object.entries(t2).filter(([t3]) => $t(e6, t3)).sort(([e7], [t3]) => t3.length - e7.length);
|
|
753
754
|
if (!n2) return;
|
|
754
755
|
let [, r2] = n2;
|
|
755
756
|
return r2;
|
|
756
757
|
}
|
|
757
|
-
function
|
|
758
|
-
if (!t2.startsWith(
|
|
758
|
+
function $t(e6, t2) {
|
|
759
|
+
if (!t2.startsWith(Bt)) return false;
|
|
759
760
|
let n2 = t2.slice(1);
|
|
760
761
|
return e6.length > n2.length && e6.endsWith(n2);
|
|
761
762
|
}
|
|
762
|
-
function
|
|
763
|
+
function en(e6) {
|
|
763
764
|
return !!e6.match(/\._base_domain_$/);
|
|
764
765
|
}
|
|
765
|
-
var
|
|
766
|
-
function tn(e6, t2) {
|
|
767
|
-
return e6.split(`/`).map((e7) => nn(e7, t2)).join(`/`);
|
|
768
|
-
}
|
|
766
|
+
var tn = `www._base_domain_`;
|
|
769
767
|
function nn(e6, t2) {
|
|
770
|
-
|
|
771
|
-
return r2 ? rn(t2, r2, e6, e6.replace(n2[0], ``)) : e6;
|
|
768
|
+
return e6.split(`/`).map((e7) => rn(e7, t2)).join(`/`);
|
|
772
769
|
}
|
|
773
|
-
function rn(e6, t2
|
|
770
|
+
function rn(e6, t2) {
|
|
771
|
+
let n2 = e6.match(Gt) || [], r2 = n2[1];
|
|
772
|
+
return r2 ? an(t2, r2, e6, e6.replace(n2[0], ``)) : e6;
|
|
773
|
+
}
|
|
774
|
+
function an(e6, t2, n2, r2) {
|
|
774
775
|
let i2 = e6;
|
|
775
776
|
for (let e7 of t2.split(`.`)) {
|
|
776
777
|
if (!i2) return n2;
|
|
@@ -778,22 +779,22 @@ function rn(e6, t2, n2, r2) {
|
|
|
778
779
|
}
|
|
779
780
|
return `${i2}${r2}`;
|
|
780
781
|
}
|
|
781
|
-
function
|
|
782
|
+
function on(e6, t2) {
|
|
782
783
|
let n2 = t2?.find((t3) => e6.startsWith(t3.destPath));
|
|
783
784
|
return n2 ? n2.srcPath + e6.slice(n2.destPath.length) : e6;
|
|
784
785
|
}
|
|
785
|
-
function
|
|
786
|
+
function sn(e6) {
|
|
786
787
|
return e6 === `NaN` ? NaN : e6 === `Infinity` ? 1 / 0 : e6 === `-Infinity` ? -1 / 0 : e6;
|
|
787
788
|
}
|
|
788
|
-
var
|
|
789
|
-
var
|
|
789
|
+
var cn = `modulepreload`;
|
|
790
|
+
var ln = function(e6, t2) {
|
|
790
791
|
return new URL(e6, t2).href;
|
|
791
792
|
};
|
|
792
|
-
var
|
|
793
|
-
var
|
|
793
|
+
var un = {};
|
|
794
|
+
var dn = function(e6) {
|
|
794
795
|
return e6.pathname.endsWith(`.css`);
|
|
795
796
|
};
|
|
796
|
-
var
|
|
797
|
+
var fn = function(e6, t2, n2) {
|
|
797
798
|
if (t2 in e6) return e6[t2];
|
|
798
799
|
let r2 = n2();
|
|
799
800
|
if (!r2) {
|
|
@@ -807,7 +808,7 @@ var dn = function(e6, t2, n2) {
|
|
|
807
808
|
});
|
|
808
809
|
return e6[t2] = i2, i2;
|
|
809
810
|
};
|
|
810
|
-
var
|
|
811
|
+
var pn = function(e6, t2, n2) {
|
|
811
812
|
let r2 = Promise.resolve();
|
|
812
813
|
if (t2 && t2.length > 0) {
|
|
813
814
|
let o3 = function(e8) {
|
|
@@ -818,9 +819,9 @@ var fn = function(e6, t2, n2) {
|
|
|
818
819
|
var o2 = o3, s2 = s3;
|
|
819
820
|
let e7, i3 = document.querySelector(`meta[property=csp-nonce]`), a2 = i3?.nonce || i3?.getAttribute(`nonce`);
|
|
820
821
|
r2 = o3(t2.map((t3) => {
|
|
821
|
-
t3 =
|
|
822
|
-
let r3 = s3(t3), i4 =
|
|
823
|
-
return
|
|
822
|
+
t3 = ln(t3, n2);
|
|
823
|
+
let r3 = s3(t3), i4 = dn(r3);
|
|
824
|
+
return fn(un, r3.href, () => {
|
|
824
825
|
if (e7 === void 0) {
|
|
825
826
|
e7 = { all: /* @__PURE__ */ new Set(), styles: /* @__PURE__ */ new Set() };
|
|
826
827
|
let t5 = document.getElementsByTagName(`link`);
|
|
@@ -831,7 +832,7 @@ var fn = function(e6, t2, n2) {
|
|
|
831
832
|
}
|
|
832
833
|
if ((i4 ? e7.styles : e7.all).has(r3.href)) return;
|
|
833
834
|
let t4 = document.createElement(`link`);
|
|
834
|
-
if (t4.rel = i4 ? `stylesheet` :
|
|
835
|
+
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) => {
|
|
835
836
|
t4.addEventListener(`load`, e8), t4.addEventListener(`error`, () => n3(Error(`Unable to preload CSS for ${r3}`)));
|
|
836
837
|
});
|
|
837
838
|
});
|
|
@@ -846,30 +847,30 @@ var fn = function(e6, t2, n2) {
|
|
|
846
847
|
return e6().catch(i2);
|
|
847
848
|
});
|
|
848
849
|
};
|
|
849
|
-
var
|
|
850
|
-
var
|
|
851
|
-
var
|
|
852
|
-
var
|
|
853
|
-
let e6 =
|
|
854
|
-
if (e6) return { [
|
|
850
|
+
var mn = `x-wix-linguist`;
|
|
851
|
+
var hn = `00000000-0000-0000-0000-000000000000`;
|
|
852
|
+
var gn = `false`;
|
|
853
|
+
var _n = () => {
|
|
854
|
+
let e6 = bn(`language`), t2 = bn(`locale`);
|
|
855
|
+
if (e6) return { [mn]: [e6, t2 || e6, gn, hn].join(`|`) };
|
|
855
856
|
};
|
|
856
|
-
function
|
|
857
|
+
function vn() {
|
|
857
858
|
let e6 = null, t2 = null;
|
|
858
859
|
return { promise: new Promise((n2, r2) => {
|
|
859
860
|
e6 = n2, t2 = r2;
|
|
860
861
|
}), resolve: e6, reject: t2 };
|
|
861
862
|
}
|
|
862
|
-
var
|
|
863
|
-
var
|
|
864
|
-
var
|
|
865
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e6(t2), o2 =
|
|
866
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
867
|
-
return
|
|
863
|
+
var yn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
864
|
+
var bn = (e6) => yn()?.[e6];
|
|
865
|
+
var xn = ({ createHost: e6 }) => ({ __type: `host`, create: (e7) => ({}), host: (t2) => {
|
|
866
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e6(t2), o2 = Cn();
|
|
867
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: bn(`language`), locale: bn(`locale`), get passThroughHeaders() {
|
|
868
|
+
return _n();
|
|
868
869
|
} } };
|
|
869
870
|
}, auth: (e7) => {
|
|
870
871
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
871
|
-
!e7 &&
|
|
872
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
872
|
+
!e7 && Sn() && (e7 = t2?.getAccessTokenFunction?.());
|
|
873
|
+
let n2 = false, { resolve: r2, promise: i2 } = vn();
|
|
873
874
|
return { getAuthHeaders: async () => {
|
|
874
875
|
if (!e7 && n2 && (e7 = await i2), !e7) throw Error(`Failed to resolve auth token`);
|
|
875
876
|
return { headers: { Authorization: await e7() } };
|
|
@@ -877,60 +878,60 @@ var bn = ({ createHost: e6 }) => ({ __type: `host`, create: (e7) => ({}), host:
|
|
|
877
878
|
r2(e8);
|
|
878
879
|
}) };
|
|
879
880
|
} });
|
|
880
|
-
function
|
|
881
|
+
function Sn() {
|
|
881
882
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
882
883
|
}
|
|
883
|
-
function
|
|
884
|
+
function Cn() {
|
|
884
885
|
let e6 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
885
886
|
if (!e6) return;
|
|
886
887
|
let t2 = new URL(e6);
|
|
887
888
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
888
889
|
}
|
|
889
|
-
var
|
|
890
|
+
var wn = ({ clientSdk: e6, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
890
891
|
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`);
|
|
891
892
|
return e6.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
892
893
|
}, getAccessToken: () => {
|
|
893
894
|
throw Error(`Not implemented`);
|
|
894
895
|
}, observeState: () => ({ disconnect: () => {
|
|
895
896
|
} }) });
|
|
896
|
-
var
|
|
897
|
+
var Tn = xn({ createHost: function(e6) {
|
|
897
898
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e6?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e6 || {};
|
|
898
899
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
899
|
-
return { channel:
|
|
900
|
+
return { channel: wn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
900
901
|
} };
|
|
901
902
|
} });
|
|
902
|
-
var
|
|
903
|
-
let n2 =
|
|
904
|
-
return
|
|
905
|
-
};
|
|
906
|
-
var
|
|
907
|
-
var
|
|
908
|
-
var
|
|
909
|
-
function
|
|
910
|
-
let o2 =
|
|
903
|
+
var En = (e6, t2) => {
|
|
904
|
+
let n2 = Tn.host({ applicationId: e6, componentId: t2 }), r2 = Tn.auth();
|
|
905
|
+
return We({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
906
|
+
};
|
|
907
|
+
var Dn = (e6) => En(`14bcded7-0066-7c35-14d7-466cb3f09103`, e6);
|
|
908
|
+
var On = { post: `post`, feed: `feed`, relatedPosts: `related-posts`, comments: `comments`, seo: `seo`, likes: `likes` };
|
|
909
|
+
var kn = (e6, t2) => e6 && typeof e6[t2] == `function` ? e6 : null;
|
|
910
|
+
function An(e6, t2, { feature: n2, action: r2, level: i2 = `error`, contexts: a2 }) {
|
|
911
|
+
let o2 = kn(e6, `captureException`);
|
|
911
912
|
if (!o2) return;
|
|
912
913
|
let s2 = t2 instanceof Error ? t2 : Error(String(t2));
|
|
913
914
|
o2.captureException(s2, { level: i2, tags: { feature: n2, action: r2 }, ...a2 ? { contexts: a2 } : {} });
|
|
914
915
|
}
|
|
915
|
-
function
|
|
916
|
+
function jn(e6) {
|
|
916
917
|
return Object.keys(e6).length === 1 && `$and` in e6 && Array.isArray(e6.$and);
|
|
917
918
|
}
|
|
918
|
-
function
|
|
919
|
+
function Mn(e6) {
|
|
919
920
|
return Object.keys(e6).length === 1 && `$or` in e6 && Array.isArray(e6.$or);
|
|
920
921
|
}
|
|
921
|
-
function
|
|
922
|
+
function Nn(e6) {
|
|
922
923
|
return Object.keys(e6).length === 1 && `$not` in e6 && typeof e6.$not == `object`;
|
|
923
924
|
}
|
|
924
925
|
function P(e6, t2) {
|
|
925
|
-
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $and: [...
|
|
926
|
+
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]] };
|
|
926
927
|
}
|
|
927
|
-
function
|
|
928
|
-
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $or: [...
|
|
928
|
+
function Pn(e6, t2) {
|
|
929
|
+
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]] };
|
|
929
930
|
}
|
|
930
|
-
function
|
|
931
|
-
if (e6 !== void 0 && Object.keys(e6).length !== 0) return
|
|
931
|
+
function Fn(e6) {
|
|
932
|
+
if (e6 !== void 0 && Object.keys(e6).length !== 0) return Nn(e6) ? e6.$not : { $not: e6 };
|
|
932
933
|
}
|
|
933
|
-
var
|
|
934
|
+
var In = class {
|
|
934
935
|
_items;
|
|
935
936
|
_fetchNextPage;
|
|
936
937
|
_fetchPrevPage;
|
|
@@ -960,7 +961,7 @@ var Fn = class {
|
|
|
960
961
|
return await this._fetchPrevPage();
|
|
961
962
|
}
|
|
962
963
|
};
|
|
963
|
-
var
|
|
964
|
+
var Ln = class extends In {
|
|
964
965
|
_nextCursor;
|
|
965
966
|
_prevCursor;
|
|
966
967
|
cursors;
|
|
@@ -974,7 +975,7 @@ var In = class extends Fn {
|
|
|
974
975
|
return !!this._prevCursor;
|
|
975
976
|
}
|
|
976
977
|
};
|
|
977
|
-
var
|
|
978
|
+
var Rn = class extends In {
|
|
978
979
|
_totalCount;
|
|
979
980
|
_offset;
|
|
980
981
|
_tooManyToCount;
|
|
@@ -997,16 +998,16 @@ var Ln = class extends Fn {
|
|
|
997
998
|
return !!(this._limit !== 0 && this.currentPage && this.currentPage > 0);
|
|
998
999
|
}
|
|
999
1000
|
};
|
|
1000
|
-
function
|
|
1001
|
+
function zn(e6) {
|
|
1001
1002
|
let t2 = (n2) => ({ query: n2, async find() {
|
|
1002
1003
|
try {
|
|
1003
|
-
let r2 = e6.requestTransformer(e6.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e6.func(r2), { [
|
|
1004
|
+
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);
|
|
1004
1005
|
if (e6.pagingMethod === `OFFSET`) {
|
|
1005
1006
|
let e7 = n2;
|
|
1006
|
-
return new
|
|
1007
|
+
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 });
|
|
1007
1008
|
}
|
|
1008
1009
|
let s2 = n2.cursorPaging;
|
|
1009
|
-
return new
|
|
1010
|
+
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 });
|
|
1010
1011
|
} catch (t3) {
|
|
1011
1012
|
throw e6.errorTransformer(t3);
|
|
1012
1013
|
}
|
|
@@ -1058,11 +1059,11 @@ function Rn(e6) {
|
|
|
1058
1059
|
let a2 = { [F(e6.transformationPaths, r2)]: { $exists: i2 } };
|
|
1059
1060
|
return t2({ ...n2, filter: P(n2.filter, a2) });
|
|
1060
1061
|
}, or(e7) {
|
|
1061
|
-
return t2({ ...n2, filter:
|
|
1062
|
+
return t2({ ...n2, filter: Pn(n2.filter, e7.query.filter) });
|
|
1062
1063
|
}, and(e7) {
|
|
1063
1064
|
return t2({ ...n2, filter: P(n2.filter, e7.query.filter) });
|
|
1064
1065
|
}, not(e7) {
|
|
1065
|
-
return t2({ ...n2, filter:
|
|
1066
|
+
return t2({ ...n2, filter: Fn(e7.query.filter) });
|
|
1066
1067
|
}, ascending(...r2) {
|
|
1067
1068
|
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: F(e6.transformationPaths, t3), order: `ASC` }))] });
|
|
1068
1069
|
}, descending(...r2) {
|
|
@@ -1081,69 +1082,69 @@ function Rn(e6) {
|
|
|
1081
1082
|
}
|
|
1082
1083
|
function F(e6, t2) {
|
|
1083
1084
|
let n2 = Object.entries(e6).find(([e7]) => e7 === t2 || t2.startsWith(`${e7}.`))?.[0];
|
|
1084
|
-
return n2 ? t2.replace(n2, e6[n2]) :
|
|
1085
|
-
}
|
|
1086
|
-
var
|
|
1087
|
-
var
|
|
1088
|
-
var
|
|
1089
|
-
var
|
|
1090
|
-
var
|
|
1091
|
-
var
|
|
1092
|
-
function
|
|
1085
|
+
return n2 ? t2.replace(n2, e6[n2]) : Ze(t2, { ...e6, ...Xe });
|
|
1086
|
+
}
|
|
1087
|
+
var Bn = `filter`;
|
|
1088
|
+
var Vn = `sort`;
|
|
1089
|
+
var Hn = `cursorPaging`;
|
|
1090
|
+
var Un = `paging`;
|
|
1091
|
+
var Wn = [Bn, Vn, Hn];
|
|
1092
|
+
var Gn = [Bn, Vn, Un];
|
|
1093
|
+
function Kn(e6, t2) {
|
|
1093
1094
|
return !e6 || typeof e6 != `object` ? false : t2.some((t3) => e6.hasOwnProperty(t3));
|
|
1094
1095
|
}
|
|
1095
|
-
function Kn(e6) {
|
|
1096
|
-
return Gn(e6, Un);
|
|
1097
|
-
}
|
|
1098
1096
|
function qn(e6) {
|
|
1099
|
-
return
|
|
1097
|
+
return Kn(e6, Wn);
|
|
1100
1098
|
}
|
|
1101
1099
|
function Jn(e6) {
|
|
1100
|
+
return Kn(e6, Gn);
|
|
1101
|
+
}
|
|
1102
|
+
function Yn(e6) {
|
|
1102
1103
|
let { hasOptionsParameter: t2 } = e6;
|
|
1103
1104
|
return function(...n2) {
|
|
1104
|
-
return t2 ?
|
|
1105
|
+
return t2 ? Zn(n2, e6) : Xn(n2, e6);
|
|
1105
1106
|
};
|
|
1106
1107
|
}
|
|
1107
|
-
function
|
|
1108
|
+
function Xn(e6, t2) {
|
|
1108
1109
|
return e6.length === 0 ? t2.builderQueryFunction() : t2.typedQueryFunction(e6[0]);
|
|
1109
1110
|
}
|
|
1110
|
-
function
|
|
1111
|
+
function Zn(e6, t2) {
|
|
1111
1112
|
switch (e6.length) {
|
|
1112
1113
|
case 0:
|
|
1113
1114
|
return t2.builderQueryFunction();
|
|
1114
1115
|
case 1:
|
|
1115
|
-
return
|
|
1116
|
+
return qn(e6[0]) || Jn(e6[0]) ? t2.typedQueryFunction(e6[0]) : t2.builderQueryFunction(e6[0]);
|
|
1116
1117
|
default:
|
|
1117
1118
|
return t2.typedQueryFunction(e6[0], e6[1]);
|
|
1118
1119
|
}
|
|
1119
1120
|
}
|
|
1120
|
-
var
|
|
1121
|
-
var
|
|
1122
|
-
function
|
|
1123
|
-
return
|
|
1121
|
+
var Qn = [{ path: `like.createdDate` }];
|
|
1122
|
+
var $n = [{ path: `likes.createdDate` }];
|
|
1123
|
+
function er(e6) {
|
|
1124
|
+
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` }] } }));
|
|
1124
1125
|
}
|
|
1125
|
-
var
|
|
1126
|
-
function
|
|
1126
|
+
var tr = `@wix/auto_sdk_blog_likes`;
|
|
1127
|
+
function nr(e6) {
|
|
1127
1128
|
function t2({ host: t3 }) {
|
|
1128
|
-
let n2 = j(e6, [{ transformFn:
|
|
1129
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.CreateLike`, packageName:
|
|
1129
|
+
let n2 = j(e6, [{ transformFn: nt, paths: Qn }]);
|
|
1130
|
+
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 }]) };
|
|
1130
1131
|
}
|
|
1131
1132
|
return t2;
|
|
1132
1133
|
}
|
|
1133
|
-
function
|
|
1134
|
+
function rr(e6) {
|
|
1134
1135
|
function t2({ host: t3 }) {
|
|
1135
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.QueryLikes`, packageName:
|
|
1136
|
+
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 }]) };
|
|
1136
1137
|
}
|
|
1137
1138
|
return t2;
|
|
1138
1139
|
}
|
|
1139
|
-
function
|
|
1140
|
+
function ir(e6) {
|
|
1140
1141
|
function t2({ host: t3 }) {
|
|
1141
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `DELETE`, methodFqn: `wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId`, packageName:
|
|
1142
|
+
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) };
|
|
1142
1143
|
}
|
|
1143
1144
|
return t2;
|
|
1144
1145
|
}
|
|
1145
|
-
async function
|
|
1146
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1146
|
+
async function ar(e6) {
|
|
1147
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = nr(D({ like: e6?.like }));
|
|
1147
1148
|
n2?.onSiteCall?.();
|
|
1148
1149
|
try {
|
|
1149
1150
|
let e7 = await t2.request(r2);
|
|
@@ -1153,10 +1154,10 @@ async function ir(e6) {
|
|
|
1153
1154
|
throw n2?.onError?.(e7), t3;
|
|
1154
1155
|
}
|
|
1155
1156
|
}
|
|
1156
|
-
function
|
|
1157
|
+
function or() {
|
|
1157
1158
|
let { httpClient: e6, sideEffects: t2 } = arguments[0];
|
|
1158
|
-
return
|
|
1159
|
-
let r2 =
|
|
1159
|
+
return zn({ func: async (n2) => {
|
|
1160
|
+
let r2 = rr(n2);
|
|
1160
1161
|
t2?.onSiteCall?.();
|
|
1161
1162
|
try {
|
|
1162
1163
|
let n3 = await e6.request(r2);
|
|
@@ -1174,8 +1175,8 @@ function ar() {
|
|
|
1174
1175
|
throw M(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
1175
1176
|
}, pagingMethod: `CURSOR`, transformationPaths: {} });
|
|
1176
1177
|
}
|
|
1177
|
-
async function
|
|
1178
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1178
|
+
async function sr(e6) {
|
|
1179
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = rr(D({ query: e6 }));
|
|
1179
1180
|
n2?.onSiteCall?.();
|
|
1180
1181
|
try {
|
|
1181
1182
|
let e7 = await t2.request(r2);
|
|
@@ -1185,8 +1186,8 @@ async function or(e6) {
|
|
|
1185
1186
|
throw n2?.onError?.(e7), t3;
|
|
1186
1187
|
}
|
|
1187
1188
|
}
|
|
1188
|
-
async function
|
|
1189
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1189
|
+
async function cr(e6) {
|
|
1190
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = ir(D({ fqdn: e6?.fqdn, entityId: e6?.entityId }));
|
|
1190
1191
|
n2?.onSiteCall?.();
|
|
1191
1192
|
try {
|
|
1192
1193
|
let e7 = await t2.request(r2);
|
|
@@ -1196,41 +1197,41 @@ async function sr(e6) {
|
|
|
1196
1197
|
throw n2?.onError?.(e7), t3;
|
|
1197
1198
|
}
|
|
1198
1199
|
}
|
|
1199
|
-
function cr(e6) {
|
|
1200
|
-
return (t2) => ir(t2, { httpClient: e6 });
|
|
1201
|
-
}
|
|
1202
1200
|
function lr(e6) {
|
|
1203
|
-
return () => ar({ httpClient: e6 });
|
|
1201
|
+
return (t2) => ar(t2, { httpClient: e6 });
|
|
1204
1202
|
}
|
|
1205
1203
|
function ur(e6) {
|
|
1206
|
-
return (
|
|
1204
|
+
return () => or({ httpClient: e6 });
|
|
1207
1205
|
}
|
|
1208
1206
|
function dr(e6) {
|
|
1209
1207
|
return (t2) => sr(t2, { httpClient: e6 });
|
|
1210
1208
|
}
|
|
1211
1209
|
function fr(e6) {
|
|
1212
|
-
|
|
1210
|
+
return (t2) => cr(t2, { httpClient: e6 });
|
|
1211
|
+
}
|
|
1212
|
+
function pr(e6) {
|
|
1213
|
+
let t2 = Yn({ builderQueryFunction: () => ur(e6)(), typedQueryFunction: (t3) => dr(e6)(t3), hasOptionsParameter: false });
|
|
1213
1214
|
function n2(e7) {
|
|
1214
1215
|
return t2(...arguments);
|
|
1215
1216
|
}
|
|
1216
1217
|
return n2;
|
|
1217
1218
|
}
|
|
1218
|
-
var
|
|
1219
|
-
var
|
|
1220
|
-
var
|
|
1221
|
-
var
|
|
1222
|
-
function
|
|
1223
|
-
return
|
|
1219
|
+
var mr = Mt(lr);
|
|
1220
|
+
var hr = Mt(fr);
|
|
1221
|
+
var gr = Mt(pr);
|
|
1222
|
+
var _r = [{ path: `metrics.averageRating` }];
|
|
1223
|
+
function vr(e6) {
|
|
1224
|
+
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` }] } }));
|
|
1224
1225
|
}
|
|
1225
|
-
var
|
|
1226
|
-
function
|
|
1226
|
+
var yr = `@wix/auto_sdk_blog_posts`;
|
|
1227
|
+
function br(e6) {
|
|
1227
1228
|
function t2({ host: t3 }) {
|
|
1228
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName:
|
|
1229
|
+
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 }]) };
|
|
1229
1230
|
}
|
|
1230
1231
|
return t2;
|
|
1231
1232
|
}
|
|
1232
|
-
async function
|
|
1233
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
1233
|
+
async function xr(e6) {
|
|
1234
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = br(D({ postId: e6 }, []));
|
|
1234
1235
|
n2?.onSiteCall?.();
|
|
1235
1236
|
try {
|
|
1236
1237
|
let e7 = await t2.request(r2);
|
|
@@ -1240,127 +1241,127 @@ async function br(e6) {
|
|
|
1240
1241
|
throw n2?.onError?.(e7), t3;
|
|
1241
1242
|
}
|
|
1242
1243
|
}
|
|
1243
|
-
function
|
|
1244
|
-
return (t2) =>
|
|
1244
|
+
function Sr(e6) {
|
|
1245
|
+
return (t2) => xr(t2, { httpClient: e6 });
|
|
1245
1246
|
}
|
|
1246
|
-
var
|
|
1247
|
-
var
|
|
1248
|
-
var wr = async (e6) => {
|
|
1249
|
-
await pr({ like: { entityId: e6, fqdn: Cr } });
|
|
1250
|
-
};
|
|
1247
|
+
var Cr = Mt(Sr);
|
|
1248
|
+
var wr = `wix.blog.v3.post`;
|
|
1251
1249
|
var Tr = async (e6) => {
|
|
1252
|
-
await mr({
|
|
1250
|
+
await mr({ like: { entityId: e6, fqdn: wr } });
|
|
1251
|
+
};
|
|
1252
|
+
var Er = async (e6) => {
|
|
1253
|
+
await hr({ fqdn: wr, entityId: e6 });
|
|
1253
1254
|
};
|
|
1254
|
-
var
|
|
1255
|
-
var
|
|
1256
|
-
let [t2, n2] = await Promise.allSettled([
|
|
1257
|
-
return { liked: t2.status === `fulfilled` && t2.value.items.length > 0, likeCount:
|
|
1255
|
+
var Dr = (e6) => typeof e6 == `number` ? e6 : void 0;
|
|
1256
|
+
var Or = async (e6) => {
|
|
1257
|
+
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;
|
|
1258
|
+
return { liked: t2.status === `fulfilled` && t2.value.items.length > 0, likeCount: Dr(r2?.likes), viewCount: Dr(r2?.views), commentCount: Dr(r2?.comments) };
|
|
1258
1259
|
};
|
|
1259
1260
|
function I(e6) {
|
|
1260
1261
|
return e6;
|
|
1261
1262
|
}
|
|
1262
|
-
var
|
|
1263
|
-
var
|
|
1263
|
+
var kr = I(`@wix/site-service-editor-context`);
|
|
1264
|
+
var Ar = () => {
|
|
1264
1265
|
try {
|
|
1265
|
-
return !!
|
|
1266
|
+
return !!u(kr).previewMode;
|
|
1266
1267
|
} catch {
|
|
1267
1268
|
return false;
|
|
1268
1269
|
}
|
|
1269
1270
|
};
|
|
1270
|
-
var
|
|
1271
|
-
var
|
|
1271
|
+
var jr = I(`@wix/viewer-service-site-members`);
|
|
1272
|
+
var Mr = () => {
|
|
1272
1273
|
try {
|
|
1273
|
-
return
|
|
1274
|
+
return u(jr);
|
|
1274
1275
|
} catch {
|
|
1275
1276
|
return;
|
|
1276
1277
|
}
|
|
1277
1278
|
};
|
|
1278
|
-
var
|
|
1279
|
+
var Nr = { liked: false, baselineLiked: false, freshLikeCount: void 0, viewCount: void 0, commentCount: void 0, isLikeCountLoaded: false };
|
|
1279
1280
|
var L = `wix-blog:post-like-toggled`;
|
|
1280
|
-
var
|
|
1281
|
+
var Pr = () => {
|
|
1281
1282
|
let e6 = window;
|
|
1282
1283
|
return e6[L] ??= /* @__PURE__ */ new Map();
|
|
1283
1284
|
};
|
|
1284
|
-
var
|
|
1285
|
-
|
|
1285
|
+
var Fr = (e6) => {
|
|
1286
|
+
Pr().set(e6.postId, e6.liked), window.dispatchEvent(new CustomEvent(L, { detail: e6 }));
|
|
1286
1287
|
};
|
|
1287
|
-
var
|
|
1288
|
-
var
|
|
1289
|
-
let u2 =
|
|
1290
|
-
|
|
1288
|
+
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 });
|
|
1289
|
+
var Lr = (e6, t2, n2 = false, a2) => {
|
|
1290
|
+
let u2 = Ar() || n2, [d2, f2] = l(Nr), p2 = c(Nr), m2 = c(t2), h2 = c(/* @__PURE__ */ new Set()), g2 = c(false), _2 = c(false), v2 = c(void 0), y2 = Mr(), [b2, x2] = l(0);
|
|
1291
|
+
o(() => {
|
|
1291
1292
|
let e7 = y2?.addMemberLoginListener?.(() => {
|
|
1292
|
-
|
|
1293
|
+
Pr().clear(), x2((e8) => e8 + 1);
|
|
1293
1294
|
});
|
|
1294
1295
|
return () => {
|
|
1295
1296
|
e7 !== void 0 && y2?.removeMemberLoginListener?.(e7);
|
|
1296
1297
|
};
|
|
1297
1298
|
}, [y2]);
|
|
1298
|
-
let S2 =
|
|
1299
|
-
let t3 = p2.current,
|
|
1300
|
-
Object.keys(
|
|
1301
|
-
}, []), C2 =
|
|
1299
|
+
let S2 = i((e7) => {
|
|
1300
|
+
let t3 = p2.current, n3 = { ...t3, ...e7 };
|
|
1301
|
+
Object.keys(n3).every((e8) => n3[e8] === t3[e8]) || (p2.current = n3, h2.current.forEach((e8) => e8()), r(() => f2(n3)));
|
|
1302
|
+
}, []), C2 = s(() => ({ get: () => Ir(p2.current, m2.current), subscribe: (e7) => (h2.current.add(e7), () => {
|
|
1302
1303
|
h2.current.delete(e7);
|
|
1303
1304
|
}) }), []);
|
|
1304
|
-
|
|
1305
|
+
o(() => {
|
|
1305
1306
|
m2.current !== t2 && (m2.current = t2, h2.current.forEach((e7) => e7()));
|
|
1306
|
-
}, [t2]),
|
|
1307
|
-
if (v2.current !== e6 && (v2.current = e6, S2(
|
|
1307
|
+
}, [t2]), o(() => {
|
|
1308
|
+
if (v2.current !== e6 && (v2.current = e6, S2(Nr)), _2.current = false, !e6 || u2) {
|
|
1308
1309
|
S2({ isLikeCountLoaded: true });
|
|
1309
1310
|
return;
|
|
1310
1311
|
}
|
|
1311
1312
|
let t3 = false;
|
|
1312
|
-
return
|
|
1313
|
-
t3 || S2({ isLikeCountLoaded: true, viewCount: r2, commentCount:
|
|
1314
|
-
}).catch((
|
|
1315
|
-
t3 || S2({ isLikeCountLoaded: true }),
|
|
1313
|
+
return Or(e6).then(({ liked: e7, likeCount: n3, viewCount: r2, commentCount: i2 }) => {
|
|
1314
|
+
t3 || S2({ isLikeCountLoaded: true, viewCount: r2, commentCount: i2, baselineLiked: e7, freshLikeCount: n3, ...!_2.current && { liked: e7 } });
|
|
1315
|
+
}).catch((n3) => {
|
|
1316
|
+
t3 || S2({ isLikeCountLoaded: true }), An(a2, n3, { feature: On.likes, action: `read-like-state`, level: `warning`, contexts: { likes: { postId: e6 } } });
|
|
1316
1317
|
}), () => {
|
|
1317
1318
|
t3 = true;
|
|
1318
1319
|
};
|
|
1319
|
-
}, [e6, u2,
|
|
1320
|
+
}, [e6, u2, a2, S2, b2]), o(() => {
|
|
1320
1321
|
if (!e6) return;
|
|
1321
1322
|
let t3 = (e7) => {
|
|
1322
1323
|
_2.current = true, S2({ liked: e7 });
|
|
1323
|
-
},
|
|
1324
|
-
|
|
1325
|
-
let r2 = (
|
|
1326
|
-
let { detail: r3 } =
|
|
1324
|
+
}, n3 = Pr().get(e6);
|
|
1325
|
+
n3 !== void 0 && t3(n3);
|
|
1326
|
+
let r2 = (n4) => {
|
|
1327
|
+
let { detail: r3 } = n4;
|
|
1327
1328
|
r3.postId === e6 && t3(r3.liked);
|
|
1328
1329
|
};
|
|
1329
1330
|
return window.addEventListener(L, r2), () => window.removeEventListener(L, r2);
|
|
1330
1331
|
}, [e6, S2]);
|
|
1331
|
-
let ee2 =
|
|
1332
|
+
let ee2 = i(async (t3) => {
|
|
1332
1333
|
if (!e6 || g2.current) return;
|
|
1333
1334
|
_2.current = true;
|
|
1334
|
-
let
|
|
1335
|
-
if (S2({ liked:
|
|
1335
|
+
let n3 = !p2.current.liked;
|
|
1336
|
+
if (S2({ liked: n3 }), Fr({ postId: e6, liked: n3 }), !u2) {
|
|
1336
1337
|
g2.current = true;
|
|
1337
1338
|
try {
|
|
1338
|
-
await (
|
|
1339
|
+
await (n3 ? Tr(e6) : Er(e6));
|
|
1339
1340
|
} catch (t4) {
|
|
1340
|
-
S2({ liked: !
|
|
1341
|
+
S2({ liked: !n3 }), Fr({ postId: e6, liked: !n3 }), An(a2, t4, { feature: On.likes, action: n3 ? `like-post` : `unlike-post`, contexts: { likes: { postId: e6 } } });
|
|
1341
1342
|
} finally {
|
|
1342
1343
|
g2.current = false;
|
|
1343
1344
|
}
|
|
1344
1345
|
}
|
|
1345
|
-
}, [e6, u2,
|
|
1346
|
-
return { ...
|
|
1346
|
+
}, [e6, u2, a2, S2]);
|
|
1347
|
+
return { ...Ir(d2, t2), toggleLike: ee2, liveLikes: C2 };
|
|
1347
1348
|
};
|
|
1348
|
-
var
|
|
1349
|
-
var
|
|
1349
|
+
var Rr = I(`@wix/site-service-locale`);
|
|
1350
|
+
var zr = () => {
|
|
1350
1351
|
try {
|
|
1351
|
-
let { locale: e6, language: t2 } =
|
|
1352
|
+
let { locale: e6, language: t2 } = u(Rr);
|
|
1352
1353
|
return e6 || t2;
|
|
1353
1354
|
} catch {
|
|
1354
1355
|
return;
|
|
1355
1356
|
}
|
|
1356
1357
|
};
|
|
1357
|
-
var
|
|
1358
|
+
var Br = () => {
|
|
1358
1359
|
let e6 = /* @__PURE__ */ new Map();
|
|
1359
1360
|
return { getOrInsert: (t2, n2) => (e6.has(t2) || e6.set(t2, n2().finally(() => {
|
|
1360
1361
|
e6.delete(t2);
|
|
1361
1362
|
})), e6.get(t2)) };
|
|
1362
1363
|
};
|
|
1363
|
-
var
|
|
1364
|
+
var Vr = async (e6) => {
|
|
1364
1365
|
try {
|
|
1365
1366
|
let { default: t2 } = await e6();
|
|
1366
1367
|
return t2;
|
|
@@ -1368,9 +1369,9 @@ var Br = async (e6) => {
|
|
|
1368
1369
|
return;
|
|
1369
1370
|
}
|
|
1370
1371
|
};
|
|
1371
|
-
var
|
|
1372
|
-
let r2 =
|
|
1373
|
-
let [i3, a2] = await Promise.all([
|
|
1372
|
+
var Hr = ({ isDev: e6, loadMessages: t2, loadDevMessages: n2 }) => {
|
|
1373
|
+
let r2 = Br(), i2 = async (r3) => {
|
|
1374
|
+
let [i3, a2] = await Promise.all([Vr(() => t2(r3)), !e6 || !n2 ? void 0 : Vr(() => n2(r3))]);
|
|
1374
1375
|
if (i3 && a2) return { ...i3, ...a2 };
|
|
1375
1376
|
if (i3) return i3;
|
|
1376
1377
|
if (a2) return a2;
|
|
@@ -1385,25 +1386,25 @@ var z = () => {
|
|
|
1385
1386
|
});
|
|
1386
1387
|
return n2.resolve = e6, n2.reject = t2, n2;
|
|
1387
1388
|
};
|
|
1388
|
-
var
|
|
1389
|
-
var
|
|
1389
|
+
var Ur = (e6) => e6 == null ? `` : String(e6);
|
|
1390
|
+
var Wr = (e6, t2, n2) => {
|
|
1390
1391
|
e6.forEach((e7) => {
|
|
1391
1392
|
t2[e7] && (n2[e7] = t2[e7]);
|
|
1392
1393
|
});
|
|
1393
1394
|
};
|
|
1394
|
-
var
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1395
|
+
var Gr = /###/g;
|
|
1396
|
+
var Kr = (e6) => e6 && e6.includes(`###`) ? e6.replace(Gr, `.`) : e6;
|
|
1397
|
+
var qr = (e6) => !e6 || R(e6);
|
|
1397
1398
|
var B = (e6, t2, n2) => {
|
|
1398
1399
|
let r2 = R(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
1399
1400
|
for (; i2 < r2.length - 1; ) {
|
|
1400
|
-
if (
|
|
1401
|
-
let t3 =
|
|
1401
|
+
if (qr(e6)) return {};
|
|
1402
|
+
let t3 = Kr(r2[i2]);
|
|
1402
1403
|
!e6[t3] && n2 && (e6[t3] = new n2()), e6 = Object.prototype.hasOwnProperty.call(e6, t3) ? e6[t3] : {}, ++i2;
|
|
1403
1404
|
}
|
|
1404
|
-
return
|
|
1405
|
+
return qr(e6) ? {} : { obj: e6, k: Kr(r2[i2]) };
|
|
1405
1406
|
};
|
|
1406
|
-
var
|
|
1407
|
+
var Jr = (e6, t2, n2) => {
|
|
1407
1408
|
let { obj: r2, k: i2 } = B(e6, t2, Object);
|
|
1408
1409
|
if (r2 !== void 0 || t2.length === 1) {
|
|
1409
1410
|
r2[i2] = n2;
|
|
@@ -1413,7 +1414,7 @@ var qr = (e6, t2, n2) => {
|
|
|
1413
1414
|
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);
|
|
1414
1415
|
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
1415
1416
|
};
|
|
1416
|
-
var
|
|
1417
|
+
var Yr = (e6, t2, n2, r2) => {
|
|
1417
1418
|
let { obj: i2, k: a2 } = B(e6, t2, Object);
|
|
1418
1419
|
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
1419
1420
|
};
|
|
@@ -1421,18 +1422,18 @@ var V = (e6, t2) => {
|
|
|
1421
1422
|
let { obj: n2, k: r2 } = B(e6, t2);
|
|
1422
1423
|
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
1423
1424
|
};
|
|
1424
|
-
var
|
|
1425
|
+
var Xr = (e6, t2, n2) => {
|
|
1425
1426
|
let r2 = V(e6, n2);
|
|
1426
1427
|
return r2 === void 0 ? V(t2, n2) : r2;
|
|
1427
1428
|
};
|
|
1428
|
-
var
|
|
1429
|
-
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]) :
|
|
1429
|
+
var Zr = (e6, t2, n2) => {
|
|
1430
|
+
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]);
|
|
1430
1431
|
return e6;
|
|
1431
1432
|
};
|
|
1432
1433
|
var H = (e6) => e6.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
1433
|
-
var
|
|
1434
|
-
var
|
|
1435
|
-
var
|
|
1434
|
+
var Qr = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
1435
|
+
var $r = (e6) => R(e6) ? e6.replace(/[&<>"'\/]/g, (e7) => Qr[e7]) : e6;
|
|
1436
|
+
var ei = class {
|
|
1436
1437
|
constructor(e6) {
|
|
1437
1438
|
this.capacity = e6, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1438
1439
|
}
|
|
@@ -1443,20 +1444,20 @@ var $r = class {
|
|
|
1443
1444
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e6, n2), this.regExpQueue.push(e6), n2;
|
|
1444
1445
|
}
|
|
1445
1446
|
};
|
|
1446
|
-
var
|
|
1447
|
-
var
|
|
1448
|
-
var
|
|
1447
|
+
var ti = [` `, `,`, `?`, `!`, `;`];
|
|
1448
|
+
var ni = new ei(20);
|
|
1449
|
+
var ri = (e6, t2, n2) => {
|
|
1449
1450
|
t2 ||= ``, n2 ||= ``;
|
|
1450
|
-
let r2 =
|
|
1451
|
+
let r2 = ti.filter((e7) => !t2.includes(e7) && !n2.includes(e7));
|
|
1451
1452
|
if (r2.length === 0) return true;
|
|
1452
|
-
let i2 =
|
|
1453
|
+
let i2 = ni.getRegExp(`(${r2.map((e7) => e7 === `?` ? `\\?` : e7).join(`|`)})`), a2 = !i2.test(e6);
|
|
1453
1454
|
if (!a2) {
|
|
1454
1455
|
let t3 = e6.indexOf(n2);
|
|
1455
1456
|
t3 > 0 && !i2.test(e6.substring(0, t3)) && (a2 = true);
|
|
1456
1457
|
}
|
|
1457
1458
|
return a2;
|
|
1458
1459
|
};
|
|
1459
|
-
var
|
|
1460
|
+
var ii = (e6, t2, n2 = `.`) => {
|
|
1460
1461
|
if (!e6) return;
|
|
1461
1462
|
if (e6[t2]) return Object.prototype.hasOwnProperty.call(e6, t2) ? e6[t2] : void 0;
|
|
1462
1463
|
let r2 = t2.split(n2), i2 = e6;
|
|
@@ -1473,7 +1474,7 @@ var ri = (e6, t2, n2 = `.`) => {
|
|
|
1473
1474
|
return i2;
|
|
1474
1475
|
};
|
|
1475
1476
|
var U = (e6) => e6?.replace(/_/g, `-`);
|
|
1476
|
-
var
|
|
1477
|
+
var ai = { type: `logger`, log(e6) {
|
|
1477
1478
|
this.output(`log`, e6);
|
|
1478
1479
|
}, warn(e6) {
|
|
1479
1480
|
this.output(`warn`, e6);
|
|
@@ -1487,7 +1488,7 @@ var W = new class e2 {
|
|
|
1487
1488
|
this.init(e6, t2);
|
|
1488
1489
|
}
|
|
1489
1490
|
init(e6, t2 = {}) {
|
|
1490
|
-
this.prefix = t2.prefix || `i18next:`, this.logger = e6 ||
|
|
1491
|
+
this.prefix = t2.prefix || `i18next:`, this.logger = e6 || ai, this.options = t2, this.debug = t2.debug;
|
|
1491
1492
|
}
|
|
1492
1493
|
log(...e6) {
|
|
1493
1494
|
return this.forward(e6, `log`, ``, true);
|
|
@@ -1539,8 +1540,8 @@ var G = class {
|
|
|
1539
1540
|
});
|
|
1540
1541
|
}
|
|
1541
1542
|
};
|
|
1542
|
-
var
|
|
1543
|
-
var
|
|
1543
|
+
var oi = /* @__PURE__ */ new WeakSet();
|
|
1544
|
+
var si = class extends G {
|
|
1544
1545
|
constructor(e6, t2 = { ns: [`translation`], defaultNS: `translation` }) {
|
|
1545
1546
|
super(), this.data = e6 || {}, this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
|
|
1546
1547
|
}
|
|
@@ -1555,11 +1556,11 @@ var oi = class extends G {
|
|
|
1555
1556
|
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
1556
1557
|
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)));
|
|
1557
1558
|
let s2 = V(this.data, o2);
|
|
1558
|
-
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !R(n2) ? s2 :
|
|
1559
|
+
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);
|
|
1559
1560
|
}
|
|
1560
1561
|
addResource(e6, t2, n2, r2, i2 = { silent: false }) {
|
|
1561
1562
|
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e6, t2];
|
|
1562
|
-
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e6.includes(`.`) && (o2 = e6.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2),
|
|
1563
|
+
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);
|
|
1563
1564
|
}
|
|
1564
1565
|
addResources(e6, t2, n2, r2 = { silent: false }) {
|
|
1565
1566
|
for (let r3 in n2) (R(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e6, t2, r3, n2[r3], { silent: true });
|
|
@@ -1569,7 +1570,7 @@ var oi = class extends G {
|
|
|
1569
1570
|
let o2 = [e6, t2];
|
|
1570
1571
|
e6.includes(`.`) && (o2 = e6.split(`.`), r2 = n2, n2 = t2, t2 = o2[1]), this.addNamespaces(t2);
|
|
1571
1572
|
let s2 = V(this.data, o2) || {};
|
|
1572
|
-
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ?
|
|
1573
|
+
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);
|
|
1573
1574
|
}
|
|
1574
1575
|
removeResourceBundle(e6, t2) {
|
|
1575
1576
|
this.hasResourceBundle(e6, t2) && delete this.data[e6][t2], this.removeNamespaces(t2), this.emit(`removed`, e6, t2);
|
|
@@ -1587,37 +1588,37 @@ var oi = class extends G {
|
|
|
1587
1588
|
let t2 = this.getDataByLanguage(e6);
|
|
1588
1589
|
return !!(t2 && Object.keys(t2) || []).find((e7) => {
|
|
1589
1590
|
let n2 = t2[e7];
|
|
1590
|
-
return
|
|
1591
|
+
return oi.has(n2) ? true : !n2 || Object.keys(n2).length === 0 ? false : (typeof n2 == `object` && oi.add(n2), true);
|
|
1591
1592
|
});
|
|
1592
1593
|
}
|
|
1593
1594
|
toJSON() {
|
|
1594
1595
|
return this.data;
|
|
1595
1596
|
}
|
|
1596
1597
|
};
|
|
1597
|
-
var
|
|
1598
|
+
var ci = { processors: {}, addPostProcessor(e6) {
|
|
1598
1599
|
this.processors[e6.name] = e6;
|
|
1599
1600
|
}, handle(e6, t2, n2, r2, i2) {
|
|
1600
1601
|
return e6.forEach((e7) => {
|
|
1601
1602
|
t2 = this.processors[e7]?.process(t2, n2, r2, i2) ?? t2;
|
|
1602
1603
|
}), t2;
|
|
1603
1604
|
} };
|
|
1604
|
-
var
|
|
1605
|
-
function
|
|
1605
|
+
var li = Symbol(`i18next/PATH_KEY`);
|
|
1606
|
+
function ui() {
|
|
1606
1607
|
let e6 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1607
|
-
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 ===
|
|
1608
|
+
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;
|
|
1608
1609
|
}
|
|
1609
1610
|
function K(e6, t2) {
|
|
1610
|
-
let { [
|
|
1611
|
+
let { [li]: n2 } = e6(ui()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`, a2 = t2?.enableSelector === `strict`;
|
|
1611
1612
|
if (n2.length > 1 && i2) {
|
|
1612
1613
|
let e7 = t2?.ns, o2 = a2 ? Array.isArray(e7) ? e7 : e7 ? [e7] : null : Array.isArray(e7) ? e7 : null;
|
|
1613
1614
|
if (o2 && (a2 ? o2 : o2.length > 1 ? o2.slice(1) : []).includes(n2[0])) return `${n2[0]}${i2}${n2.slice(1).join(r2)}`;
|
|
1614
1615
|
}
|
|
1615
1616
|
return n2.join(r2);
|
|
1616
1617
|
}
|
|
1617
|
-
var
|
|
1618
|
-
var
|
|
1618
|
+
var di = (e6) => !R(e6) && typeof e6 != `boolean` && typeof e6 != `number`;
|
|
1619
|
+
var fi = class e3 extends G {
|
|
1619
1620
|
constructor(e6, t2 = {}) {
|
|
1620
|
-
super(),
|
|
1621
|
+
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 = {};
|
|
1621
1622
|
}
|
|
1622
1623
|
changeLanguage(e6) {
|
|
1623
1624
|
e6 && (this.language = e6);
|
|
@@ -1627,13 +1628,13 @@ var di = class e3 extends G {
|
|
|
1627
1628
|
if (e6 == null) return false;
|
|
1628
1629
|
let r2 = this.resolve(e6, n2);
|
|
1629
1630
|
if (r2?.res === void 0) return false;
|
|
1630
|
-
let i2 =
|
|
1631
|
+
let i2 = di(r2.res);
|
|
1631
1632
|
return !(n2.returnObjects === false && i2);
|
|
1632
1633
|
}
|
|
1633
1634
|
extractFromKey(e6, t2) {
|
|
1634
1635
|
let n2 = t2.nsSeparator === void 0 ? this.options.nsSeparator : t2.nsSeparator;
|
|
1635
1636
|
n2 === void 0 && (n2 = `:`);
|
|
1636
|
-
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 && !
|
|
1637
|
+
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);
|
|
1637
1638
|
if (a2 && !o2) {
|
|
1638
1639
|
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
1639
1640
|
if (t3 && t3.length > 0) return { key: e6, namespaces: R(i2) ? [i2] : i2 };
|
|
@@ -1652,7 +1653,7 @@ var di = class e3 extends G {
|
|
|
1652
1653
|
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;
|
|
1653
1654
|
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;
|
|
1654
1655
|
y2 && !m2 && x2 && (T2 = w2);
|
|
1655
|
-
let te2 =
|
|
1656
|
+
let te2 = di(T2), ne2 = Object.prototype.toString.apply(T2);
|
|
1656
1657
|
if (y2 && T2 && te2 && !_2.includes(ne2) && !(R(v2) && Array.isArray(T2))) {
|
|
1657
1658
|
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
1658
1659
|
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
@@ -1663,7 +1664,7 @@ var di = class e3 extends G {
|
|
|
1663
1664
|
let e6 = Array.isArray(T2), t3 = e6 ? [] : {}, n3 = e6 ? g2 : h2;
|
|
1664
1665
|
for (let e7 in T2) if (Object.prototype.hasOwnProperty.call(T2, e7)) {
|
|
1665
1666
|
let r3 = `${n3}${o2}${e7}`;
|
|
1666
|
-
t3[e7] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue:
|
|
1667
|
+
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]);
|
|
1667
1668
|
}
|
|
1668
1669
|
m2 = t3;
|
|
1669
1670
|
}
|
|
@@ -1712,7 +1713,7 @@ var di = class e3 extends G {
|
|
|
1712
1713
|
!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();
|
|
1713
1714
|
}
|
|
1714
1715
|
let a2 = n2.postProcess || this.options.postProcess, o2 = R(a2) ? [a2] : a2;
|
|
1715
|
-
return e6 != null && o2?.length && n2.applyPostProcessor !== false && (e6 =
|
|
1716
|
+
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;
|
|
1716
1717
|
}
|
|
1717
1718
|
resolve(e6, t2 = {}) {
|
|
1718
1719
|
let n2, r2, i2, a2, o2;
|
|
@@ -1763,7 +1764,7 @@ var di = class e3 extends G {
|
|
|
1763
1764
|
return false;
|
|
1764
1765
|
}
|
|
1765
1766
|
};
|
|
1766
|
-
var
|
|
1767
|
+
var pi = class {
|
|
1767
1768
|
constructor(e6) {
|
|
1768
1769
|
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger = W.create(`languageUtils`), this.resolveHierarchyCache = {};
|
|
1769
1770
|
}
|
|
@@ -1837,9 +1838,9 @@ var fi = class {
|
|
|
1837
1838
|
}), s2 === null ? l2 : (this.resolveHierarchyCache[s2] = l2, l2.slice());
|
|
1838
1839
|
}
|
|
1839
1840
|
};
|
|
1840
|
-
var
|
|
1841
|
-
var
|
|
1842
|
-
var
|
|
1841
|
+
var mi = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
1842
|
+
var hi = { select: (e6) => e6 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1843
|
+
var gi = class {
|
|
1843
1844
|
constructor(e6, t2 = {}) {
|
|
1844
1845
|
this.languageUtils = e6, this.options = t2, this.logger = W.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1845
1846
|
}
|
|
@@ -1853,8 +1854,8 @@ var hi = class {
|
|
|
1853
1854
|
try {
|
|
1854
1855
|
a2 = new Intl.PluralRules(n2, { type: r2 });
|
|
1855
1856
|
} catch {
|
|
1856
|
-
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`),
|
|
1857
|
-
if (!e6.match(/-|_/)) return
|
|
1857
|
+
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`), hi;
|
|
1858
|
+
if (!e6.match(/-|_/)) return hi;
|
|
1858
1859
|
let n3 = this.languageUtils.getLanguagePartFromCode(e6);
|
|
1859
1860
|
a2 = this.getRule(n3, t2);
|
|
1860
1861
|
}
|
|
@@ -1869,26 +1870,26 @@ var hi = class {
|
|
|
1869
1870
|
}
|
|
1870
1871
|
getSuffixes(e6, t2 = {}) {
|
|
1871
1872
|
let n2 = this.getRule(e6, t2);
|
|
1872
|
-
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e7, t3) =>
|
|
1873
|
+
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}`) : [];
|
|
1873
1874
|
}
|
|
1874
1875
|
getSuffix(e6, t2, n2 = {}) {
|
|
1875
1876
|
let r2 = this.getRule(e6, n2);
|
|
1876
1877
|
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));
|
|
1877
1878
|
}
|
|
1878
1879
|
};
|
|
1879
|
-
var
|
|
1880
|
-
let a2 =
|
|
1881
|
-
return !a2 && i2 && R(n2) && (a2 =
|
|
1880
|
+
var _i = (e6, t2, n2, r2 = `.`, i2 = true) => {
|
|
1881
|
+
let a2 = Xr(e6, t2, n2);
|
|
1882
|
+
return !a2 && i2 && R(n2) && (a2 = ii(e6, n2, r2), a2 === void 0 && (a2 = ii(t2, n2, r2))), a2;
|
|
1882
1883
|
};
|
|
1883
|
-
var
|
|
1884
|
-
var
|
|
1884
|
+
var vi = (e6) => e6.replace(/\$/g, `$$$$`);
|
|
1885
|
+
var yi = class {
|
|
1885
1886
|
constructor(e6 = {}) {
|
|
1886
1887
|
this.logger = W.create(`interpolator`), this.options = e6, this.format = e6?.interpolation?.format || ((e7) => e7), this.init(e6);
|
|
1887
1888
|
}
|
|
1888
1889
|
init(e6 = {}) {
|
|
1889
1890
|
e6.interpolation ||= { escapeValue: true };
|
|
1890
1891
|
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;
|
|
1891
|
-
this.escape = t2 === void 0 ?
|
|
1892
|
+
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();
|
|
1892
1893
|
}
|
|
1893
1894
|
reset() {
|
|
1894
1895
|
this.options && this.init(this.options);
|
|
@@ -1900,11 +1901,11 @@ var vi = class {
|
|
|
1900
1901
|
interpolate(e6, t2, n2, r2) {
|
|
1901
1902
|
let i2, a2, o2, s2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c2 = (e7) => {
|
|
1902
1903
|
if (!e7.includes(this.formatSeparator)) {
|
|
1903
|
-
let i4 =
|
|
1904
|
+
let i4 = _i(t2, s2, e7, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1904
1905
|
return this.alwaysFormat ? this.format(i4, void 0, n2, { ...r2, ...t2, interpolationkey: e7 }) : i4;
|
|
1905
1906
|
}
|
|
1906
1907
|
let i3 = e7.split(this.formatSeparator), a3 = i3.shift().trim(), o3 = i3.join(this.formatSeparator).trim();
|
|
1907
|
-
return this.format(
|
|
1908
|
+
return this.format(_i(t2, s2, a3, this.options.keySeparator, this.options.ignoreJSONStructure), o3, n2, { ...r2, ...t2, interpolationkey: a3 });
|
|
1908
1909
|
};
|
|
1909
1910
|
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.`);
|
|
1910
1911
|
let l2 = r2?.missingInterpolationHandler || this.options.missingInterpolationHandler, u2 = r2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r2.interpolation.skipOnVariables;
|
|
@@ -1920,9 +1921,9 @@ var vi = class {
|
|
|
1920
1921
|
a2 = i2[0];
|
|
1921
1922
|
continue;
|
|
1922
1923
|
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e6}`), a2 = ``;
|
|
1923
|
-
} else !R(a2) && !this.useRawValueToEscape && (a2 =
|
|
1924
|
+
} else !R(a2) && !this.useRawValueToEscape && (a2 = Ur(a2));
|
|
1924
1925
|
let s3 = t3.safeValue(a2);
|
|
1925
|
-
if (e6 = e6.replace(i2[0],
|
|
1926
|
+
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;
|
|
1926
1927
|
}
|
|
1927
1928
|
}), e6;
|
|
1928
1929
|
}
|
|
@@ -1946,12 +1947,12 @@ var vi = class {
|
|
|
1946
1947
|
a2 = { ...n2 }, a2 = a2.replace && !R(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1947
1948
|
let d2 = /{.*}/s.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1948
1949
|
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;
|
|
1949
|
-
R(i2) || (i2 =
|
|
1950
|
+
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;
|
|
1950
1951
|
}
|
|
1951
1952
|
return l2 ? c2 + e6.slice(l2) : e6;
|
|
1952
1953
|
}
|
|
1953
1954
|
};
|
|
1954
|
-
var
|
|
1955
|
+
var bi = (e6) => {
|
|
1955
1956
|
let t2 = e6.toLowerCase().trim(), n2 = {};
|
|
1956
1957
|
if (e6.includes(`(`)) {
|
|
1957
1958
|
let r2 = e6.split(`(`);
|
|
@@ -1966,7 +1967,7 @@ var yi = (e6) => {
|
|
|
1966
1967
|
}
|
|
1967
1968
|
return { formatName: t2, formatOptions: n2 };
|
|
1968
1969
|
};
|
|
1969
|
-
var
|
|
1970
|
+
var xi = (e6) => {
|
|
1970
1971
|
let t2 = {};
|
|
1971
1972
|
return (n2, r2, i2) => {
|
|
1972
1973
|
let a2 = i2;
|
|
@@ -1975,14 +1976,14 @@ var bi = (e6) => {
|
|
|
1975
1976
|
return s2 || (s2 = e6(U(r2), i2), t2[o2] = s2), s2(n2);
|
|
1976
1977
|
};
|
|
1977
1978
|
};
|
|
1978
|
-
var
|
|
1979
|
-
var
|
|
1979
|
+
var Si = (e6) => (t2, n2, r2) => e6(U(n2), r2)(t2);
|
|
1980
|
+
var Ci = class {
|
|
1980
1981
|
constructor(e6 = {}) {
|
|
1981
1982
|
this.logger = W.create(`formatter`), this.options = e6, this.init(e6);
|
|
1982
1983
|
}
|
|
1983
1984
|
init(e6, t2 = { interpolation: {} }) {
|
|
1984
1985
|
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
1985
|
-
let n2 = t2.cacheInBuiltFormats ?
|
|
1986
|
+
let n2 = t2.cacheInBuiltFormats ? xi : Si;
|
|
1986
1987
|
this.formats = { number: n2((e7, t3) => {
|
|
1987
1988
|
let n3 = new Intl.NumberFormat(e7, { ...t3 });
|
|
1988
1989
|
return (e8) => n3.format(e8);
|
|
@@ -2004,7 +2005,7 @@ var Si = class {
|
|
|
2004
2005
|
this.formats[e6.toLowerCase().trim()] = t2;
|
|
2005
2006
|
}
|
|
2006
2007
|
addCached(e6, t2) {
|
|
2007
|
-
this.formats[e6.toLowerCase().trim()] =
|
|
2008
|
+
this.formats[e6.toLowerCase().trim()] = xi(t2);
|
|
2008
2009
|
}
|
|
2009
2010
|
format(e6, t2, n2, r2 = {}) {
|
|
2010
2011
|
if (!t2 || e6 == null) return e6;
|
|
@@ -2015,7 +2016,7 @@ var Si = class {
|
|
|
2015
2016
|
a2.push(t3);
|
|
2016
2017
|
}
|
|
2017
2018
|
return a2.reduce((e7, t3) => {
|
|
2018
|
-
let { formatName: i3, formatOptions: a3 } =
|
|
2019
|
+
let { formatName: i3, formatOptions: a3 } = bi(t3);
|
|
2019
2020
|
if (this.formats[i3]) {
|
|
2020
2021
|
let t4 = e7;
|
|
2021
2022
|
try {
|
|
@@ -2030,10 +2031,10 @@ var Si = class {
|
|
|
2030
2031
|
}, e6);
|
|
2031
2032
|
}
|
|
2032
2033
|
};
|
|
2033
|
-
var
|
|
2034
|
+
var wi = (e6, t2) => {
|
|
2034
2035
|
e6.pending[t2] !== void 0 && (delete e6.pending[t2], e6.pendingCount--);
|
|
2035
2036
|
};
|
|
2036
|
-
var
|
|
2037
|
+
var Ti = class extends G {
|
|
2037
2038
|
constructor(e6, t2, n2, r2 = {}) {
|
|
2038
2039
|
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);
|
|
2039
2040
|
}
|
|
@@ -2052,7 +2053,7 @@ var wi = class extends G {
|
|
|
2052
2053
|
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);
|
|
2053
2054
|
let o2 = {};
|
|
2054
2055
|
this.queue.forEach((n3) => {
|
|
2055
|
-
|
|
2056
|
+
Yr(n3.loaded, [i2], a2), wi(n3, e6), t2 && n3.errors.push(t2), n3.pendingCount === 0 && !n3.done && (Object.keys(n3.loaded).forEach((e7) => {
|
|
2056
2057
|
o2[e7] || (o2[e7] = {});
|
|
2057
2058
|
let t3 = n3.loaded[e7];
|
|
2058
2059
|
t3.length && t3.forEach((t4) => {
|
|
@@ -2124,7 +2125,7 @@ var wi = class extends G {
|
|
|
2124
2125
|
}
|
|
2125
2126
|
}
|
|
2126
2127
|
};
|
|
2127
|
-
var
|
|
2128
|
+
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) => {
|
|
2128
2129
|
let t2 = {};
|
|
2129
2130
|
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`) {
|
|
2130
2131
|
let n2 = e6[3] || e6[2];
|
|
@@ -2134,17 +2135,17 @@ var Ti = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS:
|
|
|
2134
2135
|
}
|
|
2135
2136
|
return t2;
|
|
2136
2137
|
}, interpolation: { escapeValue: true, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
2137
|
-
var
|
|
2138
|
+
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);
|
|
2138
2139
|
var q = () => {
|
|
2139
2140
|
};
|
|
2140
|
-
var
|
|
2141
|
+
var Oi = (e6) => {
|
|
2141
2142
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e6)).forEach((t2) => {
|
|
2142
2143
|
typeof e6[t2] == `function` && (e6[t2] = e6[t2].bind(e6));
|
|
2143
2144
|
});
|
|
2144
2145
|
};
|
|
2145
2146
|
var J = class e4 extends G {
|
|
2146
2147
|
constructor(e6 = {}, t2) {
|
|
2147
|
-
if (super(), this.options =
|
|
2148
|
+
if (super(), this.options = Di(e6), this.services = {}, this.logger = W, this.modules = { external: [] }, Oi(this), t2 && !this.isInitialized && !e6.isClone) {
|
|
2148
2149
|
if (!this.options.initAsync) return this.init(e6, t2), this;
|
|
2149
2150
|
setTimeout(() => {
|
|
2150
2151
|
this.init(e6, t2);
|
|
@@ -2153,19 +2154,19 @@ var J = class e4 extends G {
|
|
|
2153
2154
|
}
|
|
2154
2155
|
init(e6 = {}, t2) {
|
|
2155
2156
|
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]));
|
|
2156
|
-
let n2 =
|
|
2157
|
-
this.options = { ...n2, ...this.options, ...
|
|
2157
|
+
let n2 = Ei();
|
|
2158
|
+
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);
|
|
2158
2159
|
let r2 = (e7) => e7 ? typeof e7 == `function` ? new e7() : e7 : null;
|
|
2159
2160
|
if (!this.options.isClone) {
|
|
2160
2161
|
this.modules.logger ? W.init(r2(this.modules.logger), this.options) : W.init(null, this.options);
|
|
2161
2162
|
let e7;
|
|
2162
|
-
e7 = this.modules.formatter ? this.modules.formatter :
|
|
2163
|
-
let t3 = new
|
|
2164
|
-
this.store = new
|
|
2163
|
+
e7 = this.modules.formatter ? this.modules.formatter : Ci;
|
|
2164
|
+
let t3 = new pi(this.options);
|
|
2165
|
+
this.store = new si(this.options.resources, this.options);
|
|
2165
2166
|
let n3 = this.services;
|
|
2166
|
-
n3.logger = W, n3.resourceStore = this.store, n3.languageUtils = t3, n3.pluralResolver = new
|
|
2167
|
+
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) => {
|
|
2167
2168
|
this.emit(e8, ...t4);
|
|
2168
|
-
}), 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
|
|
2169
|
+
}), 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) => {
|
|
2169
2170
|
this.emit(e8, ...t4);
|
|
2170
2171
|
}), this.modules.external.forEach((e8) => {
|
|
2171
2172
|
e8.init && e8.init(this);
|
|
@@ -2212,7 +2213,7 @@ var J = class e4 extends G {
|
|
|
2212
2213
|
use(e6) {
|
|
2213
2214
|
if (!e6) throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
|
|
2214
2215
|
if (!e6.type) throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);
|
|
2215
|
-
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` &&
|
|
2216
|
+
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;
|
|
2216
2217
|
}
|
|
2217
2218
|
setResolvedLanguage(e6) {
|
|
2218
2219
|
if (e6 && this.languages && ![`cimode`, `dev`].includes(e6)) {
|
|
@@ -2306,7 +2307,7 @@ var J = class e4 extends G {
|
|
|
2306
2307
|
}
|
|
2307
2308
|
} catch {
|
|
2308
2309
|
}
|
|
2309
|
-
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
|
|
2310
|
+
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());
|
|
2310
2311
|
return e6.toLowerCase().indexOf(`-latn`) > 1 ? `ltr` : t2.includes(n2.getLanguagePartFromCode(e6)) || e6.toLowerCase().indexOf(`-arab`) > 1 ? `rtl` : `ltr`;
|
|
2311
2312
|
}
|
|
2312
2313
|
static createInstance(t2 = {}, n2) {
|
|
@@ -2319,11 +2320,11 @@ var J = class e4 extends G {
|
|
|
2319
2320
|
let i2 = { ...this.options, ...t2, isClone: true }, a2 = new e4(i2);
|
|
2320
2321
|
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e6) => {
|
|
2321
2322
|
a2[e6] = this[e6];
|
|
2322
|
-
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new
|
|
2323
|
-
let e6 = { ...
|
|
2324
|
-
a2.services.interpolator = new
|
|
2323
|
+
}), 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) {
|
|
2324
|
+
let e6 = { ...Ei().interpolation, ...this.options.interpolation, ...t2.interpolation }, n3 = { ...i2, interpolation: e6 };
|
|
2325
|
+
a2.services.interpolator = new yi(n3);
|
|
2325
2326
|
}
|
|
2326
|
-
return a2.translator = new
|
|
2327
|
+
return a2.translator = new fi(a2.services, i2), a2.translator.on(`*`, (e6, ...t3) => {
|
|
2327
2328
|
a2.emit(e6, ...t3);
|
|
2328
2329
|
}), a2.init(i2, n2), a2.translator.options = i2, a2.translator.backendConnector.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, a2;
|
|
2329
2330
|
}
|
|
@@ -2332,7 +2333,7 @@ var J = class e4 extends G {
|
|
|
2332
2333
|
}
|
|
2333
2334
|
}.createInstance();
|
|
2334
2335
|
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;
|
|
2335
|
-
var
|
|
2336
|
+
var ki = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 = false, disableAutoInit: i2 = false, bindI18n: a2 }, { icu: o2 } = {}) => {
|
|
2336
2337
|
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 = J.createInstance(i2 ? s2 : void 0);
|
|
2337
2338
|
return o2 && c2.use(o2), t2 && c2.use({ type: `backend`, read: async (e7, n3, r3) => {
|
|
2338
2339
|
try {
|
|
@@ -2342,8 +2343,8 @@ var Oi = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 =
|
|
|
2342
2343
|
}
|
|
2343
2344
|
} }), n2 && (s2.resources = { [e6]: { translation: n2 } }), i2 || c2.init(s2), c2;
|
|
2344
2345
|
};
|
|
2345
|
-
var
|
|
2346
|
-
function
|
|
2346
|
+
var Ai = [`__proto__`, `constructor`, `prototype`];
|
|
2347
|
+
function ji(e6, t2, n2) {
|
|
2347
2348
|
function r2(e7) {
|
|
2348
2349
|
return e7 && e7.indexOf(`###`) > -1 ? e7.replace(/###/g, `.`) : e7;
|
|
2349
2350
|
}
|
|
@@ -2353,64 +2354,64 @@ function Ai(e6, t2, n2) {
|
|
|
2353
2354
|
for (var a2 = typeof t2 == `string` ? t2.split(`.`) : [].concat(t2); a2.length > 1; ) {
|
|
2354
2355
|
if (i2()) return {};
|
|
2355
2356
|
var o2 = r2(a2.shift());
|
|
2356
|
-
if (
|
|
2357
|
+
if (Ai.indexOf(o2) > -1) return {};
|
|
2357
2358
|
!e6[o2] && n2 && (e6[o2] = new n2()), e6 = e6[o2];
|
|
2358
2359
|
}
|
|
2359
2360
|
if (i2()) return {};
|
|
2360
2361
|
var s2 = r2(a2.shift());
|
|
2361
|
-
return
|
|
2362
|
+
return Ai.indexOf(s2) > -1 ? {} : { obj: e6, k: s2 };
|
|
2362
2363
|
}
|
|
2363
|
-
function
|
|
2364
|
-
var r2 =
|
|
2364
|
+
function Mi(e6, t2, n2) {
|
|
2365
|
+
var r2 = ji(e6, t2, Object), i2 = r2.obj, a2 = r2.k;
|
|
2365
2366
|
i2 !== void 0 && (i2[a2] = n2);
|
|
2366
2367
|
}
|
|
2367
|
-
function
|
|
2368
|
-
var n2 =
|
|
2368
|
+
function Ni(e6, t2) {
|
|
2369
|
+
var n2 = ji(e6, t2), r2 = n2.obj, i2 = n2.k;
|
|
2369
2370
|
if (r2) return r2[i2];
|
|
2370
2371
|
}
|
|
2371
|
-
var
|
|
2372
|
-
var
|
|
2373
|
-
var
|
|
2374
|
-
function
|
|
2375
|
-
return
|
|
2372
|
+
var Pi = [];
|
|
2373
|
+
var Fi = Pi.forEach;
|
|
2374
|
+
var Ii = Pi.slice;
|
|
2375
|
+
function Li(e6) {
|
|
2376
|
+
return Fi.call(Ii.call(arguments, 1), function(t2) {
|
|
2376
2377
|
if (t2) for (var n2 = 0, r2 = Object.keys(t2); n2 < r2.length; n2++) {
|
|
2377
2378
|
var i2 = r2[n2];
|
|
2378
|
-
|
|
2379
|
+
Ai.indexOf(i2) > -1 || e6[i2] === void 0 && (e6[i2] = t2[i2]);
|
|
2379
2380
|
}
|
|
2380
2381
|
}), e6;
|
|
2381
2382
|
}
|
|
2382
|
-
function
|
|
2383
|
-
let n2 = t2 && t2.cache ? t2.cache :
|
|
2384
|
-
return (t2 && t2.strategy ? t2.strategy :
|
|
2383
|
+
function Ri(e6, t2) {
|
|
2384
|
+
let n2 = t2 && t2.cache ? t2.cache : Ji, r2 = t2 && t2.serializer ? t2.serializer : Ki;
|
|
2385
|
+
return (t2 && t2.strategy ? t2.strategy : Ui)(e6, { cache: n2, serializer: r2 });
|
|
2385
2386
|
}
|
|
2386
|
-
function
|
|
2387
|
+
function zi(e6) {
|
|
2387
2388
|
return e6 == null || typeof e6 == `number` || typeof e6 == `boolean`;
|
|
2388
2389
|
}
|
|
2389
|
-
function
|
|
2390
|
-
let i2 =
|
|
2390
|
+
function Bi(e6, t2, n2, r2) {
|
|
2391
|
+
let i2 = zi(r2) ? r2 : n2(r2), a2 = t2.get(i2);
|
|
2391
2392
|
return a2 === void 0 && (a2 = e6.call(this, r2), t2.set(i2, a2)), a2;
|
|
2392
2393
|
}
|
|
2393
|
-
function
|
|
2394
|
+
function Vi(e6, t2, n2) {
|
|
2394
2395
|
let r2 = Array.prototype.slice.call(arguments, 3), i2 = n2(r2), a2 = t2.get(i2);
|
|
2395
2396
|
return a2 === void 0 && (a2 = e6.apply(this, r2), t2.set(i2, a2)), a2;
|
|
2396
2397
|
}
|
|
2397
|
-
function
|
|
2398
|
+
function Hi(e6, t2, n2, r2, i2) {
|
|
2398
2399
|
return n2.bind(t2, e6, r2, i2);
|
|
2399
2400
|
}
|
|
2400
|
-
function Hi(e6, t2) {
|
|
2401
|
-
let n2 = e6.length === 1 ? zi : Bi;
|
|
2402
|
-
return Vi(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2403
|
-
}
|
|
2404
2401
|
function Ui(e6, t2) {
|
|
2405
|
-
|
|
2402
|
+
let n2 = e6.length === 1 ? Bi : Vi;
|
|
2403
|
+
return Hi(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2406
2404
|
}
|
|
2407
2405
|
function Wi(e6, t2) {
|
|
2408
|
-
return
|
|
2406
|
+
return Hi(e6, this, Vi, t2.cache.create(), t2.serializer);
|
|
2409
2407
|
}
|
|
2410
|
-
|
|
2408
|
+
function Gi(e6, t2) {
|
|
2409
|
+
return Hi(e6, this, Bi, t2.cache.create(), t2.serializer);
|
|
2410
|
+
}
|
|
2411
|
+
var Ki = function() {
|
|
2411
2412
|
return JSON.stringify(arguments);
|
|
2412
2413
|
};
|
|
2413
|
-
var
|
|
2414
|
+
var qi = class {
|
|
2414
2415
|
constructor() {
|
|
2415
2416
|
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2416
2417
|
}
|
|
@@ -2421,14 +2422,14 @@ var Ki = class {
|
|
|
2421
2422
|
this.cache[e6] = t2;
|
|
2422
2423
|
}
|
|
2423
2424
|
};
|
|
2424
|
-
var
|
|
2425
|
-
return new
|
|
2425
|
+
var Ji = { create: function() {
|
|
2426
|
+
return new qi();
|
|
2426
2427
|
} };
|
|
2427
|
-
var
|
|
2428
|
-
var
|
|
2429
|
-
function
|
|
2428
|
+
var Yi = { variadic: Wi, monadic: Gi };
|
|
2429
|
+
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;
|
|
2430
|
+
function Zi(e6) {
|
|
2430
2431
|
let t2 = {};
|
|
2431
|
-
return e6.replace(
|
|
2432
|
+
return e6.replace(Xi, (e7) => {
|
|
2432
2433
|
let n2 = e7.length;
|
|
2433
2434
|
switch (e7[0]) {
|
|
2434
2435
|
case `G`:
|
|
@@ -2515,10 +2516,10 @@ function Xi(e6) {
|
|
|
2515
2516
|
return ``;
|
|
2516
2517
|
}), t2;
|
|
2517
2518
|
}
|
|
2518
|
-
var
|
|
2519
|
-
function
|
|
2519
|
+
var Qi = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
2520
|
+
function $i(e6) {
|
|
2520
2521
|
if (e6.length === 0) throw Error(`Number skeleton cannot be empty`);
|
|
2521
|
-
let t2 = e6.split(
|
|
2522
|
+
let t2 = e6.split(Qi).filter((e7) => e7.length > 0), n2 = [];
|
|
2522
2523
|
for (let e7 of t2) {
|
|
2523
2524
|
let t3 = e7.split(`/`);
|
|
2524
2525
|
if (t3.length === 0) throw Error(`Invalid number skeleton`);
|
|
@@ -2528,20 +2529,20 @@ function Qi(e6) {
|
|
|
2528
2529
|
}
|
|
2529
2530
|
return n2;
|
|
2530
2531
|
}
|
|
2531
|
-
function
|
|
2532
|
+
function ea(e6) {
|
|
2532
2533
|
return e6.replace(/^(.*?)-/, ``);
|
|
2533
2534
|
}
|
|
2534
|
-
var
|
|
2535
|
-
var
|
|
2536
|
-
var
|
|
2537
|
-
var
|
|
2538
|
-
function
|
|
2535
|
+
var ta = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
2536
|
+
var na = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
2537
|
+
var ra = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
2538
|
+
var ia = /^(0+)$/;
|
|
2539
|
+
function aa(e6) {
|
|
2539
2540
|
let t2 = {};
|
|
2540
|
-
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(
|
|
2541
|
+
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(na, function(e7, n2, r2) {
|
|
2541
2542
|
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), ``;
|
|
2542
2543
|
}), t2;
|
|
2543
2544
|
}
|
|
2544
|
-
function
|
|
2545
|
+
function oa(e6) {
|
|
2545
2546
|
switch (e6) {
|
|
2546
2547
|
case `sign-auto`:
|
|
2547
2548
|
return { signDisplay: `auto` };
|
|
@@ -2565,19 +2566,19 @@ function aa(e6) {
|
|
|
2565
2566
|
return { signDisplay: `never` };
|
|
2566
2567
|
}
|
|
2567
2568
|
}
|
|
2568
|
-
function
|
|
2569
|
+
function sa(e6) {
|
|
2569
2570
|
let t2;
|
|
2570
2571
|
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) {
|
|
2571
2572
|
let n2 = e6.slice(0, 2);
|
|
2572
|
-
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !
|
|
2573
|
+
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`);
|
|
2573
2574
|
t2.minimumIntegerDigits = e6.length;
|
|
2574
2575
|
}
|
|
2575
2576
|
return t2;
|
|
2576
2577
|
}
|
|
2577
|
-
function sa(e6) {
|
|
2578
|
-
return aa(e6) || {};
|
|
2579
|
-
}
|
|
2580
2578
|
function ca(e6) {
|
|
2579
|
+
return oa(e6) || {};
|
|
2580
|
+
}
|
|
2581
|
+
function la(e6) {
|
|
2581
2582
|
let t2 = {};
|
|
2582
2583
|
for (let n2 of e6) {
|
|
2583
2584
|
switch (n2.stem) {
|
|
@@ -2601,7 +2602,7 @@ function ca(e6) {
|
|
|
2601
2602
|
continue;
|
|
2602
2603
|
case `measure-unit`:
|
|
2603
2604
|
case `unit`:
|
|
2604
|
-
t2.style = `unit`, t2.unit =
|
|
2605
|
+
t2.style = `unit`, t2.unit = ea(n2.options[0]);
|
|
2605
2606
|
continue;
|
|
2606
2607
|
case `compact-short`:
|
|
2607
2608
|
case `K`:
|
|
@@ -2612,10 +2613,10 @@ function ca(e6) {
|
|
|
2612
2613
|
t2.notation = `compact`, t2.compactDisplay = `long`;
|
|
2613
2614
|
continue;
|
|
2614
2615
|
case `scientific`:
|
|
2615
|
-
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2616
|
+
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...ca(t3) }), {}) };
|
|
2616
2617
|
continue;
|
|
2617
2618
|
case `engineering`:
|
|
2618
|
-
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2619
|
+
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...ca(t3) }), {}) };
|
|
2619
2620
|
continue;
|
|
2620
2621
|
case `notation-simple`:
|
|
2621
2622
|
t2.notation = `standard`;
|
|
@@ -2658,7 +2659,7 @@ function ca(e6) {
|
|
|
2658
2659
|
continue;
|
|
2659
2660
|
case `integer-width`:
|
|
2660
2661
|
if (n2.options.length > 1) throw RangeError(`integer-width stems only accept a single optional option`);
|
|
2661
|
-
n2.options[0].replace(
|
|
2662
|
+
n2.options[0].replace(ra, function(e8, n3, r3, i2, a2, o2) {
|
|
2662
2663
|
if (n3) t2.minimumIntegerDigits = r3.length;
|
|
2663
2664
|
else if (i2 && a2) throw Error(`We currently do not support maximum integer digits`);
|
|
2664
2665
|
else if (o2) throw Error(`We currently do not support exact integer digits`);
|
|
@@ -2666,83 +2667,83 @@ function ca(e6) {
|
|
|
2666
2667
|
});
|
|
2667
2668
|
continue;
|
|
2668
2669
|
}
|
|
2669
|
-
if (
|
|
2670
|
+
if (ia.test(n2.stem)) {
|
|
2670
2671
|
t2.minimumIntegerDigits = n2.stem.length;
|
|
2671
2672
|
continue;
|
|
2672
2673
|
}
|
|
2673
|
-
if (
|
|
2674
|
+
if (ta.test(n2.stem)) {
|
|
2674
2675
|
if (n2.options.length > 1) throw RangeError(`Fraction-precision stems only accept a single optional option`);
|
|
2675
|
-
n2.stem.replace(
|
|
2676
|
+
n2.stem.replace(ta, function(e9, n3, r3, i2, a2, o2) {
|
|
2676
2677
|
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), ``;
|
|
2677
2678
|
});
|
|
2678
2679
|
let e8 = n2.options[0];
|
|
2679
|
-
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...
|
|
2680
|
+
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...aa(e8) });
|
|
2680
2681
|
continue;
|
|
2681
2682
|
}
|
|
2682
|
-
if (
|
|
2683
|
-
t2 = { ...t2, ...
|
|
2683
|
+
if (na.test(n2.stem)) {
|
|
2684
|
+
t2 = { ...t2, ...aa(n2.stem) };
|
|
2684
2685
|
continue;
|
|
2685
2686
|
}
|
|
2686
|
-
let e7 =
|
|
2687
|
+
let e7 = oa(n2.stem);
|
|
2687
2688
|
e7 && (t2 = { ...t2, ...e7 });
|
|
2688
|
-
let r2 =
|
|
2689
|
+
let r2 = sa(n2.stem);
|
|
2689
2690
|
r2 && (t2 = { ...t2, ...r2 });
|
|
2690
2691
|
}
|
|
2691
2692
|
return t2;
|
|
2692
2693
|
}
|
|
2693
|
-
var
|
|
2694
|
+
var ua = function(e6) {
|
|
2694
2695
|
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;
|
|
2695
2696
|
}({});
|
|
2696
|
-
function
|
|
2697
|
+
function da(e6) {
|
|
2697
2698
|
return e6.type === 0;
|
|
2698
2699
|
}
|
|
2699
|
-
function
|
|
2700
|
+
function fa(e6) {
|
|
2700
2701
|
return e6.type === 1;
|
|
2701
2702
|
}
|
|
2702
|
-
function
|
|
2703
|
+
function pa(e6) {
|
|
2703
2704
|
return e6.type === 2;
|
|
2704
2705
|
}
|
|
2705
|
-
function
|
|
2706
|
+
function ma(e6) {
|
|
2706
2707
|
return e6.type === 3;
|
|
2707
2708
|
}
|
|
2708
|
-
function
|
|
2709
|
+
function ha(e6) {
|
|
2709
2710
|
return e6.type === 4;
|
|
2710
2711
|
}
|
|
2711
|
-
function
|
|
2712
|
+
function ga(e6) {
|
|
2712
2713
|
return e6.type === 5;
|
|
2713
2714
|
}
|
|
2714
|
-
function
|
|
2715
|
+
function _a(e6) {
|
|
2715
2716
|
return e6.type === 6;
|
|
2716
2717
|
}
|
|
2717
|
-
function
|
|
2718
|
+
function va(e6) {
|
|
2718
2719
|
return e6.type === 7;
|
|
2719
2720
|
}
|
|
2720
|
-
function
|
|
2721
|
+
function ya(e6) {
|
|
2721
2722
|
return e6.type === 8;
|
|
2722
2723
|
}
|
|
2723
|
-
function
|
|
2724
|
+
function ba(e6) {
|
|
2724
2725
|
return !!(e6 && typeof e6 == `object` && e6.type === 0);
|
|
2725
2726
|
}
|
|
2726
|
-
function
|
|
2727
|
+
function xa(e6) {
|
|
2727
2728
|
return !!(e6 && typeof e6 == `object` && e6.type === 1);
|
|
2728
2729
|
}
|
|
2729
|
-
var
|
|
2730
|
+
var Sa = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
2730
2731
|
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`] };
|
|
2731
|
-
function
|
|
2732
|
+
function Ca(e6, t2) {
|
|
2732
2733
|
let n2 = ``;
|
|
2733
2734
|
for (let r2 = 0; r2 < e6.length; r2++) {
|
|
2734
2735
|
let i2 = e6.charAt(r2);
|
|
2735
2736
|
if (i2 === `j`) {
|
|
2736
2737
|
let a2 = 0;
|
|
2737
2738
|
for (; r2 + 1 < e6.length && e6.charAt(r2 + 1) === i2; ) a2++, r2++;
|
|
2738
|
-
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 =
|
|
2739
|
+
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 = wa(t2);
|
|
2739
2740
|
for ((c2 == `H` || c2 == `k`) && (s2 = 0); s2-- > 0; ) n2 += `a`;
|
|
2740
2741
|
for (; o2-- > 0; ) n2 = c2 + n2;
|
|
2741
2742
|
} else n2 += i2 === `J` ? `H` : i2;
|
|
2742
2743
|
}
|
|
2743
2744
|
return n2;
|
|
2744
2745
|
}
|
|
2745
|
-
function
|
|
2746
|
+
function wa(e6) {
|
|
2746
2747
|
let t2 = e6.hourCycle;
|
|
2747
2748
|
if (t2 === void 0) {
|
|
2748
2749
|
let n3 = e6;
|
|
@@ -2763,34 +2764,34 @@ function Ca(e6) {
|
|
|
2763
2764
|
let n2 = e6.language, r2;
|
|
2764
2765
|
return n2 !== `root` && (r2 = e6.maximize().region), (Y[`${n2}-${r2}`] || Y[r2 || ``] || Y[n2 || ``] || Y[`${n2}-001`] || Y[`001`])[0].charAt(0);
|
|
2765
2766
|
}
|
|
2766
|
-
var
|
|
2767
|
-
var
|
|
2767
|
+
var Ta = RegExp(`^${Sa.source}*`);
|
|
2768
|
+
var Ea = RegExp(`${Sa.source}*$`);
|
|
2768
2769
|
function X(e6, t2) {
|
|
2769
2770
|
return { start: e6, end: t2 };
|
|
2770
2771
|
}
|
|
2771
|
-
var
|
|
2772
|
-
var
|
|
2773
|
-
var
|
|
2774
|
-
var
|
|
2772
|
+
var Da = !!Object.fromEntries;
|
|
2773
|
+
var Oa = !!String.prototype.trimStart;
|
|
2774
|
+
var ka = !!String.prototype.trimEnd;
|
|
2775
|
+
var Aa = Da ? Object.fromEntries : function(e6) {
|
|
2775
2776
|
let t2 = {};
|
|
2776
2777
|
for (let [n2, r2] of e6) t2[n2] = r2;
|
|
2777
2778
|
return t2;
|
|
2778
2779
|
};
|
|
2779
|
-
var
|
|
2780
|
+
var ja = Oa ? function(e6) {
|
|
2780
2781
|
return e6.trimStart();
|
|
2781
2782
|
} : function(e6) {
|
|
2782
|
-
return e6.replace(
|
|
2783
|
+
return e6.replace(Ta, ``);
|
|
2783
2784
|
};
|
|
2784
|
-
var
|
|
2785
|
+
var Ma = ka ? function(e6) {
|
|
2785
2786
|
return e6.trimEnd();
|
|
2786
2787
|
} : function(e6) {
|
|
2787
|
-
return e6.replace(
|
|
2788
|
+
return e6.replace(Ea, ``);
|
|
2788
2789
|
};
|
|
2789
|
-
var
|
|
2790
|
-
function
|
|
2791
|
-
return
|
|
2790
|
+
var Na = RegExp(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`);
|
|
2791
|
+
function Pa(e6, t2) {
|
|
2792
|
+
return Na.lastIndex = t2, Na.exec(e6)[1] ?? ``;
|
|
2792
2793
|
}
|
|
2793
|
-
function
|
|
2794
|
+
function Fa(e6) {
|
|
2794
2795
|
if (e6.length === 0) return null;
|
|
2795
2796
|
let t2 = 1, n2 = 1;
|
|
2796
2797
|
for (let r2 = 0; r2 < e6.length; ) {
|
|
@@ -2811,7 +2812,7 @@ function Pa(e6) {
|
|
|
2811
2812
|
}
|
|
2812
2813
|
return { offset: e6.length, line: t2, column: n2 };
|
|
2813
2814
|
}
|
|
2814
|
-
var
|
|
2815
|
+
var Ia = class {
|
|
2815
2816
|
constructor(e6, t2 = {}) {
|
|
2816
2817
|
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;
|
|
2817
2818
|
}
|
|
@@ -2820,7 +2821,7 @@ var Fa = class {
|
|
|
2820
2821
|
if (this.message.length > 0) {
|
|
2821
2822
|
let e6 = this.message.charCodeAt(0);
|
|
2822
2823
|
if (e6 !== 35 && e6 !== 39 && e6 !== 60 && e6 !== 123 && e6 !== 125) {
|
|
2823
|
-
let e7 =
|
|
2824
|
+
let e7 = Fa(this.message);
|
|
2824
2825
|
if (e7) {
|
|
2825
2826
|
let t2 = this.clonePosition();
|
|
2826
2827
|
return this.position = e7, { val: [{ type: 0, value: this.message, location: X(t2, this.clonePosition()) }], err: null };
|
|
@@ -2844,7 +2845,7 @@ var Fa = class {
|
|
|
2844
2845
|
} else if (i2 === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
2845
2846
|
if (n2) break;
|
|
2846
2847
|
return this.error(26, X(this.clonePosition(), this.clonePosition()));
|
|
2847
|
-
} else if (i2 === 60 && !this.ignoreTag &&
|
|
2848
|
+
} else if (i2 === 60 && !this.ignoreTag && La(this.peek() || 0)) {
|
|
2848
2849
|
let n3 = this.parseTag(e6, t2);
|
|
2849
2850
|
if (n3.err) return n3;
|
|
2850
2851
|
r2.push(n3.val);
|
|
@@ -2866,7 +2867,7 @@ var Fa = class {
|
|
|
2866
2867
|
if (i2.err) return i2;
|
|
2867
2868
|
let a2 = i2.val, o2 = this.clonePosition();
|
|
2868
2869
|
if (this.bumpIf(`</`)) {
|
|
2869
|
-
if (this.isEOF() || !
|
|
2870
|
+
if (this.isEOF() || !La(this.char())) return this.error(23, X(o2, this.clonePosition()));
|
|
2870
2871
|
let e7 = this.clonePosition();
|
|
2871
2872
|
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()));
|
|
2872
2873
|
}
|
|
@@ -2876,7 +2877,7 @@ var Fa = class {
|
|
|
2876
2877
|
}
|
|
2877
2878
|
parseTagName() {
|
|
2878
2879
|
let e6 = this.offset();
|
|
2879
|
-
for (this.bump(); !this.isEOF() &&
|
|
2880
|
+
for (this.bump(); !this.isEOF() && za(this.char()); ) this.bump();
|
|
2880
2881
|
return this.message.slice(e6, this.offset());
|
|
2881
2882
|
}
|
|
2882
2883
|
parseLiteral(e6, t2) {
|
|
@@ -2900,7 +2901,7 @@ var Fa = class {
|
|
|
2900
2901
|
return { val: { type: 0, value: r2, location: i2 }, err: null };
|
|
2901
2902
|
}
|
|
2902
2903
|
tryParseLeftAngleBracket() {
|
|
2903
|
-
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !
|
|
2904
|
+
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !Ra(this.peek() || 0)) ? (this.bump(), `<`) : null;
|
|
2904
2905
|
}
|
|
2905
2906
|
tryParseQuote(e6) {
|
|
2906
2907
|
if (this.isEOF() || this.char() !== 39) return null;
|
|
@@ -2955,7 +2956,7 @@ var Fa = class {
|
|
|
2955
2956
|
}
|
|
2956
2957
|
}
|
|
2957
2958
|
parseIdentifierIfPossible() {
|
|
2958
|
-
let e6 = this.clonePosition(), t2 = this.offset(), n2 =
|
|
2959
|
+
let e6 = this.clonePosition(), t2 = this.offset(), n2 = Pa(this.message, t2), r2 = t2 + n2.length;
|
|
2959
2960
|
return this.bumpTo(r2), { value: n2, location: X(e6, this.clonePosition()) };
|
|
2960
2961
|
}
|
|
2961
2962
|
parseArgumentOptions(e6, t2, n2, r2) {
|
|
@@ -2972,7 +2973,7 @@ var Fa = class {
|
|
|
2972
2973
|
this.bumpSpace();
|
|
2973
2974
|
let t4 = this.clonePosition(), n3 = this.parseSimpleArgStyleIfPossible();
|
|
2974
2975
|
if (n3.err) return n3;
|
|
2975
|
-
let r3 =
|
|
2976
|
+
let r3 = Ma(n3.val);
|
|
2976
2977
|
if (r3.length === 0) return this.error(6, X(this.clonePosition(), this.clonePosition()));
|
|
2977
2978
|
e7 = { style: r3, styleLocation: X(t4, this.clonePosition()) };
|
|
2978
2979
|
}
|
|
@@ -2980,7 +2981,7 @@ var Fa = class {
|
|
|
2980
2981
|
if (t3.err) return t3;
|
|
2981
2982
|
let i3 = X(r2, this.clonePosition());
|
|
2982
2983
|
if (e7 && e7.style.startsWith(`::`)) {
|
|
2983
|
-
let t4 =
|
|
2984
|
+
let t4 = ja(e7.style.slice(2));
|
|
2984
2985
|
if (a2 === `number`) {
|
|
2985
2986
|
let r3 = this.parseNumberSkeletonFromString(t4, e7.styleLocation);
|
|
2986
2987
|
return r3.err ? r3 : { val: { type: 2, value: n2, location: i3, style: r3.val }, err: null };
|
|
@@ -2988,8 +2989,8 @@ var Fa = class {
|
|
|
2988
2989
|
{
|
|
2989
2990
|
if (t4.length === 0) return this.error(10, i3);
|
|
2990
2991
|
let r3 = t4;
|
|
2991
|
-
this.locale && (r3 =
|
|
2992
|
-
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ?
|
|
2992
|
+
this.locale && (r3 = Ca(t4, this.locale));
|
|
2993
|
+
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ? Zi(r3) : {} };
|
|
2993
2994
|
return { val: { type: a2 === `date` ? 3 : 4, value: n2, location: i3, style: o3 }, err: null };
|
|
2994
2995
|
}
|
|
2995
2996
|
}
|
|
@@ -3014,7 +3015,7 @@ var Fa = class {
|
|
|
3014
3015
|
let l2 = this.tryParseArgumentClose(r2);
|
|
3015
3016
|
if (l2.err) return l2;
|
|
3016
3017
|
let u2 = X(r2, this.clonePosition());
|
|
3017
|
-
return a2 === `select` ? { val: { type: 5, value: n2, options:
|
|
3018
|
+
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 };
|
|
3018
3019
|
}
|
|
3019
3020
|
default:
|
|
3020
3021
|
return this.error(5, X(i2, o2));
|
|
@@ -3048,11 +3049,11 @@ var Fa = class {
|
|
|
3048
3049
|
parseNumberSkeletonFromString(e6, t2) {
|
|
3049
3050
|
let n2 = [];
|
|
3050
3051
|
try {
|
|
3051
|
-
n2 =
|
|
3052
|
+
n2 = $i(e6);
|
|
3052
3053
|
} catch {
|
|
3053
3054
|
return this.error(7, t2);
|
|
3054
3055
|
}
|
|
3055
|
-
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ?
|
|
3056
|
+
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ? la(n2) : {} }, err: null };
|
|
3056
3057
|
}
|
|
3057
3058
|
tryParsePluralOrSelectOptions(e6, t2, n2, r2) {
|
|
3058
3059
|
let i2 = false, a2 = [], o2 = /* @__PURE__ */ new Set(), { value: s2, location: c2 } = r2;
|
|
@@ -3134,7 +3135,7 @@ var Fa = class {
|
|
|
3134
3135
|
}
|
|
3135
3136
|
}
|
|
3136
3137
|
bumpSpace() {
|
|
3137
|
-
for (; !this.isEOF() &&
|
|
3138
|
+
for (; !this.isEOF() && Ba(this.char()); ) this.bump();
|
|
3138
3139
|
}
|
|
3139
3140
|
peek() {
|
|
3140
3141
|
if (this.isEOF()) return null;
|
|
@@ -3142,34 +3143,34 @@ var Fa = class {
|
|
|
3142
3143
|
return this.message.charCodeAt(t2 + (e6 >= 65536 ? 2 : 1)) ?? null;
|
|
3143
3144
|
}
|
|
3144
3145
|
};
|
|
3145
|
-
function Ia(e6) {
|
|
3146
|
-
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
3147
|
-
}
|
|
3148
3146
|
function La(e6) {
|
|
3149
|
-
return
|
|
3147
|
+
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
3150
3148
|
}
|
|
3151
3149
|
function Ra(e6) {
|
|
3152
|
-
return e6
|
|
3150
|
+
return La(e6) || e6 === 47;
|
|
3153
3151
|
}
|
|
3154
3152
|
function za(e6) {
|
|
3155
|
-
return e6 >=
|
|
3153
|
+
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;
|
|
3156
3154
|
}
|
|
3157
3155
|
function Ba(e6) {
|
|
3156
|
+
return e6 >= 9 && e6 <= 13 || e6 === 32 || e6 === 133 || e6 >= 8206 && e6 <= 8207 || e6 === 8232 || e6 === 8233;
|
|
3157
|
+
}
|
|
3158
|
+
function Va(e6) {
|
|
3158
3159
|
e6.forEach((e7) => {
|
|
3159
|
-
if (delete e7.location,
|
|
3160
|
-
else
|
|
3160
|
+
if (delete e7.location, ga(e7) || _a(e7)) for (let t2 in e7.options) delete e7.options[t2].location, Va(e7.options[t2].value);
|
|
3161
|
+
else pa(e7) && ba(e7.style) || (ma(e7) || ha(e7)) && xa(e7.style) ? delete e7.style.location : ya(e7) && Va(e7.children);
|
|
3161
3162
|
});
|
|
3162
3163
|
}
|
|
3163
|
-
function
|
|
3164
|
+
function Ha(e6, t2 = {}) {
|
|
3164
3165
|
t2 = { shouldParseSkeletons: true, requiresOtherClause: true, ...t2 };
|
|
3165
|
-
let n2 = new
|
|
3166
|
+
let n2 = new Ia(e6, t2).parse();
|
|
3166
3167
|
if (n2.err) {
|
|
3167
|
-
let e7 = SyntaxError(
|
|
3168
|
+
let e7 = SyntaxError(ua[n2.err.kind]);
|
|
3168
3169
|
throw e7.location = n2.err.location, e7.originalMessage = n2.err.message, e7;
|
|
3169
3170
|
}
|
|
3170
|
-
return t2?.captureLocation ||
|
|
3171
|
+
return t2?.captureLocation || Va(n2.val), n2.val;
|
|
3171
3172
|
}
|
|
3172
|
-
var
|
|
3173
|
+
var Ua = class extends Error {
|
|
3173
3174
|
constructor(e6, t2, n2) {
|
|
3174
3175
|
super(e6), this.code = t2, this.originalMessage = n2;
|
|
3175
3176
|
}
|
|
@@ -3177,54 +3178,54 @@ var Ha = class extends Error {
|
|
|
3177
3178
|
return `[formatjs Error: ${this.code}] ${this.message}`;
|
|
3178
3179
|
}
|
|
3179
3180
|
};
|
|
3180
|
-
var
|
|
3181
|
+
var Wa = class extends Ua {
|
|
3181
3182
|
constructor(e6, t2, n2, r2) {
|
|
3182
3183
|
super(`Invalid values for "${e6}": "${t2}". Options are "${Object.keys(n2).join(`", "`)}"`, `INVALID_VALUE`, r2);
|
|
3183
3184
|
}
|
|
3184
3185
|
};
|
|
3185
|
-
var
|
|
3186
|
+
var Ga = class extends Ua {
|
|
3186
3187
|
constructor(e6, t2, n2) {
|
|
3187
3188
|
super(`Value for "${e6}" must be of type ${t2}`, `INVALID_VALUE`, n2);
|
|
3188
3189
|
}
|
|
3189
3190
|
};
|
|
3190
|
-
var
|
|
3191
|
+
var Ka = class extends Ua {
|
|
3191
3192
|
constructor(e6, t2) {
|
|
3192
3193
|
super(`The intl string context variable "${e6}" was not provided to the string "${t2}"`, `MISSING_VALUE`, t2);
|
|
3193
3194
|
}
|
|
3194
3195
|
};
|
|
3195
|
-
function
|
|
3196
|
+
function qa(e6) {
|
|
3196
3197
|
return e6.length < 2 ? e6 : e6.reduce((e7, t2) => {
|
|
3197
3198
|
let n2 = e7[e7.length - 1];
|
|
3198
3199
|
return !n2 || n2.type !== 0 || t2.type !== 0 ? e7.push(t2) : n2.value += t2.value, e7;
|
|
3199
3200
|
}, []);
|
|
3200
3201
|
}
|
|
3201
|
-
function
|
|
3202
|
+
function Ja(e6) {
|
|
3202
3203
|
return typeof e6 == `function`;
|
|
3203
3204
|
}
|
|
3204
|
-
function
|
|
3205
|
-
if (e6.length === 1 &&
|
|
3205
|
+
function Ya(e6, t2, n2, r2, i2, a2, o2) {
|
|
3206
|
+
if (e6.length === 1 && da(e6[0])) return [{ type: 0, value: e6[0].value }];
|
|
3206
3207
|
let s2 = [];
|
|
3207
3208
|
for (let c2 of e6) {
|
|
3208
|
-
if (
|
|
3209
|
+
if (da(c2)) {
|
|
3209
3210
|
s2.push({ type: 0, value: c2.value });
|
|
3210
3211
|
continue;
|
|
3211
3212
|
}
|
|
3212
|
-
if (
|
|
3213
|
+
if (va(c2)) {
|
|
3213
3214
|
typeof a2 == `number` && s2.push({ type: 0, value: n2.getNumberFormat(t2).format(a2) });
|
|
3214
3215
|
continue;
|
|
3215
3216
|
}
|
|
3216
3217
|
let { value: e7 } = c2;
|
|
3217
|
-
if (!(i2 && e7 in i2)) throw new
|
|
3218
|
+
if (!(i2 && e7 in i2)) throw new Ka(e7, o2);
|
|
3218
3219
|
let l2 = i2[e7];
|
|
3219
|
-
if (
|
|
3220
|
-
else if (
|
|
3221
|
-
let e8 = typeof c2.style == `string` ? r2.date[c2.style] :
|
|
3220
|
+
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 });
|
|
3221
|
+
else if (ma(c2)) {
|
|
3222
|
+
let e8 = typeof c2.style == `string` ? r2.date[c2.style] : xa(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3222
3223
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3223
|
-
} else if (
|
|
3224
|
-
let e8 = typeof c2.style == `string` ? r2.time[c2.style] :
|
|
3224
|
+
} else if (ha(c2)) {
|
|
3225
|
+
let e8 = typeof c2.style == `string` ? r2.time[c2.style] : xa(c2.style) ? c2.style.parsedOptions : r2.time.medium;
|
|
3225
3226
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
3226
|
-
} else if (
|
|
3227
|
-
let e8 = typeof c2.style == `string` ? r2.number[c2.style] :
|
|
3227
|
+
} else if (pa(c2)) {
|
|
3228
|
+
let e8 = typeof c2.style == `string` ? r2.number[c2.style] : ba(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3228
3229
|
if (e8 && e8.scale) {
|
|
3229
3230
|
let t3 = e8.scale || 1;
|
|
3230
3231
|
if (typeof l2 == `bigint`) {
|
|
@@ -3234,40 +3235,40 @@ function Ja(e6, t2, n2, r2, i2, a2, o2) {
|
|
|
3234
3235
|
}
|
|
3235
3236
|
s2.push({ type: 0, value: n2.getNumberFormat(t2, e8).format(l2) });
|
|
3236
3237
|
} else {
|
|
3237
|
-
if (
|
|
3238
|
+
if (ya(c2)) {
|
|
3238
3239
|
let { children: e8, value: l3 } = c2, u2 = i2[l3];
|
|
3239
|
-
if (!
|
|
3240
|
-
let d2 = u2(
|
|
3240
|
+
if (!Ja(u2)) throw new Ga(l3, `function`, o2);
|
|
3241
|
+
let d2 = u2(Ya(e8, t2, n2, r2, i2, a2).map((e9) => e9.value));
|
|
3241
3242
|
Array.isArray(d2) || (d2 = [d2]), s2.push(...d2.map((e9) => ({ type: typeof e9 == `string` ? 0 : 1, value: e9 })));
|
|
3242
3243
|
}
|
|
3243
|
-
if (
|
|
3244
|
+
if (ga(c2)) {
|
|
3244
3245
|
let e8 = l2, a3 = (Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0) || c2.options.other;
|
|
3245
|
-
if (!a3) throw new
|
|
3246
|
-
s2.push(...
|
|
3247
|
-
} else if (
|
|
3246
|
+
if (!a3) throw new Wa(c2.value, l2, Object.keys(c2.options), o2);
|
|
3247
|
+
s2.push(...Ya(a3.value, t2, n2, r2, i2));
|
|
3248
|
+
} else if (_a(c2)) {
|
|
3248
3249
|
let e8 = `=${l2}`, a3 = Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0;
|
|
3249
3250
|
if (!a3) {
|
|
3250
|
-
if (!Intl.PluralRules) throw new
|
|
3251
|
+
if (!Intl.PluralRules) throw new Ua(`Intl.PluralRules is not available in this environment.
|
|
3251
3252
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3252
3253
|
`, `MISSING_INTL_API`, o2);
|
|
3253
3254
|
let e9 = typeof l2 == `bigint` ? Number(l2) : l2, r3 = n2.getPluralRules(t2, { type: c2.pluralType }).select(e9 - (c2.offset || 0));
|
|
3254
3255
|
a3 = (Object.prototype.hasOwnProperty.call(c2.options, r3) ? c2.options[r3] : void 0) || c2.options.other;
|
|
3255
3256
|
}
|
|
3256
|
-
if (!a3) throw new
|
|
3257
|
+
if (!a3) throw new Wa(c2.value, l2, Object.keys(c2.options), o2);
|
|
3257
3258
|
let u2 = typeof l2 == `bigint` ? Number(l2) : l2;
|
|
3258
|
-
s2.push(...
|
|
3259
|
+
s2.push(...Ya(a3.value, t2, n2, r2, i2, u2 - (c2.offset || 0)));
|
|
3259
3260
|
}
|
|
3260
3261
|
}
|
|
3261
3262
|
}
|
|
3262
|
-
return
|
|
3263
|
+
return qa(s2);
|
|
3263
3264
|
}
|
|
3264
|
-
function
|
|
3265
|
+
function Xa(e6, t2) {
|
|
3265
3266
|
return t2 ? { ...e6, ...t2, ...Object.keys(e6).reduce((n2, r2) => (n2[r2] = { ...e6[r2], ...t2[r2] }, n2), {}) } : e6;
|
|
3266
3267
|
}
|
|
3267
|
-
function
|
|
3268
|
-
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] =
|
|
3268
|
+
function Za(e6, t2) {
|
|
3269
|
+
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] = Xa(e6[r2], t2[r2]), n2), { ...e6 }) : e6;
|
|
3269
3270
|
}
|
|
3270
|
-
function
|
|
3271
|
+
function Qa(e6) {
|
|
3271
3272
|
return { create() {
|
|
3272
3273
|
return { get(t2) {
|
|
3273
3274
|
return e6[t2];
|
|
@@ -3276,23 +3277,23 @@ function Za(e6) {
|
|
|
3276
3277
|
} };
|
|
3277
3278
|
} };
|
|
3278
3279
|
}
|
|
3279
|
-
function
|
|
3280
|
-
return { getNumberFormat:
|
|
3280
|
+
function $a(e6 = { number: {}, dateTime: {}, pluralRules: {} }) {
|
|
3281
|
+
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 }) };
|
|
3281
3282
|
}
|
|
3282
|
-
var
|
|
3283
|
+
var eo = class e5 {
|
|
3283
3284
|
constructor(t2, n2 = e5.defaultLocale, r2, i2) {
|
|
3284
3285
|
if (this.formatterCache = { number: {}, dateTime: {}, pluralRules: {} }, this.format = (e6) => {
|
|
3285
3286
|
let t3 = this.formatToParts(e6);
|
|
3286
3287
|
if (t3.length === 1) return t3[0].value;
|
|
3287
3288
|
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), []);
|
|
3288
3289
|
return n3.length <= 1 ? n3[0] || `` : n3;
|
|
3289
|
-
}, this.formatToParts = (e6) =>
|
|
3290
|
+
}, 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`) {
|
|
3290
3291
|
if (this.message = t2, !e5.__parse) throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3291
3292
|
let { ...n3 } = i2 || {};
|
|
3292
3293
|
this.ast = e5.__parse(t2, { ...n3, locale: this.resolvedLocale });
|
|
3293
3294
|
} else this.ast = t2;
|
|
3294
3295
|
if (!Array.isArray(this.ast)) throw TypeError(`A message must be provided as a String or AST.`);
|
|
3295
|
-
this.formats =
|
|
3296
|
+
this.formats = Za(e5.formats, r2), this.formatters = i2 && i2.formatters || $a(this.formatterCache);
|
|
3296
3297
|
}
|
|
3297
3298
|
static {
|
|
3298
3299
|
this.memoizedDefaultLocale = null;
|
|
@@ -3308,32 +3309,32 @@ var $a = class e5 {
|
|
|
3308
3309
|
};
|
|
3309
3310
|
}
|
|
3310
3311
|
static {
|
|
3311
|
-
this.__parse =
|
|
3312
|
+
this.__parse = Ha;
|
|
3312
3313
|
}
|
|
3313
3314
|
static {
|
|
3314
3315
|
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` } } };
|
|
3315
3316
|
}
|
|
3316
3317
|
};
|
|
3317
|
-
function
|
|
3318
|
-
return
|
|
3318
|
+
function to(e6, t2) {
|
|
3319
|
+
return oo(e6) || ao(e6, t2) || ro(e6, t2) || no();
|
|
3319
3320
|
}
|
|
3320
|
-
function
|
|
3321
|
+
function no() {
|
|
3321
3322
|
throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3322
3323
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
3323
3324
|
}
|
|
3324
|
-
function
|
|
3325
|
+
function ro(e6, t2) {
|
|
3325
3326
|
if (e6) {
|
|
3326
|
-
if (typeof e6 == `string`) return
|
|
3327
|
+
if (typeof e6 == `string`) return io(e6, t2);
|
|
3327
3328
|
var n2 = {}.toString.call(e6).slice(8, -1);
|
|
3328
|
-
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) ?
|
|
3329
|
+
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;
|
|
3329
3330
|
}
|
|
3330
3331
|
}
|
|
3331
|
-
function
|
|
3332
|
+
function io(e6, t2) {
|
|
3332
3333
|
(t2 == null || t2 > e6.length) && (t2 = e6.length);
|
|
3333
3334
|
for (var n2 = 0, r2 = Array(t2); n2 < t2; n2++) r2[n2] = e6[n2];
|
|
3334
3335
|
return r2;
|
|
3335
3336
|
}
|
|
3336
|
-
function
|
|
3337
|
+
function ao(e6, t2) {
|
|
3337
3338
|
var n2 = e6 == null ? null : typeof Symbol < `u` && e6[Symbol.iterator] || e6[`@@iterator`];
|
|
3338
3339
|
if (n2 != null) {
|
|
3339
3340
|
var r2, i2, a2, o2, s2 = [], c2 = true, l2 = false;
|
|
@@ -3354,7 +3355,7 @@ function io(e6, t2) {
|
|
|
3354
3355
|
return s2;
|
|
3355
3356
|
}
|
|
3356
3357
|
}
|
|
3357
|
-
function
|
|
3358
|
+
function oo(e6) {
|
|
3358
3359
|
if (Array.isArray(e6)) return e6;
|
|
3359
3360
|
}
|
|
3360
3361
|
function Z(e6) {
|
|
@@ -3365,7 +3366,7 @@ function Z(e6) {
|
|
|
3365
3366
|
return e7 && typeof Symbol == `function` && e7.constructor === Symbol && e7 !== Symbol.prototype ? `symbol` : typeof e7;
|
|
3366
3367
|
}, Z(e6);
|
|
3367
3368
|
}
|
|
3368
|
-
function
|
|
3369
|
+
function so(e6, t2) {
|
|
3369
3370
|
var n2 = Object.keys(e6);
|
|
3370
3371
|
if (Object.getOwnPropertySymbols) {
|
|
3371
3372
|
var r2 = Object.getOwnPropertySymbols(e6);
|
|
@@ -3375,37 +3376,37 @@ function oo(e6, t2) {
|
|
|
3375
3376
|
}
|
|
3376
3377
|
return n2;
|
|
3377
3378
|
}
|
|
3378
|
-
function
|
|
3379
|
+
function co(e6) {
|
|
3379
3380
|
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
3380
3381
|
var n2 = arguments[t2] == null ? {} : arguments[t2];
|
|
3381
|
-
t2 % 2 ?
|
|
3382
|
-
|
|
3383
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) :
|
|
3382
|
+
t2 % 2 ? so(Object(n2), true).forEach(function(t3) {
|
|
3383
|
+
lo(e6, t3, n2[t3]);
|
|
3384
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) : so(Object(n2)).forEach(function(t3) {
|
|
3384
3385
|
Object.defineProperty(e6, t3, Object.getOwnPropertyDescriptor(n2, t3));
|
|
3385
3386
|
});
|
|
3386
3387
|
}
|
|
3387
3388
|
return e6;
|
|
3388
3389
|
}
|
|
3389
|
-
function
|
|
3390
|
-
return (t2 =
|
|
3390
|
+
function lo(e6, t2, n2) {
|
|
3391
|
+
return (t2 = mo(t2)) in e6 ? Object.defineProperty(e6, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e6[t2] = n2, e6;
|
|
3391
3392
|
}
|
|
3392
|
-
function
|
|
3393
|
+
function uo(e6, t2) {
|
|
3393
3394
|
if (!(e6 instanceof t2)) throw TypeError(`Cannot call a class as a function`);
|
|
3394
3395
|
}
|
|
3395
|
-
function
|
|
3396
|
+
function fo(e6, t2) {
|
|
3396
3397
|
for (var n2 = 0; n2 < t2.length; n2++) {
|
|
3397
3398
|
var r2 = t2[n2];
|
|
3398
|
-
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6,
|
|
3399
|
+
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6, mo(r2.key), r2);
|
|
3399
3400
|
}
|
|
3400
3401
|
}
|
|
3401
|
-
function
|
|
3402
|
-
return t2 &&
|
|
3402
|
+
function po(e6, t2, n2) {
|
|
3403
|
+
return t2 && fo(e6.prototype, t2), n2 && fo(e6, n2), Object.defineProperty(e6, "prototype", { writable: false }), e6;
|
|
3403
3404
|
}
|
|
3404
|
-
function
|
|
3405
|
-
var t2 =
|
|
3405
|
+
function mo(e6) {
|
|
3406
|
+
var t2 = ho(e6, `string`);
|
|
3406
3407
|
return Z(t2) == `symbol` ? t2 : t2 + ``;
|
|
3407
3408
|
}
|
|
3408
|
-
function
|
|
3409
|
+
function ho(e6, t2) {
|
|
3409
3410
|
if (Z(e6) != `object` || !e6) return e6;
|
|
3410
3411
|
var n2 = e6[Symbol.toPrimitive];
|
|
3411
3412
|
if (n2 !== void 0) {
|
|
@@ -3415,34 +3416,34 @@ function mo(e6, t2) {
|
|
|
3415
3416
|
}
|
|
3416
3417
|
return (t2 === `string` ? String : Number)(e6);
|
|
3417
3418
|
}
|
|
3418
|
-
function
|
|
3419
|
+
function go() {
|
|
3419
3420
|
return { memoize: true, memoizeFallback: false, bindI18n: ``, bindI18nStore: ``, parseErrorHandler: function(e6, t2, n2, r2) {
|
|
3420
3421
|
return n2;
|
|
3421
3422
|
}, parseLngForICU: function(e6) {
|
|
3422
3423
|
return e6;
|
|
3423
3424
|
}, escapeVariables: false };
|
|
3424
3425
|
}
|
|
3425
|
-
var
|
|
3426
|
+
var _o = function() {
|
|
3426
3427
|
function e6(t2) {
|
|
3427
|
-
|
|
3428
|
+
uo(this, e6), this.type = `i18nFormat`, this.mem = {}, this.init(null, t2);
|
|
3428
3429
|
}
|
|
3429
|
-
return
|
|
3430
|
+
return po(e6, [{ key: `init`, value: function(e7, t2) {
|
|
3430
3431
|
var n2 = this, r2 = e7 && e7.options && e7.options.i18nFormat || {};
|
|
3431
|
-
if (this.options =
|
|
3432
|
+
if (this.options = Li(r2, t2, this.options || {}, go()), this.formats = this.options.formats, e7) {
|
|
3432
3433
|
var i2 = this.options, a2 = i2.bindI18n, o2 = i2.bindI18nStore, s2 = i2.memoize;
|
|
3433
|
-
e7.IntlMessageFormat =
|
|
3434
|
+
e7.IntlMessageFormat = eo, e7.ICU = this, s2 && (a2 && e7.on(a2, function() {
|
|
3434
3435
|
return n2.clearCache();
|
|
3435
3436
|
}), o2 && e7.store.on(o2, function() {
|
|
3436
3437
|
return n2.clearCache();
|
|
3437
3438
|
}));
|
|
3438
3439
|
}
|
|
3439
3440
|
} }, { key: `addUserDefinedFormats`, value: function(e7) {
|
|
3440
|
-
this.formats = this.formats ?
|
|
3441
|
+
this.formats = this.formats ? co(co({}, this.formats), e7) : e7;
|
|
3441
3442
|
} }, { key: `parse`, value: function(e7, t2, n2, r2, i2, a2) {
|
|
3442
3443
|
var o2 = a2 && a2.resolved && a2.resolved.res, s2 = this.options.memoize && `${n2}.${r2}.${i2.replace(/\./g, `###`)}`, c2;
|
|
3443
|
-
this.options.memoize && (c2 =
|
|
3444
|
+
this.options.memoize && (c2 = Ni(this.mem, s2));
|
|
3444
3445
|
try {
|
|
3445
|
-
return c2 || (c2 = new
|
|
3446
|
+
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));
|
|
3446
3447
|
} catch (n3) {
|
|
3447
3448
|
return this.options.parseErrorHandler(n3, i2, e7, t2);
|
|
3448
3449
|
}
|
|
@@ -3453,27 +3454,27 @@ var go = function() {
|
|
|
3453
3454
|
} }, { key: `escapeVariableValues`, value: function(e7) {
|
|
3454
3455
|
if (!this.options.escapeVariables || !e7 || Z(e7) !== `object`) return e7;
|
|
3455
3456
|
for (var t2 = {}, n2 = 0, r2 = Object.entries(e7); n2 < r2.length; n2++) {
|
|
3456
|
-
var i2 =
|
|
3457
|
+
var i2 = to(r2[n2], 2), a2 = i2[0], o2 = i2[1];
|
|
3457
3458
|
t2[a2] = typeof o2 == `string` ? o2.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`) : o2;
|
|
3458
3459
|
}
|
|
3459
3460
|
return t2;
|
|
3460
3461
|
} }]), e6;
|
|
3461
3462
|
}();
|
|
3462
|
-
|
|
3463
|
-
function
|
|
3463
|
+
_o.type = `i18nFormat`;
|
|
3464
|
+
function vo({ icuOptions: e6 = {}, ...t2 }) {
|
|
3464
3465
|
let { parseErrorHandler: n2 = void 0 } = t2;
|
|
3465
|
-
return
|
|
3466
|
+
return ki(t2, { icu: new _o({ parseErrorHandler: n2, bindI18n: t2.bindI18n, ...e6 }) });
|
|
3466
3467
|
}
|
|
3467
|
-
var
|
|
3468
|
+
var yo = (e6, t2, n2, r2) => {
|
|
3468
3469
|
let i2 = [n2, { code: t2, ...r2 || {} }];
|
|
3469
3470
|
if (e6?.services?.logger?.forward) return e6.services.logger.forward(i2, `warn`, `react-i18next::`, true);
|
|
3470
3471
|
Q(i2[0]) && (i2[0] = `react-i18next:: ${i2[0]}`), e6?.services?.logger?.warn ? e6.services.logger.warn(...i2) : console?.warn && console.warn(...i2);
|
|
3471
3472
|
};
|
|
3472
|
-
var
|
|
3473
|
-
var
|
|
3474
|
-
Q(n2) &&
|
|
3473
|
+
var bo = {};
|
|
3474
|
+
var xo = (e6, t2, n2, r2) => {
|
|
3475
|
+
Q(n2) && bo[n2] || (Q(n2) && (bo[n2] = /* @__PURE__ */ new Date()), yo(e6, t2, n2, r2));
|
|
3475
3476
|
};
|
|
3476
|
-
var
|
|
3477
|
+
var So = (e6, t2) => () => {
|
|
3477
3478
|
if (e6.isInitialized) t2();
|
|
3478
3479
|
else {
|
|
3479
3480
|
let n2 = () => {
|
|
@@ -3484,29 +3485,29 @@ var xo = (e6, t2) => () => {
|
|
|
3484
3485
|
e6.on(`initialized`, n2);
|
|
3485
3486
|
}
|
|
3486
3487
|
};
|
|
3487
|
-
var
|
|
3488
|
-
e6.loadNamespaces(t2,
|
|
3488
|
+
var Co = (e6, t2, n2) => {
|
|
3489
|
+
e6.loadNamespaces(t2, So(e6, n2));
|
|
3489
3490
|
};
|
|
3490
|
-
var
|
|
3491
|
-
if (Q(n2) && (n2 = [n2]), e6.options.preload && e6.options.preload.indexOf(t2) > -1) return
|
|
3491
|
+
var wo = (e6, t2, n2, r2) => {
|
|
3492
|
+
if (Q(n2) && (n2 = [n2]), e6.options.preload && e6.options.preload.indexOf(t2) > -1) return Co(e6, n2, r2);
|
|
3492
3493
|
n2.forEach((t3) => {
|
|
3493
3494
|
e6.options.ns.indexOf(t3) < 0 && e6.options.ns.push(t3);
|
|
3494
|
-
}), e6.loadLanguages(t2,
|
|
3495
|
+
}), e6.loadLanguages(t2, So(e6, r2));
|
|
3495
3496
|
};
|
|
3496
|
-
var
|
|
3497
|
+
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) => {
|
|
3497
3498
|
if (n2.bindI18n && n2.bindI18n.indexOf(`languageChanging`) > -1 && t3.services.backendConnector.backend && t3.isLanguageChangingTo && !r2(t3.isLanguageChangingTo, e6)) return false;
|
|
3498
3499
|
} });
|
|
3499
3500
|
var Q = (e6) => typeof e6 == `string`;
|
|
3500
|
-
var
|
|
3501
|
-
var
|
|
3502
|
-
var
|
|
3503
|
-
var
|
|
3504
|
-
var
|
|
3505
|
-
var
|
|
3506
|
-
var
|
|
3507
|
-
var
|
|
3508
|
-
var
|
|
3509
|
-
var
|
|
3501
|
+
var Eo = (e6) => typeof e6 == `object` && !!e6;
|
|
3502
|
+
var Do = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3503
|
+
var Oo = { "&": `&`, "&": `&`, "<": `<`, "<": `<`, ">": `>`, ">": `>`, "'": `'`, "'": `'`, """: `"`, """: `"`, " ": ` `, " ": ` `, "©": `\xA9`, "©": `\xA9`, "®": `\xAE`, "®": `\xAE`, "…": `\u2026`, "…": `\u2026`, "/": `/`, "/": `/` };
|
|
3504
|
+
var ko = (e6) => Oo[e6];
|
|
3505
|
+
var Ao = { bindI18n: `languageChanged`, bindI18nStore: ``, transEmptyNodeValue: ``, transSupportBasicHtmlNodes: true, transWrapTextNodes: ``, transKeepBasicHtmlNodesFor: [`br`, `strong`, `i`, `p`], useSuspense: true, unescape: (e6) => e6.replace(Do, ko) };
|
|
3506
|
+
var jo = () => Ao;
|
|
3507
|
+
var Mo;
|
|
3508
|
+
var No = () => Mo;
|
|
3509
|
+
var Po = t();
|
|
3510
|
+
var Fo = class {
|
|
3510
3511
|
constructor() {
|
|
3511
3512
|
this.usedNamespaces = {};
|
|
3512
3513
|
}
|
|
@@ -3519,134 +3520,137 @@ var Po = class {
|
|
|
3519
3520
|
return Object.keys(this.usedNamespaces);
|
|
3520
3521
|
}
|
|
3521
3522
|
};
|
|
3522
|
-
var
|
|
3523
|
-
let n2 =
|
|
3524
|
-
return
|
|
3523
|
+
var Io = (e6, t2) => {
|
|
3524
|
+
let n2 = c();
|
|
3525
|
+
return o(() => {
|
|
3525
3526
|
n2.current = t2 ? n2.current : e6;
|
|
3526
3527
|
}, [e6, t2]), n2.current;
|
|
3527
3528
|
};
|
|
3528
|
-
var
|
|
3529
|
-
var
|
|
3530
|
-
var
|
|
3531
|
-
let { i18n: n2 } = t2, { i18n: r2, defaultNS:
|
|
3532
|
-
if (
|
|
3533
|
-
|
|
3534
|
-
let e7 = (e8, t4) => Q(t4) ? t4 :
|
|
3529
|
+
var Lo = (e6, t2, n2, r2) => e6.getFixedT(t2, n2, r2);
|
|
3530
|
+
var Ro = (e6, t2, n2, r2) => i(Lo(e6, t2, n2, r2), [e6, t2, n2, r2]);
|
|
3531
|
+
var zo = (e6, t2 = {}) => {
|
|
3532
|
+
let { i18n: n2 } = t2, { i18n: r2, defaultNS: i2 } = a(Po) || {}, s2 = n2 || r2 || No();
|
|
3533
|
+
if (s2 && !s2.reportNamespaces && (s2.reportNamespaces = new Fo()), !s2) {
|
|
3534
|
+
xo(s2, `NO_I18NEXT_INSTANCE`, `useTranslation: You will need to pass in an i18next instance by using initReactI18next`);
|
|
3535
|
+
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];
|
|
3535
3536
|
return t3.t = e7, t3.i18n = {}, t3.ready = false, t3;
|
|
3536
3537
|
}
|
|
3537
|
-
|
|
3538
|
-
let u2 = { ...
|
|
3539
|
-
p2 = Q(p2) ? [p2] : p2 || [`translation`],
|
|
3540
|
-
let m2 = (
|
|
3538
|
+
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.`);
|
|
3539
|
+
let u2 = { ...jo(), ...s2.options.react, ...t2 }, { useSuspense: d2, keyPrefix: f2 } = u2, p2 = e6 || i2 || s2.options?.defaultNS;
|
|
3540
|
+
p2 = Q(p2) ? [p2] : p2 || [`translation`], s2.reportNamespaces.addUsedNamespaces?.(p2);
|
|
3541
|
+
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] = l(g2), b2 = p2.join();
|
|
3541
3542
|
t2.lng && (b2 = `${t2.lng}${b2}`);
|
|
3542
|
-
let x2 =
|
|
3543
|
-
|
|
3543
|
+
let x2 = Io(b2), S2 = c(true);
|
|
3544
|
+
o(() => {
|
|
3544
3545
|
let { bindI18n: e7, bindI18nStore: n3 } = u2;
|
|
3545
|
-
S2.current = true, !m2 && !d2 && (t2.lng ?
|
|
3546
|
+
S2.current = true, !m2 && !d2 && (t2.lng ? wo(s2, t2.lng, p2, () => {
|
|
3546
3547
|
S2.current && y2(_2);
|
|
3547
|
-
}) :
|
|
3548
|
+
}) : Co(s2, p2, () => {
|
|
3548
3549
|
S2.current && y2(_2);
|
|
3549
3550
|
})), m2 && x2 && x2 !== b2 && S2.current && y2(_2);
|
|
3550
3551
|
let r3 = () => {
|
|
3551
3552
|
S2.current && y2(_2);
|
|
3552
3553
|
};
|
|
3553
|
-
return e7 &&
|
|
3554
|
-
S2.current = false,
|
|
3554
|
+
return e7 && s2?.on(e7, r3), n3 && s2?.store.on(n3, r3), () => {
|
|
3555
|
+
S2.current = false, s2 && e7 && e7?.split(` `).forEach((e8) => s2.off(e8, r3)), n3 && s2 && n3.split(` `).forEach((e8) => s2.store.off(e8, r3));
|
|
3555
3556
|
};
|
|
3556
|
-
}, [
|
|
3557
|
+
}, [s2, b2]), o(() => {
|
|
3557
3558
|
S2.current && m2 && y2(g2);
|
|
3558
|
-
}, [
|
|
3559
|
-
let C2 = [v2,
|
|
3560
|
-
if (C2.t = v2, C2.i18n =
|
|
3559
|
+
}, [s2, f2, m2]);
|
|
3560
|
+
let C2 = [v2, s2, m2];
|
|
3561
|
+
if (C2.t = v2, C2.i18n = s2, C2.ready = m2, m2 || !m2 && !d2) return C2;
|
|
3561
3562
|
throw new Promise((e7) => {
|
|
3562
|
-
t2.lng ?
|
|
3563
|
+
t2.lng ? wo(s2, t2.lng, p2, () => e7()) : Co(s2, p2, () => e7());
|
|
3563
3564
|
});
|
|
3564
3565
|
};
|
|
3565
|
-
function
|
|
3566
|
-
let i2 =
|
|
3567
|
-
return
|
|
3566
|
+
function Bo({ i18n: e6, defaultNS: t2, children: r2 }) {
|
|
3567
|
+
let i2 = s(() => ({ i18n: e6, defaultNS: t2 }), [e6, t2]);
|
|
3568
|
+
return n(Po.Provider, { value: i2 }, r2);
|
|
3568
3569
|
}
|
|
3569
|
-
var
|
|
3570
|
-
var
|
|
3570
|
+
var Vo = I(`@wix/site-service-renderer-configuration`);
|
|
3571
|
+
var Ho = () => {
|
|
3571
3572
|
let e6, t2;
|
|
3572
3573
|
try {
|
|
3573
|
-
e6 =
|
|
3574
|
+
e6 = u(Vo).languageCode;
|
|
3574
3575
|
} catch {
|
|
3575
3576
|
}
|
|
3576
3577
|
try {
|
|
3577
|
-
t2 =
|
|
3578
|
+
t2 = u(Rr).language;
|
|
3578
3579
|
} catch {
|
|
3579
3580
|
}
|
|
3580
3581
|
return e6 || t2;
|
|
3581
3582
|
};
|
|
3582
|
-
var
|
|
3583
|
-
var
|
|
3584
|
-
function
|
|
3583
|
+
var Uo = `wix-warmup-data`;
|
|
3584
|
+
var Wo = null;
|
|
3585
|
+
function Go(e6) {
|
|
3585
3586
|
if (typeof document < `u`) try {
|
|
3586
|
-
let t2 = document.getElementById(
|
|
3587
|
-
return t2 ? (
|
|
3587
|
+
let t2 = document.getElementById(Uo)?.textContent;
|
|
3588
|
+
return t2 ? (Wo?.text !== t2 && (Wo = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Wo.data[e6] ?? void 0) : void 0;
|
|
3588
3589
|
} catch {
|
|
3589
3590
|
return;
|
|
3590
3591
|
}
|
|
3591
3592
|
}
|
|
3592
|
-
var
|
|
3593
|
-
var
|
|
3594
|
-
var
|
|
3595
|
-
function
|
|
3596
|
-
let n2 =
|
|
3593
|
+
var Ko = `blog-builder:i18n`;
|
|
3594
|
+
var qo = () => Go(Ko);
|
|
3595
|
+
var Jo = /* @__PURE__ */ new Map();
|
|
3596
|
+
function Yo(e6, t2) {
|
|
3597
|
+
let n2 = Jo.get(e6);
|
|
3597
3598
|
if (n2) return n2;
|
|
3598
|
-
let r2 =
|
|
3599
|
-
return
|
|
3599
|
+
let r2 = qo(), i2 = r2?.locale === e6 ? r2.messages : void 0, a2 = vo({ locale: e6, useSuspense: true, ...i2 ? { messages: i2 } : { asyncMessagesLoader: t2 } });
|
|
3600
|
+
return Jo.set(e6, a2), a2;
|
|
3600
3601
|
}
|
|
3601
|
-
var
|
|
3602
|
+
var Xo = (e6, t2, n2) => {
|
|
3602
3603
|
let r2 = t2.lastIndexOf(`?`), i2 = e6[r2 === -1 || r2 < t2.lastIndexOf(`/`) ? t2 : t2.slice(0, r2)];
|
|
3603
3604
|
return i2 ? typeof i2 == `function` ? i2() : Promise.resolve(i2) : new Promise((e7, r3) => {
|
|
3604
3605
|
(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.`))));
|
|
3605
3606
|
});
|
|
3606
3607
|
};
|
|
3607
|
-
var
|
|
3608
|
-
|
|
3609
|
-
function
|
|
3610
|
-
let t2 =
|
|
3611
|
-
return { i18n:
|
|
3612
|
-
}
|
|
3613
|
-
var
|
|
3614
|
-
var
|
|
3615
|
-
var
|
|
3616
|
-
var
|
|
3617
|
-
var
|
|
3618
|
-
var
|
|
3619
|
-
var
|
|
3620
|
-
let n2 =
|
|
3608
|
+
var Zo = (e6) => e6.split(`-`)[0] ?? e6;
|
|
3609
|
+
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) });
|
|
3610
|
+
function Qo(e6) {
|
|
3611
|
+
let t2 = Ho(), n2 = qo()?.locale ?? t2 ?? `en`;
|
|
3612
|
+
return { i18n: Yo(n2, e6), locale: n2 };
|
|
3613
|
+
}
|
|
3614
|
+
var $o = m({ default: () => es });
|
|
3615
|
+
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` };
|
|
3616
|
+
var ts = m({ default: () => rs, title: () => ns });
|
|
3617
|
+
var ns = `My App`;
|
|
3618
|
+
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.` };
|
|
3619
|
+
var is = Object.assign({ "../assets/locale/messages_en.dev.json": $o, "../assets/locale/messages_en.json": ts });
|
|
3620
|
+
var as = (e6, t2) => {
|
|
3621
|
+
let n2 = is[`../assets/locale/messages_${Zo(e6)}${t2}.json`];
|
|
3621
3622
|
return n2 ? Promise.resolve(n2) : Promise.reject(Error(`no messages file`));
|
|
3622
3623
|
};
|
|
3623
|
-
var
|
|
3624
|
-
var
|
|
3624
|
+
var os = Hr({ isDev: false, loadMessages: (e6) => as(e6, ``), loadDevMessages: (e6) => as(e6, `.dev`) });
|
|
3625
|
+
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);
|
|
3625
3626
|
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` };
|
|
3626
|
-
var
|
|
3627
|
-
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted:
|
|
3627
|
+
var cs = (e6, t2) => {
|
|
3628
|
+
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: ss(r2, `full`, t2) });
|
|
3628
3629
|
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) } };
|
|
3629
3630
|
};
|
|
3630
|
-
var
|
|
3631
|
-
var
|
|
3632
|
-
var
|
|
3633
|
-
|
|
3634
|
-
function
|
|
3635
|
-
return
|
|
3636
|
-
}
|
|
3637
|
-
function
|
|
3638
|
-
let
|
|
3639
|
-
|
|
3640
|
-
}
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
}
|
|
3645
|
-
|
|
3631
|
+
var ls = (e6) => e6.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`);
|
|
3632
|
+
var us = (e6) => ({ text: e6, html: `<p>${ls(e6)}</p>`, linkList: [] });
|
|
3633
|
+
var ds = t(null);
|
|
3634
|
+
ds.displayName = `PostItemContext`;
|
|
3635
|
+
function fs() {
|
|
3636
|
+
return a(ds);
|
|
3637
|
+
}
|
|
3638
|
+
function ps({ postData: t2, children: n2 }) {
|
|
3639
|
+
let r2 = zr(), { t: i2, ready: a2 } = zo(void 0, { useSuspense: false }), o2 = s(() => 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 = s(() => ({ ...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 = s(() => ({ currentPostId: t2.recentPostItem.slug ? t2._id : void 0, categoryIds: void 0, relatedPostIds: void 0 }), [t2]), v2 = s(() => {
|
|
3640
|
+
let e6 = g2.itemCategoryLabel.text;
|
|
3641
|
+
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 };
|
|
3642
|
+
}, [g2, _2]);
|
|
3643
|
+
return f(ds.Provider, { value: g2, children: f(e, { value: v2, children: n2 }) });
|
|
3644
|
+
}
|
|
3645
|
+
function ms({ postData: e6, children: t2 }) {
|
|
3646
|
+
let { i18n: n2 } = Qo(os);
|
|
3647
|
+
return e6 === void 0 ? f(d, { children: t2 }) : f(Bo, { i18n: n2, children: f(ps, { postData: e6, children: t2 }) });
|
|
3648
|
+
}
|
|
3649
|
+
var hs = Dn(`bd5dc6d6-7a0d-48d5-99da-457340ce6f2d`);
|
|
3646
3650
|
export {
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
+
ms as PostItemContextProvider,
|
|
3652
|
+
ms as default,
|
|
3653
|
+
hs as injectAccessTokenGetter,
|
|
3654
|
+
fs as usePostItemContext
|
|
3651
3655
|
};
|
|
3652
3656
|
//# sourceMappingURL=context-post-item.mjs.map
|