@wix/blog 1.0.714 → 1.0.716
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.d.ts +7 -0
- package/_sdk-exports/context-blog-feed/runtime.js +3 -3
- package/_sdk-exports/context-post-by-id/runtime.js +4 -4
- package/_sdk-exports/context-post-by-slug/runtime.js +3 -3
- package/_sdk-exports/context-post-list-item/runtime.d.ts +8 -3
- package/_sdk-exports/context-post-list-item/runtime.js +4 -4
- package/_sdk-exports/context-related-posts/runtime.d.ts +7 -0
- package/_sdk-exports/context-related-posts/runtime.js +3 -3
- package/build/cjs/context-blog-feed.d.ts +7 -0
- package/build/cjs/context-blog-feed.js +5 -6
- package/build/cjs/context-blog-feed.js.map +1 -1
- package/build/cjs/context-post-by-id.js +916 -894
- package/build/cjs/context-post-by-id.js.map +1 -1
- package/build/cjs/context-post-by-slug.js +146 -124
- package/build/cjs/context-post-by-slug.js.map +1 -1
- package/build/cjs/context-post-list-item.d.ts +8 -3
- package/build/cjs/context-post-list-item.js +896 -873
- package/build/cjs/context-post-list-item.js.map +1 -1
- package/build/cjs/context-related-posts.d.ts +7 -0
- package/build/cjs/context-related-posts.js +5 -6
- package/build/cjs/context-related-posts.js.map +1 -1
- package/build/es/context-blog-feed.d.mts +7 -0
- package/build/es/context-blog-feed.mjs +5 -6
- package/build/es/context-blog-feed.mjs.map +1 -1
- package/build/es/context-post-by-id.mjs +916 -894
- package/build/es/context-post-by-id.mjs.map +1 -1
- package/build/es/context-post-by-slug.mjs +146 -124
- package/build/es/context-post-by-slug.mjs.map +1 -1
- package/build/es/context-post-list-item.d.mts +8 -3
- package/build/es/context-post-list-item.mjs +896 -873
- package/build/es/context-post-list-item.mjs.map +1 -1
- package/build/es/context-related-posts.d.mts +7 -0
- package/build/es/context-related-posts.mjs +5 -6
- package/build/es/context-related-posts.mjs.map +1 -1
- package/build/internal/cjs/context-blog-feed.d.ts +7 -0
- package/build/internal/cjs/context-post-list-item.d.ts +8 -3
- package/build/internal/cjs/context-related-posts.d.ts +7 -0
- package/build/internal/es/context-blog-feed.d.mts +7 -0
- package/build/internal/es/context-post-list-item.d.mts +8 -3
- package/build/internal/es/context-related-posts.d.mts +7 -0
- package/package.json +2 -2
|
@@ -787,21 +787,21 @@ function un(e6, t2) {
|
|
|
787
787
|
function dn(e6) {
|
|
788
788
|
return isFinite(e6) ? e6 : e6.toString();
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function fn(e6) {
|
|
791
791
|
return e6 === `NaN` ? NaN : e6 === `Infinity` ? 1 / 0 : e6 === `-Infinity` ? -1 / 0 : e6;
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function pn(e6) {
|
|
794
794
|
return Uint8Array.from(atob(e6), (e7) => e7.charCodeAt(0));
|
|
795
795
|
}
|
|
796
|
-
var
|
|
797
|
-
var
|
|
796
|
+
var mn = `modulepreload`;
|
|
797
|
+
var hn = function(e6, t2) {
|
|
798
798
|
return new URL(e6, t2).href;
|
|
799
799
|
};
|
|
800
|
-
var
|
|
801
|
-
var
|
|
800
|
+
var gn = {};
|
|
801
|
+
var _n = function(e6) {
|
|
802
802
|
return e6.pathname.endsWith(`.css`);
|
|
803
803
|
};
|
|
804
|
-
var
|
|
804
|
+
var vn = function(e6, t2, n2) {
|
|
805
805
|
if (t2 in e6) return e6[t2];
|
|
806
806
|
let r2 = n2();
|
|
807
807
|
if (!r2) {
|
|
@@ -815,7 +815,7 @@ var _n = function(e6, t2, n2) {
|
|
|
815
815
|
});
|
|
816
816
|
return e6[t2] = i2, i2;
|
|
817
817
|
};
|
|
818
|
-
var
|
|
818
|
+
var yn = function(e6, t2, n2) {
|
|
819
819
|
let r2 = Promise.resolve();
|
|
820
820
|
if (t2 && t2.length > 0) {
|
|
821
821
|
let o3 = function(e8) {
|
|
@@ -826,9 +826,9 @@ var vn = function(e6, t2, n2) {
|
|
|
826
826
|
var o2 = o3, s2 = s3;
|
|
827
827
|
let e7, i3 = document.querySelector(`meta[property=csp-nonce]`), a2 = i3?.nonce || i3?.getAttribute(`nonce`);
|
|
828
828
|
r2 = o3(t2.map((t3) => {
|
|
829
|
-
t3 =
|
|
830
|
-
let r3 = s3(t3), i4 =
|
|
831
|
-
return
|
|
829
|
+
t3 = hn(t3, n2);
|
|
830
|
+
let r3 = s3(t3), i4 = _n(r3);
|
|
831
|
+
return vn(gn, r3.href, () => {
|
|
832
832
|
if (e7 === void 0) {
|
|
833
833
|
e7 = { all: /* @__PURE__ */ new Set(), styles: /* @__PURE__ */ new Set() };
|
|
834
834
|
let t5 = document.getElementsByTagName(`link`);
|
|
@@ -839,7 +839,7 @@ var vn = function(e6, t2, n2) {
|
|
|
839
839
|
}
|
|
840
840
|
if ((i4 ? e7.styles : e7.all).has(r3.href)) return;
|
|
841
841
|
let t4 = document.createElement(`link`);
|
|
842
|
-
if (t4.rel = i4 ? `stylesheet` :
|
|
842
|
+
if (t4.rel = i4 ? `stylesheet` : mn, 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) => {
|
|
843
843
|
t4.addEventListener(`load`, e8), t4.addEventListener(`error`, () => n3(Error(`Unable to preload CSS for ${r3}`)));
|
|
844
844
|
});
|
|
845
845
|
});
|
|
@@ -854,30 +854,30 @@ var vn = function(e6, t2, n2) {
|
|
|
854
854
|
return e6().catch(i2);
|
|
855
855
|
});
|
|
856
856
|
};
|
|
857
|
-
var
|
|
858
|
-
var
|
|
859
|
-
var
|
|
860
|
-
var
|
|
861
|
-
let e6 =
|
|
862
|
-
if (e6) return { [
|
|
857
|
+
var bn = `x-wix-linguist`;
|
|
858
|
+
var xn = `00000000-0000-0000-0000-000000000000`;
|
|
859
|
+
var Sn = `false`;
|
|
860
|
+
var Cn = () => {
|
|
861
|
+
let e6 = En(`language`), t2 = En(`locale`);
|
|
862
|
+
if (e6) return { [bn]: [e6, t2 || e6, Sn, xn].join(`|`) };
|
|
863
863
|
};
|
|
864
|
-
function
|
|
864
|
+
function wn() {
|
|
865
865
|
let e6 = null, t2 = null;
|
|
866
866
|
return { promise: new Promise((n2, r2) => {
|
|
867
867
|
e6 = n2, t2 = r2;
|
|
868
868
|
}), resolve: e6, reject: t2 };
|
|
869
869
|
}
|
|
870
|
-
var
|
|
871
|
-
var
|
|
872
|
-
var
|
|
873
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e6(t2), o2 =
|
|
874
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
875
|
-
return
|
|
870
|
+
var Tn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
871
|
+
var En = (e6) => Tn()?.[e6];
|
|
872
|
+
var Dn = ({ createHost: e6 }) => ({ __type: `host`, create: (e7) => ({}), host: (t2) => {
|
|
873
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e6(t2), o2 = kn();
|
|
874
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: En(`language`), locale: En(`locale`), get passThroughHeaders() {
|
|
875
|
+
return Cn();
|
|
876
876
|
} } };
|
|
877
877
|
}, auth: (e7) => {
|
|
878
878
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
879
|
-
!e7 &&
|
|
880
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
879
|
+
!e7 && On() && (e7 = t2?.getAccessTokenFunction?.());
|
|
880
|
+
let n2 = false, { resolve: r2, promise: i2 } = wn();
|
|
881
881
|
return { getAuthHeaders: async () => {
|
|
882
882
|
if (!e7 && n2 && (e7 = await i2), !e7) throw Error(`Failed to resolve auth token`);
|
|
883
883
|
return { headers: { Authorization: await e7() } };
|
|
@@ -885,37 +885,37 @@ var En = ({ createHost: e6 }) => ({ __type: `host`, create: (e7) => ({}), host:
|
|
|
885
885
|
r2(e8);
|
|
886
886
|
}) };
|
|
887
887
|
} });
|
|
888
|
-
function
|
|
888
|
+
function On() {
|
|
889
889
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function kn() {
|
|
892
892
|
let e6 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
893
893
|
if (!e6) return;
|
|
894
894
|
let t2 = new URL(e6);
|
|
895
895
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
896
896
|
}
|
|
897
|
-
var
|
|
897
|
+
var An = ({ clientSdk: e6, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
898
898
|
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`);
|
|
899
899
|
return e6.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
900
900
|
}, getAccessToken: () => {
|
|
901
901
|
throw Error(`Not implemented`);
|
|
902
902
|
}, observeState: () => ({ disconnect: () => {
|
|
903
903
|
} }) });
|
|
904
|
-
var
|
|
904
|
+
var jn = Dn({ createHost: function(e6) {
|
|
905
905
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e6?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e6 || {};
|
|
906
906
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
907
|
-
return { channel:
|
|
907
|
+
return { channel: An({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
908
908
|
} };
|
|
909
909
|
} });
|
|
910
|
-
var
|
|
911
|
-
let n2 =
|
|
910
|
+
var Mn = (e6, t2) => {
|
|
911
|
+
let n2 = jn.host({ applicationId: e6, componentId: t2 }), r2 = jn.auth();
|
|
912
912
|
return Ye({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
913
913
|
};
|
|
914
|
-
var
|
|
915
|
-
function
|
|
914
|
+
var Nn = (e6) => Mn(`14bcded7-0066-7c35-14d7-466cb3f09103`, e6);
|
|
915
|
+
function Pn() {
|
|
916
916
|
let e6 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
917
917
|
if (e6) return { initWixModules(t3, n3) {
|
|
918
|
-
return
|
|
918
|
+
return Fn(() => e6(t3, n3));
|
|
919
919
|
}, fetchWithAuth() {
|
|
920
920
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
921
921
|
}, graphql() {
|
|
@@ -925,10 +925,10 @@ function Nn() {
|
|
|
925
925
|
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
926
926
|
if (r2) {
|
|
927
927
|
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`);
|
|
928
|
-
return
|
|
928
|
+
return Fn(() => n2.use(e7));
|
|
929
929
|
}
|
|
930
930
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
931
|
-
return
|
|
931
|
+
return Fn(() => t2.use(e7));
|
|
932
932
|
}, fetchWithAuth: (e7, n3) => {
|
|
933
933
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
934
934
|
return t2.fetchWithAuth(e7, n3);
|
|
@@ -940,7 +940,7 @@ function Nn() {
|
|
|
940
940
|
return t2.graphql(e7, n3, r2);
|
|
941
941
|
} };
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function Fn(e6) {
|
|
944
944
|
let t2 = globalThis.__wix_context__, n2 = { client: b.client, elevatedClient: b.elevatedClient }, r2;
|
|
945
945
|
globalThis.__wix_context__ = void 0, b.client = void 0, b.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
946
946
|
try {
|
|
@@ -949,17 +949,17 @@ function Pn(e6) {
|
|
|
949
949
|
globalThis.__wix_context__ = t2, b.client = n2.client, b.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function In(e6, t2) {
|
|
953
953
|
return { ...e6, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
954
|
-
let r2 =
|
|
954
|
+
let r2 = Pn();
|
|
955
955
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
956
956
|
return r2.initWixModules(e6)[t3].apply(void 0, n2);
|
|
957
957
|
}])) };
|
|
958
958
|
}
|
|
959
|
-
function
|
|
960
|
-
return
|
|
959
|
+
function Ln(e6) {
|
|
960
|
+
return In({ __type: `host`, create: (t2) => Object.entries(e6).reduce((e7, [n2, r2]) => ({ ...e7, [n2]: r2(t2) }), {}) }, Object.keys(e6));
|
|
961
961
|
}
|
|
962
|
-
var
|
|
962
|
+
var Rn = class {
|
|
963
963
|
constructor(e6) {
|
|
964
964
|
this.message = e6, this.captureException = () => {
|
|
965
965
|
console.error(this.message);
|
|
@@ -974,13 +974,13 @@ var Ln = class {
|
|
|
974
974
|
};
|
|
975
975
|
}
|
|
976
976
|
};
|
|
977
|
-
var
|
|
978
|
-
var
|
|
979
|
-
function
|
|
977
|
+
var zn = (e6) => new Rn(e6);
|
|
978
|
+
var Bn = Ln({ getMonitoringClient: (e6) => () => e6.getMonitoringClient ? e6.getMonitoringClient() : zn(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
979
|
+
function Vn(e6) {
|
|
980
980
|
let t2 = Promise.resolve(e6);
|
|
981
981
|
return t2.status = `fulfilled`, t2.value = e6, t2;
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function Hn(e6) {
|
|
984
984
|
if (e6.status === `fulfilled`) return e6.value;
|
|
985
985
|
throw e6.status === `rejected` ? e6.reason : (e6.status === `pending` || (e6.status = `pending`, e6.then((t2) => {
|
|
986
986
|
e6.status = `fulfilled`, e6.value = t2;
|
|
@@ -988,17 +988,17 @@ function Vn(e6) {
|
|
|
988
988
|
e6.status = `rejected`, e6.reason = t2;
|
|
989
989
|
})), e6);
|
|
990
990
|
}
|
|
991
|
-
var
|
|
992
|
-
function
|
|
993
|
-
let r2 =
|
|
994
|
-
r2 || (r2 = /* @__PURE__ */ new WeakMap(),
|
|
991
|
+
var Un = /* @__PURE__ */ new WeakMap();
|
|
992
|
+
function Wn(e6, t2, n2) {
|
|
993
|
+
let r2 = Un.get(e6);
|
|
994
|
+
r2 || (r2 = /* @__PURE__ */ new WeakMap(), Un.set(e6, r2));
|
|
995
995
|
let i2 = r2.get(t2);
|
|
996
996
|
i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
|
|
997
997
|
let a2 = i2.get(n2);
|
|
998
998
|
if (!a2) {
|
|
999
|
-
if (e6.status === `fulfilled`) a2 =
|
|
999
|
+
if (e6.status === `fulfilled`) a2 = Vn(t2(e6.value));
|
|
1000
1000
|
else if (e6.status === `rejected`) try {
|
|
1001
|
-
a2 =
|
|
1001
|
+
a2 = Vn(n2(e6.reason));
|
|
1002
1002
|
} catch {
|
|
1003
1003
|
a2 = e6.then(t2, n2);
|
|
1004
1004
|
}
|
|
@@ -1007,36 +1007,36 @@ function Un(e6, t2, n2) {
|
|
|
1007
1007
|
}
|
|
1008
1008
|
return a2;
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1010
|
+
function F(e6) {
|
|
1011
1011
|
return e6;
|
|
1012
1012
|
}
|
|
1013
|
-
var
|
|
1014
|
-
var
|
|
1013
|
+
var Gn = F(`@wix/site-service-rendering-context`);
|
|
1014
|
+
var Kn = () => {
|
|
1015
1015
|
try {
|
|
1016
|
-
return m(
|
|
1016
|
+
return m(Gn).SSR;
|
|
1017
1017
|
} catch {
|
|
1018
1018
|
return false;
|
|
1019
1019
|
}
|
|
1020
1020
|
};
|
|
1021
|
-
var
|
|
1022
|
-
function
|
|
1021
|
+
var qn = (e6, t2) => e6.length === t2.length && e6.every((e7, n2) => Object.is(e7, t2[n2]));
|
|
1022
|
+
function Jn(e6, t2) {
|
|
1023
1023
|
let [n2, r2] = f(() => ({ deps: t2, value: e6() }));
|
|
1024
1024
|
return l(() => {
|
|
1025
|
-
if (
|
|
1025
|
+
if (qn(n2.deps, t2)) return;
|
|
1026
1026
|
let i2 = e6();
|
|
1027
1027
|
o(() => r2({ deps: t2, value: i2 }));
|
|
1028
1028
|
}, t2), n2.value;
|
|
1029
1029
|
}
|
|
1030
|
-
var
|
|
1031
|
-
var
|
|
1030
|
+
var Yn = F(`@wix/viewer-service-site-members`);
|
|
1031
|
+
var Xn = () => {
|
|
1032
1032
|
try {
|
|
1033
|
-
return m(
|
|
1033
|
+
return m(Yn);
|
|
1034
1034
|
} catch {
|
|
1035
1035
|
return;
|
|
1036
1036
|
}
|
|
1037
1037
|
};
|
|
1038
|
-
var
|
|
1039
|
-
let n2 =
|
|
1038
|
+
var Zn = (e6, t2) => {
|
|
1039
|
+
let n2 = Xn(), [r2, i2] = f(), a2 = !!e6.post?.preview;
|
|
1040
1040
|
return l(() => {
|
|
1041
1041
|
if (!a2) return;
|
|
1042
1042
|
let e7 = true, r3 = () => {
|
|
@@ -1054,18 +1054,17 @@ var Xn = (e6, t2) => {
|
|
|
1054
1054
|
};
|
|
1055
1055
|
}, [a2, t2, n2]), u(() => a2 && r2 && r2._id === e6.post?._id ? { ...e6, post: r2, paywall: void 0 } : e6, [a2, r2, e6]);
|
|
1056
1056
|
};
|
|
1057
|
-
var
|
|
1058
|
-
var
|
|
1059
|
-
var
|
|
1060
|
-
var
|
|
1061
|
-
var
|
|
1062
|
-
var
|
|
1063
|
-
var
|
|
1057
|
+
var Qn = F(`@wix/site-service-url`);
|
|
1058
|
+
var $n = `14bcded7-0066-7c35-14d7-466cb3f09103`;
|
|
1059
|
+
var er = `post`;
|
|
1060
|
+
var tr = `category`;
|
|
1061
|
+
var nr = `builder-post`;
|
|
1062
|
+
var rr = `__blog_unknown_section__`;
|
|
1063
|
+
var ir = (e6) => {
|
|
1064
1064
|
let t2;
|
|
1065
1065
|
try {
|
|
1066
|
-
let n3 = e6.appSectionRelativeUrl(
|
|
1067
|
-
if (n3 === e6.appSectionRelativeUrl(`14bcded7-0066-7c35-14d7-466cb3f09103`,
|
|
1068
|
-
t2 = e6.appSectionRelativeUrl(Qn, tr, true);
|
|
1066
|
+
let n3 = e6.appSectionRelativeUrl($n, nr);
|
|
1067
|
+
if (t2 = e6.appSectionRelativeUrl($n, nr, true), n3 === e6.appSectionRelativeUrl(`14bcded7-0066-7c35-14d7-466cb3f09103`, rr) && !n3?.endsWith(`/post-page`) && t2 === n3) return;
|
|
1069
1068
|
} catch {
|
|
1070
1069
|
return;
|
|
1071
1070
|
}
|
|
@@ -1073,12 +1072,12 @@ var rr = (e6) => {
|
|
|
1073
1072
|
let n2 = t2.split(`/`).filter(Boolean);
|
|
1074
1073
|
return n2[n2.length - 1] === `post-page` && n2.pop(), n2.length > 0 ? n2.join(`/`) : void 0;
|
|
1075
1074
|
};
|
|
1076
|
-
var
|
|
1077
|
-
var
|
|
1078
|
-
let t2 =
|
|
1079
|
-
if (t2 && e6.siteUrl) return `${e6.siteUrl.replace(/\/+$/, ``)}/${
|
|
1075
|
+
var ar = (e6) => `${e6}/${er}`;
|
|
1076
|
+
var or = (e6) => {
|
|
1077
|
+
let t2 = ir(e6);
|
|
1078
|
+
if (t2 && e6.siteUrl) return `${e6.siteUrl.replace(/\/+$/, ``)}/${ar(t2)}`;
|
|
1080
1079
|
};
|
|
1081
|
-
var
|
|
1080
|
+
var sr = (e6, t2) => {
|
|
1082
1081
|
if (!e6 || !t2) return;
|
|
1083
1082
|
let n2;
|
|
1084
1083
|
try {
|
|
@@ -1092,14 +1091,14 @@ var or = (e6, t2) => {
|
|
|
1092
1091
|
if (r2.endsWith(t3) && i2.endsWith(`/post`)) return `${n2.origin}${i2}`;
|
|
1093
1092
|
}
|
|
1094
1093
|
};
|
|
1095
|
-
var
|
|
1094
|
+
var cr = (e6) => {
|
|
1096
1095
|
if (!e6) return;
|
|
1097
1096
|
if (typeof e6 == `string`) return e6;
|
|
1098
1097
|
let { base: t2, path: n2 } = e6;
|
|
1099
1098
|
return t2 ? `${t2.replace(/\/+$/, ``)}${n2 ?? ``}` : void 0;
|
|
1100
1099
|
};
|
|
1101
|
-
var
|
|
1102
|
-
let n2 =
|
|
1100
|
+
var lr = (e6, t2) => {
|
|
1101
|
+
let n2 = cr(e6.url), r2 = `/${er}`;
|
|
1103
1102
|
if (!n2 || !t2?.endsWith(r2)) return;
|
|
1104
1103
|
let i2, a2;
|
|
1105
1104
|
try {
|
|
@@ -1110,41 +1109,41 @@ var cr = (e6, t2) => {
|
|
|
1110
1109
|
let o2 = a2.slice(0, -r2.length);
|
|
1111
1110
|
return o2 && i2.startsWith(`${o2}/`) && !i2.startsWith(`${a2}/`) ? n2 : void 0;
|
|
1112
1111
|
};
|
|
1113
|
-
var
|
|
1114
|
-
let n2 =
|
|
1112
|
+
var ur = (e6, t2) => {
|
|
1113
|
+
let n2 = lr(e6, t2);
|
|
1115
1114
|
if (n2) return { href: n2, target: `_self` };
|
|
1116
1115
|
if (t2 && e6.slug) return { href: `${t2}/${encodeURIComponent(e6.slug)}`, target: `_self` };
|
|
1117
|
-
let r2 =
|
|
1116
|
+
let r2 = cr(e6.url);
|
|
1118
1117
|
return r2 ? { href: r2, target: `_self` } : void 0;
|
|
1119
1118
|
};
|
|
1120
|
-
var
|
|
1121
|
-
let n2 =
|
|
1119
|
+
var dr = (e6, t2) => {
|
|
1120
|
+
let n2 = ir(e6);
|
|
1122
1121
|
if (n2 && e6.siteUrl) return `${e6.siteUrl.replace(/\/+$/, ``)}/${n2}/${t2}`;
|
|
1123
1122
|
};
|
|
1124
|
-
var
|
|
1123
|
+
var fr = (e6) => {
|
|
1125
1124
|
let t2;
|
|
1126
1125
|
try {
|
|
1127
|
-
t2 = m(
|
|
1126
|
+
t2 = m(Qn);
|
|
1128
1127
|
} catch {
|
|
1129
1128
|
return;
|
|
1130
1129
|
}
|
|
1131
|
-
return
|
|
1130
|
+
return or(t2) ?? sr(t2.currentUrl, e6);
|
|
1132
1131
|
};
|
|
1133
|
-
var
|
|
1134
|
-
var
|
|
1135
|
-
var
|
|
1132
|
+
var pr = { categoryHeader: `WixBlog.CategoryHeader`, coverMedia: `WixBlog.PostCoverMedia`, postActions: `WixBlog.PostActionBar`, postCategories: `WixBlog.PostCategoryList`, postCounters: `WixBlog.PostCounterBar`, postMetadata: `WixBlog.PostMetadataBar`, postTags: `WixBlog.PostTagList`, feedProvider: `WixBlog.BlogFeedContextProvider`, postBySlugProvider: `WixBlog.PostBySlugContextProvider`, postByIdProvider: `WixBlog.PostByIdContextProvider`, relatedPostsProvider: `WixBlog.RelatedPostsContextProvider` };
|
|
1133
|
+
var mr = (e6) => `${e6} rendered`;
|
|
1134
|
+
var hr = (e6, t2, n2) => {
|
|
1136
1135
|
l(() => {
|
|
1137
1136
|
if (t2 !== `loading` && typeof performance < `u` && typeof performance.mark == `function`) try {
|
|
1138
|
-
performance.mark(
|
|
1137
|
+
performance.mark(mr(e6), { detail: { state: t2, compId: n2 } });
|
|
1139
1138
|
} catch {
|
|
1140
1139
|
}
|
|
1141
1140
|
}, [e6, t2, n2]);
|
|
1142
1141
|
};
|
|
1143
|
-
var
|
|
1144
|
-
function
|
|
1145
|
-
let e6 =
|
|
1142
|
+
var gr = F(`@wix/site-service-warmup-data`);
|
|
1143
|
+
function _r() {
|
|
1144
|
+
let e6 = Kn(), t2 = null;
|
|
1146
1145
|
try {
|
|
1147
|
-
t2 = p()(
|
|
1146
|
+
t2 = p()(gr);
|
|
1148
1147
|
} catch {
|
|
1149
1148
|
}
|
|
1150
1149
|
return u(() => ({ isServer: e6, scope: t2 ?? void 0, get: async (n2) => {
|
|
@@ -1161,13 +1160,13 @@ function gr() {
|
|
|
1161
1160
|
}
|
|
1162
1161
|
} }), [e6, t2]);
|
|
1163
1162
|
}
|
|
1164
|
-
var
|
|
1163
|
+
var vr = () => {
|
|
1165
1164
|
let e6 = /* @__PURE__ */ new Map();
|
|
1166
1165
|
return { getOrInsert: (t2, n2) => (e6.has(t2) || e6.set(t2, n2().finally(() => {
|
|
1167
1166
|
e6.delete(t2);
|
|
1168
1167
|
})), e6.get(t2)) };
|
|
1169
1168
|
};
|
|
1170
|
-
var
|
|
1169
|
+
var yr = async (e6) => {
|
|
1171
1170
|
try {
|
|
1172
1171
|
let { default: t2 } = await e6();
|
|
1173
1172
|
return t2;
|
|
@@ -1175,9 +1174,9 @@ var vr = async (e6) => {
|
|
|
1175
1174
|
return;
|
|
1176
1175
|
}
|
|
1177
1176
|
};
|
|
1178
|
-
var
|
|
1179
|
-
let r2 =
|
|
1180
|
-
let [i3, a2] = await Promise.all([
|
|
1177
|
+
var br = ({ isDev: e6, loadMessages: t2, loadDevMessages: n2 }) => {
|
|
1178
|
+
let r2 = vr(), i2 = async (r3) => {
|
|
1179
|
+
let [i3, a2] = await Promise.all([yr(() => t2(r3)), !e6 || !n2 ? void 0 : yr(() => n2(r3))]);
|
|
1181
1180
|
if (i3 && a2) return { ...i3, ...a2 };
|
|
1182
1181
|
if (i3) return i3;
|
|
1183
1182
|
if (a2) return a2;
|
|
@@ -1185,61 +1184,61 @@ var yr = ({ isDev: e6, loadMessages: t2, loadDevMessages: n2 }) => {
|
|
|
1185
1184
|
};
|
|
1186
1185
|
return (e7) => r2.getOrInsert(e7, () => i2(e7));
|
|
1187
1186
|
};
|
|
1188
|
-
var
|
|
1189
|
-
var
|
|
1187
|
+
var I = (e6) => typeof e6 == `string`;
|
|
1188
|
+
var L = () => {
|
|
1190
1189
|
let e6, t2, n2 = new Promise((n3, r2) => {
|
|
1191
1190
|
e6 = n3, t2 = r2;
|
|
1192
1191
|
});
|
|
1193
1192
|
return n2.resolve = e6, n2.reject = t2, n2;
|
|
1194
1193
|
};
|
|
1195
|
-
var
|
|
1196
|
-
var
|
|
1194
|
+
var xr = (e6) => e6 == null ? `` : String(e6);
|
|
1195
|
+
var Sr = (e6, t2, n2) => {
|
|
1197
1196
|
e6.forEach((e7) => {
|
|
1198
1197
|
t2[e7] && (n2[e7] = t2[e7]);
|
|
1199
1198
|
});
|
|
1200
1199
|
};
|
|
1201
|
-
var
|
|
1202
|
-
var
|
|
1203
|
-
var
|
|
1204
|
-
var
|
|
1205
|
-
let r2 =
|
|
1200
|
+
var Cr = /###/g;
|
|
1201
|
+
var wr = (e6) => e6 && e6.includes(`###`) ? e6.replace(Cr, `.`) : e6;
|
|
1202
|
+
var Tr = (e6) => !e6 || I(e6);
|
|
1203
|
+
var R = (e6, t2, n2) => {
|
|
1204
|
+
let r2 = I(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
1206
1205
|
for (; i2 < r2.length - 1; ) {
|
|
1207
|
-
if (
|
|
1208
|
-
let t3 =
|
|
1206
|
+
if (Tr(e6)) return {};
|
|
1207
|
+
let t3 = wr(r2[i2]);
|
|
1209
1208
|
!e6[t3] && n2 && (e6[t3] = new n2()), e6 = Object.prototype.hasOwnProperty.call(e6, t3) ? e6[t3] : {}, ++i2;
|
|
1210
1209
|
}
|
|
1211
|
-
return
|
|
1210
|
+
return Tr(e6) ? {} : { obj: e6, k: wr(r2[i2]) };
|
|
1212
1211
|
};
|
|
1213
|
-
var
|
|
1214
|
-
let { obj: r2, k: i2 } =
|
|
1212
|
+
var Er = (e6, t2, n2) => {
|
|
1213
|
+
let { obj: r2, k: i2 } = R(e6, t2, Object);
|
|
1215
1214
|
if (r2 !== void 0 || t2.length === 1) {
|
|
1216
1215
|
r2[i2] = n2;
|
|
1217
1216
|
return;
|
|
1218
1217
|
}
|
|
1219
|
-
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 =
|
|
1220
|
-
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 =
|
|
1218
|
+
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 = R(e6, o2, Object);
|
|
1219
|
+
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = R(e6, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
1221
1220
|
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
1222
1221
|
};
|
|
1223
|
-
var
|
|
1224
|
-
let { obj: i2, k: a2 } =
|
|
1222
|
+
var Dr = (e6, t2, n2, r2) => {
|
|
1223
|
+
let { obj: i2, k: a2 } = R(e6, t2, Object);
|
|
1225
1224
|
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
1226
1225
|
};
|
|
1227
|
-
var
|
|
1228
|
-
let { obj: n2, k: r2 } =
|
|
1226
|
+
var Or = (e6, t2) => {
|
|
1227
|
+
let { obj: n2, k: r2 } = R(e6, t2);
|
|
1229
1228
|
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
1230
1229
|
};
|
|
1231
|
-
var Or = (e6, t2, n2) => {
|
|
1232
|
-
let r2 = Dr(e6, n2);
|
|
1233
|
-
return r2 === void 0 ? Dr(t2, n2) : r2;
|
|
1234
|
-
};
|
|
1235
1230
|
var kr = (e6, t2, n2) => {
|
|
1236
|
-
|
|
1231
|
+
let r2 = Or(e6, n2);
|
|
1232
|
+
return r2 === void 0 ? Or(t2, n2) : r2;
|
|
1233
|
+
};
|
|
1234
|
+
var Ar = (e6, t2, n2) => {
|
|
1235
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (Object.prototype.hasOwnProperty.call(e6, r2) ? I(e6[r2]) || e6[r2] instanceof String || I(t2[r2]) || t2[r2] instanceof String ? n2 && (e6[r2] = t2[r2]) : Ar(e6[r2], t2[r2], n2) : e6[r2] = t2[r2]);
|
|
1237
1236
|
return e6;
|
|
1238
1237
|
};
|
|
1239
|
-
var
|
|
1240
|
-
var
|
|
1241
|
-
var
|
|
1242
|
-
var
|
|
1238
|
+
var z = (e6) => e6.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
1239
|
+
var jr = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
1240
|
+
var Mr = (e6) => I(e6) ? e6.replace(/[&<>"'\/]/g, (e7) => jr[e7]) : e6;
|
|
1241
|
+
var Nr = class {
|
|
1243
1242
|
constructor(e6) {
|
|
1244
1243
|
this.capacity = e6, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1245
1244
|
}
|
|
@@ -1250,20 +1249,20 @@ var Mr = class {
|
|
|
1250
1249
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e6, n2), this.regExpQueue.push(e6), n2;
|
|
1251
1250
|
}
|
|
1252
1251
|
};
|
|
1253
|
-
var
|
|
1254
|
-
var
|
|
1255
|
-
var
|
|
1252
|
+
var Pr = [` `, `,`, `?`, `!`, `;`];
|
|
1253
|
+
var Fr = new Nr(20);
|
|
1254
|
+
var Ir = (e6, t2, n2) => {
|
|
1256
1255
|
t2 ||= ``, n2 ||= ``;
|
|
1257
|
-
let r2 =
|
|
1256
|
+
let r2 = Pr.filter((e7) => !t2.includes(e7) && !n2.includes(e7));
|
|
1258
1257
|
if (r2.length === 0) return true;
|
|
1259
|
-
let i2 =
|
|
1258
|
+
let i2 = Fr.getRegExp(`(${r2.map((e7) => e7 === `?` ? `\\?` : e7).join(`|`)})`), a2 = !i2.test(e6);
|
|
1260
1259
|
if (!a2) {
|
|
1261
1260
|
let t3 = e6.indexOf(n2);
|
|
1262
1261
|
t3 > 0 && !i2.test(e6.substring(0, t3)) && (a2 = true);
|
|
1263
1262
|
}
|
|
1264
1263
|
return a2;
|
|
1265
1264
|
};
|
|
1266
|
-
var
|
|
1265
|
+
var Lr = (e6, t2, n2 = `.`) => {
|
|
1267
1266
|
if (!e6) return;
|
|
1268
1267
|
if (e6[t2]) return Object.prototype.hasOwnProperty.call(e6, t2) ? e6[t2] : void 0;
|
|
1269
1268
|
let r2 = t2.split(n2), i2 = e6;
|
|
@@ -1279,8 +1278,8 @@ var Ir = (e6, t2, n2 = `.`) => {
|
|
|
1279
1278
|
}
|
|
1280
1279
|
return i2;
|
|
1281
1280
|
};
|
|
1282
|
-
var
|
|
1283
|
-
var
|
|
1281
|
+
var B = (e6) => e6?.replace(/_/g, `-`);
|
|
1282
|
+
var Rr = { type: `logger`, log(e6) {
|
|
1284
1283
|
this.output(`log`, e6);
|
|
1285
1284
|
}, warn(e6) {
|
|
1286
1285
|
this.output(`warn`, e6);
|
|
@@ -1289,12 +1288,12 @@ var Lr = { type: `logger`, log(e6) {
|
|
|
1289
1288
|
}, output(e6, t2) {
|
|
1290
1289
|
console?.[e6]?.apply?.(console, t2);
|
|
1291
1290
|
} };
|
|
1292
|
-
var
|
|
1291
|
+
var V = new class e2 {
|
|
1293
1292
|
constructor(e6, t2 = {}) {
|
|
1294
1293
|
this.init(e6, t2);
|
|
1295
1294
|
}
|
|
1296
1295
|
init(e6, t2 = {}) {
|
|
1297
|
-
this.prefix = t2.prefix || `i18next:`, this.logger = e6 ||
|
|
1296
|
+
this.prefix = t2.prefix || `i18next:`, this.logger = e6 || Rr, this.options = t2, this.debug = t2.debug;
|
|
1298
1297
|
}
|
|
1299
1298
|
log(...e6) {
|
|
1300
1299
|
return this.forward(e6, `log`, ``, true);
|
|
@@ -1309,7 +1308,7 @@ var H = new class e2 {
|
|
|
1309
1308
|
return this.forward(e6, `warn`, `WARNING DEPRECATED: `, true);
|
|
1310
1309
|
}
|
|
1311
1310
|
forward(e6, t2, n2, r2) {
|
|
1312
|
-
return r2 && !this.debug ? null : (e6 = e6.map((e7) =>
|
|
1311
|
+
return r2 && !this.debug ? null : (e6 = e6.map((e7) => I(e7) ? e7.replace(/[\r\n\x00-\x1F\x7F]/g, ` `) : e7), I(e6[0]) && (e6[0] = `${n2}${this.prefix} ${e6[0]}`), this.logger[t2](e6));
|
|
1313
1312
|
}
|
|
1314
1313
|
create(t2) {
|
|
1315
1314
|
return new e2(this.logger, { prefix: `${this.prefix}:${t2}:`, ...this.options });
|
|
@@ -1318,7 +1317,7 @@ var H = new class e2 {
|
|
|
1318
1317
|
return t2 ||= this.options, t2.prefix = t2.prefix || this.prefix, new e2(this.logger, t2);
|
|
1319
1318
|
}
|
|
1320
1319
|
}();
|
|
1321
|
-
var
|
|
1320
|
+
var zr = class {
|
|
1322
1321
|
constructor() {
|
|
1323
1322
|
this.observers = {};
|
|
1324
1323
|
}
|
|
@@ -1346,8 +1345,8 @@ var Rr = class {
|
|
|
1346
1345
|
});
|
|
1347
1346
|
}
|
|
1348
1347
|
};
|
|
1349
|
-
var
|
|
1350
|
-
var
|
|
1348
|
+
var Br = /* @__PURE__ */ new WeakSet();
|
|
1349
|
+
var Vr = class extends zr {
|
|
1351
1350
|
constructor(e6, t2 = { ns: [`translation`], defaultNS: `translation` }) {
|
|
1352
1351
|
super(), this.data = e6 || {}, this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
|
|
1353
1352
|
}
|
|
@@ -1360,23 +1359,23 @@ var Br = class extends Rr {
|
|
|
1360
1359
|
}
|
|
1361
1360
|
getResource(e6, t2, n2, r2 = {}) {
|
|
1362
1361
|
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
1363
|
-
e6.includes(`.`) ? o2 = e6.split(`.`) : (o2 = [e6, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) :
|
|
1364
|
-
let s2 =
|
|
1365
|
-
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !
|
|
1362
|
+
e6.includes(`.`) ? o2 = e6.split(`.`) : (o2 = [e6, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) : I(n2) && i2 ? o2.push(...n2.split(i2)) : o2.push(n2)));
|
|
1363
|
+
let s2 = Or(this.data, o2);
|
|
1364
|
+
return !s2 && !t2 && !n2 && e6.includes(`.`) && (e6 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !I(n2) ? s2 : Lr(this.data?.[e6]?.[t2], n2, i2);
|
|
1366
1365
|
}
|
|
1367
1366
|
addResource(e6, t2, n2, r2, i2 = { silent: false }) {
|
|
1368
1367
|
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e6, t2];
|
|
1369
|
-
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e6.includes(`.`) && (o2 = e6.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2),
|
|
1368
|
+
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e6.includes(`.`) && (o2 = e6.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), Er(this.data, o2, r2), i2.silent || this.emit(`added`, e6, t2, n2, r2);
|
|
1370
1369
|
}
|
|
1371
1370
|
addResources(e6, t2, n2, r2 = { silent: false }) {
|
|
1372
|
-
for (let r3 in n2) (
|
|
1371
|
+
for (let r3 in n2) (I(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e6, t2, r3, n2[r3], { silent: true });
|
|
1373
1372
|
r2.silent || this.emit(`added`, e6, t2, n2);
|
|
1374
1373
|
}
|
|
1375
1374
|
addResourceBundle(e6, t2, n2, r2, i2, a2 = { silent: false, skipCopy: false }) {
|
|
1376
1375
|
let o2 = [e6, t2];
|
|
1377
1376
|
e6.includes(`.`) && (o2 = e6.split(`.`), r2 = n2, n2 = t2, t2 = o2[1]), this.addNamespaces(t2);
|
|
1378
|
-
let s2 =
|
|
1379
|
-
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ?
|
|
1377
|
+
let s2 = Or(this.data, o2) || {};
|
|
1378
|
+
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? Ar(s2, n2, i2) : s2 = { ...s2, ...n2 }, Er(this.data, o2, s2), a2.silent || this.emit(`added`, e6, t2, n2);
|
|
1380
1379
|
}
|
|
1381
1380
|
removeResourceBundle(e6, t2) {
|
|
1382
1381
|
this.hasResourceBundle(e6, t2) && delete this.data[e6][t2], this.removeNamespaces(t2), this.emit(`removed`, e6, t2);
|
|
@@ -1394,37 +1393,37 @@ var Br = class extends Rr {
|
|
|
1394
1393
|
let t2 = this.getDataByLanguage(e6);
|
|
1395
1394
|
return !!(t2 && Object.keys(t2) || []).find((e7) => {
|
|
1396
1395
|
let n2 = t2[e7];
|
|
1397
|
-
return
|
|
1396
|
+
return Br.has(n2) ? true : !n2 || Object.keys(n2).length === 0 ? false : (typeof n2 == `object` && Br.add(n2), true);
|
|
1398
1397
|
});
|
|
1399
1398
|
}
|
|
1400
1399
|
toJSON() {
|
|
1401
1400
|
return this.data;
|
|
1402
1401
|
}
|
|
1403
1402
|
};
|
|
1404
|
-
var
|
|
1403
|
+
var Hr = { processors: {}, addPostProcessor(e6) {
|
|
1405
1404
|
this.processors[e6.name] = e6;
|
|
1406
1405
|
}, handle(e6, t2, n2, r2, i2) {
|
|
1407
1406
|
return e6.forEach((e7) => {
|
|
1408
1407
|
t2 = this.processors[e7]?.process(t2, n2, r2, i2) ?? t2;
|
|
1409
1408
|
}), t2;
|
|
1410
1409
|
} };
|
|
1411
|
-
var
|
|
1412
|
-
function
|
|
1410
|
+
var Ur = Symbol(`i18next/PATH_KEY`);
|
|
1411
|
+
function Wr() {
|
|
1413
1412
|
let e6 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1414
|
-
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 ===
|
|
1413
|
+
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === Ur ? e6 : (e6.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
1415
1414
|
}
|
|
1416
|
-
function
|
|
1417
|
-
let { [
|
|
1415
|
+
function H(e6, t2) {
|
|
1416
|
+
let { [Ur]: n2 } = e6(Wr()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`, a2 = t2?.enableSelector === `strict`;
|
|
1418
1417
|
if (n2.length > 1 && i2) {
|
|
1419
1418
|
let e7 = t2?.ns, o2 = a2 ? Array.isArray(e7) ? e7 : e7 ? [e7] : null : Array.isArray(e7) ? e7 : null;
|
|
1420
1419
|
if (o2 && (a2 ? o2 : o2.length > 1 ? o2.slice(1) : []).includes(n2[0])) return `${n2[0]}${i2}${n2.slice(1).join(r2)}`;
|
|
1421
1420
|
}
|
|
1422
1421
|
return n2.join(r2);
|
|
1423
1422
|
}
|
|
1424
|
-
var
|
|
1425
|
-
var
|
|
1423
|
+
var Gr = (e6) => !I(e6) && typeof e6 != `boolean` && typeof e6 != `number`;
|
|
1424
|
+
var Kr = class e3 extends zr {
|
|
1426
1425
|
constructor(e6, t2 = {}) {
|
|
1427
|
-
super(),
|
|
1426
|
+
super(), Sr([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e6, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = V.create(`translator`), this.checkedLoadedFor = {};
|
|
1428
1427
|
}
|
|
1429
1428
|
changeLanguage(e6) {
|
|
1430
1429
|
e6 && (this.language = e6);
|
|
@@ -1434,33 +1433,33 @@ var Gr = class e3 extends Rr {
|
|
|
1434
1433
|
if (e6 == null) return false;
|
|
1435
1434
|
let r2 = this.resolve(e6, n2);
|
|
1436
1435
|
if (r2?.res === void 0) return false;
|
|
1437
|
-
let i2 =
|
|
1436
|
+
let i2 = Gr(r2.res);
|
|
1438
1437
|
return !(n2.returnObjects === false && i2);
|
|
1439
1438
|
}
|
|
1440
1439
|
extractFromKey(e6, t2) {
|
|
1441
1440
|
let n2 = t2.nsSeparator === void 0 ? this.options.nsSeparator : t2.nsSeparator;
|
|
1442
1441
|
n2 === void 0 && (n2 = `:`);
|
|
1443
|
-
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 && !
|
|
1442
|
+
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 && !Ir(e6, n2, r2);
|
|
1444
1443
|
if (a2 && !o2) {
|
|
1445
1444
|
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
1446
|
-
if (t3 && t3.length > 0) return { key: e6, namespaces:
|
|
1445
|
+
if (t3 && t3.length > 0) return { key: e6, namespaces: I(i2) ? [i2] : i2 };
|
|
1447
1446
|
let a3 = e6.split(n2);
|
|
1448
1447
|
(n2 !== r2 || n2 === r2 && this.options.ns.includes(a3[0])) && (i2 = a3.shift()), e6 = a3.join(r2);
|
|
1449
1448
|
}
|
|
1450
|
-
return { key: e6, namespaces:
|
|
1449
|
+
return { key: e6, namespaces: I(i2) ? [i2] : i2 };
|
|
1451
1450
|
}
|
|
1452
1451
|
translate(t2, n2, r2) {
|
|
1453
1452
|
let i2 = typeof n2 == `object` ? { ...n2 } : n2;
|
|
1454
1453
|
if (typeof i2 != `object` && this.options.overloadTranslationOptionHandler && (i2 = this.options.overloadTranslationOptionHandler(arguments)), typeof i2 == `object` && (i2 = { ...i2 }), i2 ||= {}, t2 == null) return ``;
|
|
1455
|
-
typeof t2 == `function` && (t2 =
|
|
1454
|
+
typeof t2 == `function` && (t2 = H(t2, { ...this.options, ...i2 })), Array.isArray(t2) || (t2 = [String(t2)]), t2 = t2.map((e6) => typeof e6 == `function` ? H(e6, { ...this.options, ...i2 }) : String(e6));
|
|
1456
1455
|
let a2 = i2.returnDetails === void 0 ? this.options.returnDetails : i2.returnDetails, o2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, { key: s2, namespaces: c2 } = this.extractFromKey(t2[t2.length - 1], i2), l2 = c2[c2.length - 1], u2 = i2.nsSeparator === void 0 ? this.options.nsSeparator : i2.nsSeparator;
|
|
1457
1456
|
u2 === void 0 && (u2 = `:`);
|
|
1458
1457
|
let d2 = i2.lng || this.language, f2 = i2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
1459
1458
|
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;
|
|
1460
|
-
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 && !
|
|
1459
|
+
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 && !I(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;
|
|
1461
1460
|
y2 && !m2 && x2 && (T2 = w2);
|
|
1462
|
-
let te2 =
|
|
1463
|
-
if (y2 && T2 && te2 && !_2.includes(ne2) && !(
|
|
1461
|
+
let te2 = Gr(T2), ne2 = Object.prototype.toString.apply(T2);
|
|
1462
|
+
if (y2 && T2 && te2 && !_2.includes(ne2) && !(I(v2) && Array.isArray(T2))) {
|
|
1464
1463
|
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
1465
1464
|
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
1466
1465
|
let e6 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2, T2, { ...i2, ns: c2 }) : `key '${s2} (${this.language})' returned an object instead of string.`;
|
|
@@ -1470,11 +1469,11 @@ var Gr = class e3 extends Rr {
|
|
|
1470
1469
|
let e6 = Array.isArray(T2), t3 = e6 ? [] : {}, n3 = e6 ? g2 : h2;
|
|
1471
1470
|
for (let e7 in T2) if (Object.prototype.hasOwnProperty.call(T2, e7)) {
|
|
1472
1471
|
let r3 = `${n3}${o2}${e7}`;
|
|
1473
|
-
t3[e7] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue:
|
|
1472
|
+
t3[e7] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue: Gr(w2) ? w2[e7] : void 0, joinArrays: false, ns: c2 }) : this.translate(r3, { ...i2, joinArrays: false, ns: c2 }), t3[e7] === r3 && (t3[e7] = T2[e7]);
|
|
1474
1473
|
}
|
|
1475
1474
|
m2 = t3;
|
|
1476
1475
|
}
|
|
1477
|
-
} else if (y2 &&
|
|
1476
|
+
} else if (y2 && I(v2) && Array.isArray(m2)) m2 = m2.join(v2), m2 &&= this.extendTranslation(m2, t2, i2, r2);
|
|
1478
1477
|
else {
|
|
1479
1478
|
let e6 = false, n3 = false;
|
|
1480
1479
|
!this.isValidLookup(m2) && x2 && (e6 = true, m2 = w2), this.isValidLookup(m2) || (n3 = true, m2 = s2);
|
|
@@ -1506,30 +1505,30 @@ var Gr = class e3 extends Rr {
|
|
|
1506
1505
|
if (this.i18nFormat?.parse) e6 = this.i18nFormat.parse(e6, { ...this.options.interpolation.defaultVariables, ...n2 }, n2.lng || this.language || r2.usedLng, r2.usedNS, r2.usedKey, { resolved: r2 });
|
|
1507
1506
|
else if (!n2.skipInterpolation) {
|
|
1508
1507
|
n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } });
|
|
1509
|
-
let a3 =
|
|
1508
|
+
let a3 = I(e6) && (n2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n2.interpolation.skipOnVariables), o3;
|
|
1510
1509
|
if (a3) {
|
|
1511
1510
|
let t3 = e6.match(this.interpolator.nestingRegexp);
|
|
1512
1511
|
o3 = t3 && t3.length;
|
|
1513
1512
|
}
|
|
1514
|
-
let s2 = n2.replace && !
|
|
1513
|
+
let s2 = n2.replace && !I(n2.replace) ? n2.replace : n2;
|
|
1515
1514
|
if (this.options.interpolation.defaultVariables && (s2 = { ...this.options.interpolation.defaultVariables, ...s2 }), e6 = this.interpolator.interpolate(e6, s2, n2.lng || this.language || r2.usedLng, n2), a3) {
|
|
1516
1515
|
let t3 = e6.match(this.interpolator.nestingRegexp), r3 = t3 && t3.length;
|
|
1517
1516
|
o3 < r3 && (n2.nest = false);
|
|
1518
1517
|
}
|
|
1519
1518
|
!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();
|
|
1520
1519
|
}
|
|
1521
|
-
let a2 = n2.postProcess || this.options.postProcess, o2 =
|
|
1522
|
-
return e6 != null && o2?.length && n2.applyPostProcessor !== false && (e6 =
|
|
1520
|
+
let a2 = n2.postProcess || this.options.postProcess, o2 = I(a2) ? [a2] : a2;
|
|
1521
|
+
return e6 != null && o2?.length && n2.applyPostProcessor !== false && (e6 = Hr.handle(o2, e6, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e6;
|
|
1523
1522
|
}
|
|
1524
1523
|
resolve(e6, t2 = {}) {
|
|
1525
1524
|
let n2, r2, i2, a2, o2;
|
|
1526
|
-
return
|
|
1525
|
+
return I(e6) && (e6 = [e6]), Array.isArray(e6) && (e6 = e6.map((e7) => typeof e7 == `function` ? H(e7, { ...this.options, ...t2 }) : e7)), e6.forEach((e7) => {
|
|
1527
1526
|
if (this.isValidLookup(n2)) return;
|
|
1528
1527
|
let s2 = this.extractFromKey(e7, t2), c2 = s2.key;
|
|
1529
1528
|
r2 = c2;
|
|
1530
1529
|
let l2 = s2.namespaces;
|
|
1531
1530
|
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
|
|
1532
|
-
let u2 = t2.count !== void 0 && !
|
|
1531
|
+
let u2 = t2.count !== void 0 && !I(t2.count), d2 = u2 && !t2.ordinal && t2.count === 0, f2 = t2.context !== void 0 && (I(t2.context) || typeof t2.context == `number`) && t2.context !== ``, p2 = t2.lngs ? t2.lngs : this.languageUtils.toResolveHierarchy(t2.lng || this.language, t2.fallbackLng);
|
|
1533
1532
|
l2.forEach((e8) => {
|
|
1534
1533
|
this.isValidLookup(n2) || (o2 = e8, !this.checkedLoadedFor[`${p2[0]}-${e8}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o2) && (this.checkedLoadedFor[`${p2[0]}-${e8}`] = true, this.logger.warn(`key "${r2}" for languages "${p2.join(`, `)}" won't get resolved as namespace "${o2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)), p2.forEach((r3) => {
|
|
1535
1534
|
if (this.isValidLookup(n2)) return;
|
|
@@ -1558,7 +1557,7 @@ var Gr = class e3 extends Rr {
|
|
|
1558
1557
|
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e6, t2, n2, r2) : this.resourceStore.getResource(e6, t2, n2, r2);
|
|
1559
1558
|
}
|
|
1560
1559
|
getUsedParamsDetails(e6 = {}) {
|
|
1561
|
-
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e6.replace && !
|
|
1560
|
+
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e6.replace && !I(e6.replace), r2 = n2 ? e6.replace : e6;
|
|
1562
1561
|
if (n2 && e6.count !== void 0 && (r2 = { ...r2, count: e6.count }), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) {
|
|
1563
1562
|
r2 = { ...r2 };
|
|
1564
1563
|
for (let e7 of t2) delete r2[e7];
|
|
@@ -1570,25 +1569,25 @@ var Gr = class e3 extends Rr {
|
|
|
1570
1569
|
return false;
|
|
1571
1570
|
}
|
|
1572
1571
|
};
|
|
1573
|
-
var
|
|
1572
|
+
var qr = class {
|
|
1574
1573
|
constructor(e6) {
|
|
1575
|
-
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger =
|
|
1574
|
+
this.options = e6, this.supportedLngs = this.options.supportedLngs || false, this.logger = V.create(`languageUtils`), this.resolveHierarchyCache = {};
|
|
1576
1575
|
}
|
|
1577
1576
|
clearCache() {
|
|
1578
1577
|
this.resolveHierarchyCache = {};
|
|
1579
1578
|
}
|
|
1580
1579
|
getScriptPartFromCode(e6) {
|
|
1581
|
-
if (e6 =
|
|
1580
|
+
if (e6 = B(e6), !e6 || !e6.includes(`-`)) return null;
|
|
1582
1581
|
let t2 = e6.split(`-`);
|
|
1583
1582
|
return t2.length === 2 || (t2.pop(), t2[t2.length - 1].toLowerCase() === `x`) ? null : this.formatLanguageCode(t2.join(`-`));
|
|
1584
1583
|
}
|
|
1585
1584
|
getLanguagePartFromCode(e6) {
|
|
1586
|
-
if (e6 =
|
|
1585
|
+
if (e6 = B(e6), !e6 || !e6.includes(`-`)) return e6;
|
|
1587
1586
|
let t2 = e6.split(`-`);
|
|
1588
1587
|
return this.formatLanguageCode(t2[0]);
|
|
1589
1588
|
}
|
|
1590
1589
|
formatLanguageCode(e6) {
|
|
1591
|
-
if (
|
|
1590
|
+
if (I(e6) && e6.includes(`-`)) {
|
|
1592
1591
|
let t2;
|
|
1593
1592
|
try {
|
|
1594
1593
|
t2 = Intl.getCanonicalLocales(e6)[0];
|
|
@@ -1619,7 +1618,7 @@ var Kr = class {
|
|
|
1619
1618
|
}
|
|
1620
1619
|
getFallbackCodes(e6, t2) {
|
|
1621
1620
|
if (!e6) return [];
|
|
1622
|
-
if (typeof e6 == `function` && (e6 = e6(t2)),
|
|
1621
|
+
if (typeof e6 == `function` && (e6 = e6(t2)), I(e6) && (e6 = [e6]), Array.isArray(e6)) return e6;
|
|
1623
1622
|
if (!t2) return e6.default || [];
|
|
1624
1623
|
let n2 = e6[t2];
|
|
1625
1624
|
return n2 ||= e6[this.getScriptPartFromCode(t2)], n2 ||= e6[this.formatLanguageCode(t2)], n2 ||= e6[this.getLanguagePartFromCode(t2)], n2 ||= e6.default, n2 || [];
|
|
@@ -1627,7 +1626,7 @@ var Kr = class {
|
|
|
1627
1626
|
toResolveHierarchy(e6, t2) {
|
|
1628
1627
|
let n2 = this.options.fallbackLng, r2 = Array.isArray(n2) ? n2.join(`|`) : n2;
|
|
1629
1628
|
r2 !== this._cachedFallbackLng && (this.resolveHierarchyCache = {}, this._cachedFallbackLng = r2);
|
|
1630
|
-
let i2 = t2 === void 0 || t2 === false ||
|
|
1629
|
+
let i2 = t2 === void 0 || t2 === false || I(t2), a2 = t2 === void 0 && typeof this.options.fallbackLng == `function`, o2 = I(e6) && i2 && !a2, s2 = null;
|
|
1631
1630
|
if (o2) {
|
|
1632
1631
|
let n3;
|
|
1633
1632
|
n3 = t2 === void 0 ? `undefined` : t2 === false ? `boolean:false` : `string:${t2}`, s2 = `${e6.length}:${e6}|${n3}`;
|
|
@@ -1639,30 +1638,30 @@ var Kr = class {
|
|
|
1639
1638
|
let c2 = this.getFallbackCodes((t2 === false ? [] : t2) || this.options.fallbackLng || [], e6), l2 = [], u2 = (e7) => {
|
|
1640
1639
|
e7 && (this.isSupportedCode(e7) ? l2.push(e7) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e7}`));
|
|
1641
1640
|
};
|
|
1642
|
-
return
|
|
1641
|
+
return I(e6) && (e6.includes(`-`) || e6.includes(`_`)) ? (this.options.load !== `languageOnly` && u2(this.formatLanguageCode(e6)), this.options.load !== `languageOnly` && this.options.load !== `currentOnly` && u2(this.getScriptPartFromCode(e6)), this.options.load !== `currentOnly` && u2(this.getLanguagePartFromCode(e6))) : I(e6) && u2(this.formatLanguageCode(e6)), c2.forEach((e7) => {
|
|
1643
1642
|
let t3 = this.formatLanguageCode(e7);
|
|
1644
1643
|
l2.includes(t3) || u2(t3);
|
|
1645
1644
|
}), s2 === null ? l2 : (this.resolveHierarchyCache[s2] = l2, l2.slice());
|
|
1646
1645
|
}
|
|
1647
1646
|
};
|
|
1648
|
-
var
|
|
1649
|
-
var
|
|
1650
|
-
var
|
|
1647
|
+
var Jr = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
1648
|
+
var Yr = { select: (e6) => e6 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1649
|
+
var Xr = class {
|
|
1651
1650
|
constructor(e6, t2 = {}) {
|
|
1652
|
-
this.languageUtils = e6, this.options = t2, this.logger =
|
|
1651
|
+
this.languageUtils = e6, this.options = t2, this.logger = V.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1653
1652
|
}
|
|
1654
1653
|
clearCache() {
|
|
1655
1654
|
this.pluralRulesCache = {};
|
|
1656
1655
|
}
|
|
1657
1656
|
getRule(e6, t2 = {}) {
|
|
1658
|
-
let n2 =
|
|
1657
|
+
let n2 = B(e6 === `dev` ? `en` : e6), r2 = t2.ordinal ? `ordinal` : `cardinal`, i2 = JSON.stringify({ cleanedCode: n2, type: r2 });
|
|
1659
1658
|
if (i2 in this.pluralRulesCache) return this.pluralRulesCache[i2];
|
|
1660
1659
|
let a2;
|
|
1661
1660
|
try {
|
|
1662
1661
|
a2 = new Intl.PluralRules(n2, { type: r2 });
|
|
1663
1662
|
} catch {
|
|
1664
|
-
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`),
|
|
1665
|
-
if (!e6.match(/-|_/)) return
|
|
1663
|
+
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`), Yr;
|
|
1664
|
+
if (!e6.match(/-|_/)) return Yr;
|
|
1666
1665
|
let n3 = this.languageUtils.getLanguagePartFromCode(e6);
|
|
1667
1666
|
a2 = this.getRule(n3, t2);
|
|
1668
1667
|
}
|
|
@@ -1677,26 +1676,26 @@ var Yr = class {
|
|
|
1677
1676
|
}
|
|
1678
1677
|
getSuffixes(e6, t2 = {}) {
|
|
1679
1678
|
let n2 = this.getRule(e6, t2);
|
|
1680
|
-
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e7, t3) =>
|
|
1679
|
+
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e7, t3) => Jr[e7] - Jr[t3]).map((e7) => `${this.options.prepend}${t2.ordinal ? `ordinal${this.options.prepend}` : ``}${e7}`) : [];
|
|
1681
1680
|
}
|
|
1682
1681
|
getSuffix(e6, t2, n2 = {}) {
|
|
1683
1682
|
let r2 = this.getRule(e6, n2);
|
|
1684
1683
|
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));
|
|
1685
1684
|
}
|
|
1686
1685
|
};
|
|
1687
|
-
var
|
|
1688
|
-
let a2 =
|
|
1689
|
-
return !a2 && i2 &&
|
|
1686
|
+
var Zr = (e6, t2, n2, r2 = `.`, i2 = true) => {
|
|
1687
|
+
let a2 = kr(e6, t2, n2);
|
|
1688
|
+
return !a2 && i2 && I(n2) && (a2 = Lr(e6, n2, r2), a2 === void 0 && (a2 = Lr(t2, n2, r2))), a2;
|
|
1690
1689
|
};
|
|
1691
|
-
var
|
|
1692
|
-
var
|
|
1690
|
+
var Qr = (e6) => e6.replace(/\$/g, `$$$$`);
|
|
1691
|
+
var $r = class {
|
|
1693
1692
|
constructor(e6 = {}) {
|
|
1694
|
-
this.logger =
|
|
1693
|
+
this.logger = V.create(`interpolator`), this.options = e6, this.format = e6?.interpolation?.format || ((e7) => e7), this.init(e6);
|
|
1695
1694
|
}
|
|
1696
1695
|
init(e6 = {}) {
|
|
1697
1696
|
e6.interpolation ||= { escapeValue: true };
|
|
1698
1697
|
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;
|
|
1699
|
-
this.escape = t2 === void 0 ?
|
|
1698
|
+
this.escape = t2 === void 0 ? Mr : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? z(i2) : a2 || `{{`, this.suffix = o2 ? z(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 ? z(u2) : `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 ? z(l2) : ``, this.nestingPrefix = d2 ? z(d2) : f2 || z(`$t(`), this.nestingSuffix = p2 ? z(p2) : m2 || z(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
1700
1699
|
}
|
|
1701
1700
|
reset() {
|
|
1702
1701
|
this.options && this.init(this.options);
|
|
@@ -1708,11 +1707,11 @@ var Qr = class {
|
|
|
1708
1707
|
interpolate(e6, t2, n2, r2) {
|
|
1709
1708
|
let i2, a2, o2, s2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c2 = (e7) => {
|
|
1710
1709
|
if (!e7.includes(this.formatSeparator)) {
|
|
1711
|
-
let i4 =
|
|
1710
|
+
let i4 = Zr(t2, s2, e7, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1712
1711
|
return this.alwaysFormat ? this.format(i4, void 0, n2, { ...r2, ...t2, interpolationkey: e7 }) : i4;
|
|
1713
1712
|
}
|
|
1714
1713
|
let i3 = e7.split(this.formatSeparator), a3 = i3.shift().trim(), o3 = i3.join(this.formatSeparator).trim();
|
|
1715
|
-
return this.format(
|
|
1714
|
+
return this.format(Zr(t2, s2, a3, this.options.keySeparator, this.options.ignoreJSONStructure), o3, n2, { ...r2, ...t2, interpolationkey: a3 });
|
|
1716
1715
|
};
|
|
1717
1716
|
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.`);
|
|
1718
1717
|
let l2 = r2?.missingInterpolationHandler || this.options.missingInterpolationHandler, u2 = r2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r2.interpolation.skipOnVariables;
|
|
@@ -1722,15 +1721,15 @@ var Qr = class {
|
|
|
1722
1721
|
if (a2 = c2(n3), a2 === void 0) {
|
|
1723
1722
|
if (typeof l2 == `function`) {
|
|
1724
1723
|
let t4 = l2(e6, i2, r2);
|
|
1725
|
-
a2 =
|
|
1724
|
+
a2 = I(t4) ? t4 : ``;
|
|
1726
1725
|
} else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) a2 = ``;
|
|
1727
1726
|
else if (u2) {
|
|
1728
1727
|
a2 = i2[0];
|
|
1729
1728
|
continue;
|
|
1730
1729
|
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e6}`), a2 = ``;
|
|
1731
|
-
} else !
|
|
1730
|
+
} else !I(a2) && !this.useRawValueToEscape && (a2 = xr(a2));
|
|
1732
1731
|
let s3 = t3.safeValue(a2);
|
|
1733
|
-
if (e6 = e6.replace(i2[0],
|
|
1732
|
+
if (e6 = e6.replace(i2[0], Qr(s3)), u2 ? (t3.regex.lastIndex += s3.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, o2++, o2 >= this.maxReplaces) break;
|
|
1734
1733
|
}
|
|
1735
1734
|
}), e6;
|
|
1736
1735
|
}
|
|
@@ -1738,7 +1737,7 @@ var Qr = class {
|
|
|
1738
1737
|
let r2, i2, a2, o2 = (e7, t3) => {
|
|
1739
1738
|
let n3 = this.nestingOptionsSeparator;
|
|
1740
1739
|
if (!e7.includes(n3)) return e7;
|
|
1741
|
-
let r3 = e7.split(RegExp(`${
|
|
1740
|
+
let r3 = e7.split(RegExp(`${z(n3)}[ ]*{`)), i3 = `{${r3[1]}`;
|
|
1742
1741
|
e7 = r3[0], i3 = this.interpolate(i3, a2);
|
|
1743
1742
|
let o3 = i3.match(/'/g), s3 = i3.match(/"/g);
|
|
1744
1743
|
((o3?.length ?? 0) % 2 == 0 && !s3 || (s3?.length ?? 0) % 2 != 0) && (i3 = i3.replace(/'/g, `"`));
|
|
@@ -1751,15 +1750,15 @@ var Qr = class {
|
|
|
1751
1750
|
}, s2 = new RegExp(this.nestingRegexp), c2 = ``, l2 = 0;
|
|
1752
1751
|
for (; r2 = s2.exec(e6); ) {
|
|
1753
1752
|
let u2 = [];
|
|
1754
|
-
a2 = { ...n2 }, a2 = a2.replace && !
|
|
1753
|
+
a2 = { ...n2 }, a2 = a2.replace && !I(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1755
1754
|
let d2 = /{.*}/s.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1756
|
-
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 && !
|
|
1757
|
-
|
|
1755
|
+
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 && !I(i2)) return i2;
|
|
1756
|
+
I(i2) || (i2 = xr(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) + xr(i2), l2 = s2.lastIndex, this.regexp.lastIndex = 0;
|
|
1758
1757
|
}
|
|
1759
1758
|
return l2 ? c2 + e6.slice(l2) : e6;
|
|
1760
1759
|
}
|
|
1761
1760
|
};
|
|
1762
|
-
var
|
|
1761
|
+
var ei = (e6) => {
|
|
1763
1762
|
let t2 = e6.toLowerCase().trim(), n2 = {};
|
|
1764
1763
|
if (e6.includes(`(`)) {
|
|
1765
1764
|
let r2 = e6.split(`(`);
|
|
@@ -1774,23 +1773,23 @@ var $r = (e6) => {
|
|
|
1774
1773
|
}
|
|
1775
1774
|
return { formatName: t2, formatOptions: n2 };
|
|
1776
1775
|
};
|
|
1777
|
-
var
|
|
1776
|
+
var ti = (e6) => {
|
|
1778
1777
|
let t2 = {};
|
|
1779
1778
|
return (n2, r2, i2) => {
|
|
1780
1779
|
let a2 = i2;
|
|
1781
1780
|
i2 && i2.interpolationkey && i2.formatParams && i2.formatParams[i2.interpolationkey] && i2[i2.interpolationkey] && (a2 = { ...a2, [i2.interpolationkey]: void 0 });
|
|
1782
1781
|
let o2 = r2 + JSON.stringify(a2), s2 = t2[o2];
|
|
1783
|
-
return s2 || (s2 = e6(
|
|
1782
|
+
return s2 || (s2 = e6(B(r2), i2), t2[o2] = s2), s2(n2);
|
|
1784
1783
|
};
|
|
1785
1784
|
};
|
|
1786
|
-
var
|
|
1787
|
-
var
|
|
1785
|
+
var ni = (e6) => (t2, n2, r2) => e6(B(n2), r2)(t2);
|
|
1786
|
+
var ri = class {
|
|
1788
1787
|
constructor(e6 = {}) {
|
|
1789
|
-
this.logger =
|
|
1788
|
+
this.logger = V.create(`formatter`), this.options = e6, this.init(e6);
|
|
1790
1789
|
}
|
|
1791
1790
|
init(e6, t2 = { interpolation: {} }) {
|
|
1792
1791
|
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
1793
|
-
let n2 = t2.cacheInBuiltFormats ?
|
|
1792
|
+
let n2 = t2.cacheInBuiltFormats ? ti : ni;
|
|
1794
1793
|
this.formats = { number: n2((e7, t3) => {
|
|
1795
1794
|
let n3 = new Intl.NumberFormat(e7, { ...t3 });
|
|
1796
1795
|
return (e8) => n3.format(e8);
|
|
@@ -1812,7 +1811,7 @@ var ni = class {
|
|
|
1812
1811
|
this.formats[e6.toLowerCase().trim()] = t2;
|
|
1813
1812
|
}
|
|
1814
1813
|
addCached(e6, t2) {
|
|
1815
|
-
this.formats[e6.toLowerCase().trim()] =
|
|
1814
|
+
this.formats[e6.toLowerCase().trim()] = ti(t2);
|
|
1816
1815
|
}
|
|
1817
1816
|
format(e6, t2, n2, r2 = {}) {
|
|
1818
1817
|
if (!t2 || e6 == null) return e6;
|
|
@@ -1823,7 +1822,7 @@ var ni = class {
|
|
|
1823
1822
|
a2.push(t3);
|
|
1824
1823
|
}
|
|
1825
1824
|
return a2.reduce((e7, t3) => {
|
|
1826
|
-
let { formatName: i3, formatOptions: a3 } =
|
|
1825
|
+
let { formatName: i3, formatOptions: a3 } = ei(t3);
|
|
1827
1826
|
if (this.formats[i3]) {
|
|
1828
1827
|
let t4 = e7;
|
|
1829
1828
|
try {
|
|
@@ -1838,12 +1837,12 @@ var ni = class {
|
|
|
1838
1837
|
}, e6);
|
|
1839
1838
|
}
|
|
1840
1839
|
};
|
|
1841
|
-
var
|
|
1840
|
+
var ii = (e6, t2) => {
|
|
1842
1841
|
e6.pending[t2] !== void 0 && (delete e6.pending[t2], e6.pendingCount--);
|
|
1843
1842
|
};
|
|
1844
|
-
var
|
|
1843
|
+
var ai = class extends zr {
|
|
1845
1844
|
constructor(e6, t2, n2, r2 = {}) {
|
|
1846
|
-
super(), this.backend = e6, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger =
|
|
1845
|
+
super(), this.backend = e6, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = V.create(`backendConnector`), this.waitingReads = [], this.maxParallelReads = r2.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r2.maxRetries >= 0 ? r2.maxRetries : 5, this.retryTimeout = r2.retryTimeout >= 1 ? r2.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n2, r2.backend, r2);
|
|
1847
1846
|
}
|
|
1848
1847
|
queueLoad(e6, t2, n2, r2) {
|
|
1849
1848
|
let i2 = {}, a2 = {}, o2 = {}, s2 = {};
|
|
@@ -1860,7 +1859,7 @@ var ii = class extends Rr {
|
|
|
1860
1859
|
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);
|
|
1861
1860
|
let o2 = {};
|
|
1862
1861
|
this.queue.forEach((n3) => {
|
|
1863
|
-
|
|
1862
|
+
Dr(n3.loaded, [i2], a2), ii(n3, e6), t2 && n3.errors.push(t2), n3.pendingCount === 0 && !n3.done && (Object.keys(n3.loaded).forEach((e7) => {
|
|
1864
1863
|
o2[e7] || (o2[e7] = {});
|
|
1865
1864
|
let t3 = n3.loaded[e7];
|
|
1866
1865
|
t3.length && t3.forEach((t4) => {
|
|
@@ -1895,7 +1894,7 @@ var ii = class extends Rr {
|
|
|
1895
1894
|
}
|
|
1896
1895
|
prepareLoading(e6, t2, n2 = {}, r2) {
|
|
1897
1896
|
if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
|
|
1898
|
-
|
|
1897
|
+
I(e6) && (e6 = this.languageUtils.toResolveHierarchy(e6)), I(t2) && (t2 = [t2]);
|
|
1899
1898
|
let i2 = this.queueLoad(e6, t2, n2, r2);
|
|
1900
1899
|
if (!i2.toLoad.length) return i2.pending.length || r2(), null;
|
|
1901
1900
|
i2.toLoad.forEach((e7) => {
|
|
@@ -1932,9 +1931,9 @@ var ii = class extends Rr {
|
|
|
1932
1931
|
}
|
|
1933
1932
|
}
|
|
1934
1933
|
};
|
|
1935
|
-
var
|
|
1934
|
+
var oi = () => ({ 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) => {
|
|
1936
1935
|
let t2 = {};
|
|
1937
|
-
if (typeof e6[1] == `object` && (t2 = e6[1]),
|
|
1936
|
+
if (typeof e6[1] == `object` && (t2 = e6[1]), I(e6[1]) && (t2.defaultValue = e6[1]), I(e6[2]) && (t2.tDescription = e6[2]), typeof e6[2] == `object` || typeof e6[3] == `object`) {
|
|
1938
1937
|
let n2 = e6[3] || e6[2];
|
|
1939
1938
|
Object.keys(n2).forEach((e7) => {
|
|
1940
1939
|
t2[e7] = n2[e7];
|
|
@@ -1942,17 +1941,17 @@ var ai = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS:
|
|
|
1942
1941
|
}
|
|
1943
1942
|
return t2;
|
|
1944
1943
|
}, interpolation: { escapeValue: true, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
1945
|
-
var
|
|
1946
|
-
var
|
|
1944
|
+
var si = (e6) => (I(e6.ns) && (e6.ns = [e6.ns]), I(e6.fallbackLng) && (e6.fallbackLng = [e6.fallbackLng]), I(e6.fallbackNS) && (e6.fallbackNS = [e6.fallbackNS]), e6.supportedLngs && !e6.supportedLngs.includes(`cimode`) && (e6.supportedLngs = e6.supportedLngs.concat([`cimode`])), e6);
|
|
1945
|
+
var ci = () => {
|
|
1947
1946
|
};
|
|
1948
|
-
var
|
|
1947
|
+
var li = (e6) => {
|
|
1949
1948
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e6)).forEach((t2) => {
|
|
1950
1949
|
typeof e6[t2] == `function` && (e6[t2] = e6[t2].bind(e6));
|
|
1951
1950
|
});
|
|
1952
1951
|
};
|
|
1953
|
-
var
|
|
1952
|
+
var U = class e4 extends zr {
|
|
1954
1953
|
constructor(e6 = {}, t2) {
|
|
1955
|
-
if (super(), this.options =
|
|
1954
|
+
if (super(), this.options = si(e6), this.services = {}, this.logger = V, this.modules = { external: [] }, li(this), t2 && !this.isInitialized && !e6.isClone) {
|
|
1956
1955
|
if (!this.options.initAsync) return this.init(e6, t2), this;
|
|
1957
1956
|
setTimeout(() => {
|
|
1958
1957
|
this.init(e6, t2);
|
|
@@ -1960,26 +1959,26 @@ var W = class e4 extends Rr {
|
|
|
1960
1959
|
}
|
|
1961
1960
|
}
|
|
1962
1961
|
init(e6 = {}, t2) {
|
|
1963
|
-
this.isInitializing = true, typeof e6 == `function` && (t2 = e6, e6 = {}), e6.defaultNS == null && e6.ns && (
|
|
1964
|
-
let n2 =
|
|
1965
|
-
this.options = { ...n2, ...this.options, ...
|
|
1962
|
+
this.isInitializing = true, typeof e6 == `function` && (t2 = e6, e6 = {}), e6.defaultNS == null && e6.ns && (I(e6.ns) ? e6.defaultNS = e6.ns : e6.ns.includes(`translation`) || (e6.defaultNS = e6.ns[0]));
|
|
1963
|
+
let n2 = oi();
|
|
1964
|
+
this.options = { ...n2, ...this.options, ...si(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);
|
|
1966
1965
|
let r2 = (e7) => e7 ? typeof e7 == `function` ? new e7() : e7 : null;
|
|
1967
1966
|
if (!this.options.isClone) {
|
|
1968
|
-
this.modules.logger ?
|
|
1967
|
+
this.modules.logger ? V.init(r2(this.modules.logger), this.options) : V.init(null, this.options);
|
|
1969
1968
|
let e7;
|
|
1970
|
-
e7 = this.modules.formatter ? this.modules.formatter :
|
|
1971
|
-
let t3 = new
|
|
1972
|
-
this.store = new
|
|
1969
|
+
e7 = this.modules.formatter ? this.modules.formatter : ri;
|
|
1970
|
+
let t3 = new qr(this.options);
|
|
1971
|
+
this.store = new Vr(this.options.resources, this.options);
|
|
1973
1972
|
let n3 = this.services;
|
|
1974
|
-
n3.logger =
|
|
1973
|
+
n3.logger = V, n3.resourceStore = this.store, n3.languageUtils = t3, n3.pluralResolver = new Xr(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 $r(this.options), n3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, n3.backendConnector = new ai(r2(this.modules.backend), n3.resourceStore, n3, this.options), n3.backendConnector.on(`*`, (e8, ...t4) => {
|
|
1975
1974
|
this.emit(e8, ...t4);
|
|
1976
|
-
}), 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
|
|
1975
|
+
}), 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 Kr(this.services, this.options), this.translator.on(`*`, (e8, ...t4) => {
|
|
1977
1976
|
this.emit(e8, ...t4);
|
|
1978
1977
|
}), this.modules.external.forEach((e8) => {
|
|
1979
1978
|
e8.init && e8.init(this);
|
|
1980
1979
|
});
|
|
1981
1980
|
}
|
|
1982
|
-
if (this.format = this.options.interpolation.format, t2 ||=
|
|
1981
|
+
if (this.format = this.options.interpolation.format, t2 ||= ci, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1983
1982
|
let e7 = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1984
1983
|
e7.length > 0 && e7[0] !== `dev` && (this.options.lng = e7[0]);
|
|
1985
1984
|
}
|
|
@@ -1988,7 +1987,7 @@ var W = class e4 extends Rr {
|
|
|
1988
1987
|
}), [`addResource`, `addResources`, `addResourceBundle`, `removeResourceBundle`].forEach((e7) => {
|
|
1989
1988
|
this[e7] = (...t3) => (this.store[e7](...t3), this);
|
|
1990
1989
|
});
|
|
1991
|
-
let i2 =
|
|
1990
|
+
let i2 = L(), a2 = () => {
|
|
1992
1991
|
let e7 = (e8, n3) => {
|
|
1993
1992
|
this.isInitializing = false, this.isInitialized && !this.initializedStoreOnce && this.logger.warn(`init: i18next is already initialized. You should call init just once!`), this.isInitialized = true, this.options.isClone || this.logger.log(`initialized`, this.options), this.emit(`initialized`, this.options), i2.resolve(n3), t2(e8, n3);
|
|
1994
1993
|
};
|
|
@@ -1997,8 +1996,8 @@ var W = class e4 extends Rr {
|
|
|
1997
1996
|
};
|
|
1998
1997
|
return this.options.resources || !this.options.initAsync ? a2() : setTimeout(a2, 0), i2;
|
|
1999
1998
|
}
|
|
2000
|
-
loadResources(e6, t2 =
|
|
2001
|
-
let n2 = t2, r2 =
|
|
1999
|
+
loadResources(e6, t2 = ci) {
|
|
2000
|
+
let n2 = t2, r2 = I(e6) ? e6 : this.language;
|
|
2002
2001
|
if (typeof e6 == `function` && (n2 = e6), !this.options.resources || this.options.partialBundledLanguages) {
|
|
2003
2002
|
if (r2?.toLowerCase() === `cimode` && (!this.options.preload || this.options.preload.length === 0)) return n2();
|
|
2004
2003
|
let e7 = [], t3 = (t4) => {
|
|
@@ -2012,15 +2011,15 @@ var W = class e4 extends Rr {
|
|
|
2012
2011
|
} else n2(null);
|
|
2013
2012
|
}
|
|
2014
2013
|
reloadResources(e6, t2, n2) {
|
|
2015
|
-
let r2 =
|
|
2016
|
-
return typeof e6 == `function` && (n2 = e6, e6 = void 0), typeof t2 == `function` && (n2 = t2, t2 = void 0), e6 ||= this.languages, t2 ||= this.options.ns, n2 ||=
|
|
2014
|
+
let r2 = L();
|
|
2015
|
+
return typeof e6 == `function` && (n2 = e6, e6 = void 0), typeof t2 == `function` && (n2 = t2, t2 = void 0), e6 ||= this.languages, t2 ||= this.options.ns, n2 ||= ci, this.services.backendConnector.reload(e6, t2, (e7) => {
|
|
2017
2016
|
r2.resolve(), n2(e7);
|
|
2018
2017
|
}), r2;
|
|
2019
2018
|
}
|
|
2020
2019
|
use(e6) {
|
|
2021
2020
|
if (!e6) throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
|
|
2022
2021
|
if (!e6.type) throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);
|
|
2023
|
-
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` &&
|
|
2022
|
+
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` && Hr.addPostProcessor(e6), e6.type === `formatter` && (this.modules.formatter = e6), e6.type === `3rdParty` && this.modules.external.push(e6), this;
|
|
2024
2023
|
}
|
|
2025
2024
|
setResolvedLanguage(e6) {
|
|
2026
2025
|
if (e6 && this.languages && ![`cimode`, `dev`].includes(e6)) {
|
|
@@ -2036,7 +2035,7 @@ var W = class e4 extends Rr {
|
|
|
2036
2035
|
}
|
|
2037
2036
|
changeLanguage(e6, t2) {
|
|
2038
2037
|
this.isLanguageChangingTo = e6;
|
|
2039
|
-
let n2 =
|
|
2038
|
+
let n2 = L();
|
|
2040
2039
|
this.emit(`languageChanging`, e6);
|
|
2041
2040
|
let r2 = (e7) => {
|
|
2042
2041
|
this.language = e7, this.languages = this.services.languageUtils.toResolveHierarchy(e7), this.resolvedLanguage = void 0, this.setResolvedLanguage(e7);
|
|
@@ -2044,7 +2043,7 @@ var W = class e4 extends Rr {
|
|
|
2044
2043
|
a3 ? this.isLanguageChangingTo === e6 && (r2(a3), this.translator.changeLanguage(a3), this.isLanguageChangingTo = void 0, this.emit(`languageChanged`, a3), this.logger.log(`languageChanged`, a3)) : this.isLanguageChangingTo = void 0, n2.resolve((...e7) => this.t(...e7)), t2 && t2(i3, (...e7) => this.t(...e7));
|
|
2045
2044
|
}, a2 = (t3) => {
|
|
2046
2045
|
!e6 && !t3 && this.services.languageDetector && (t3 = []);
|
|
2047
|
-
let n3 =
|
|
2046
|
+
let n3 = I(t3) ? t3 : t3 && t3[0], a3 = this.store.hasLanguageSomeTranslations(n3) ? n3 : this.services.languageUtils.getBestMatchFromCodes(I(t3) ? [t3] : t3);
|
|
2048
2047
|
a3 && (this.language || r2(a3), this.translator.language || this.translator.changeLanguage(a3), this.services.languageDetector?.cacheUserLanguage?.(a3)), this.loadResources(a3, (e7) => {
|
|
2049
2048
|
i2(e7, a3);
|
|
2050
2049
|
});
|
|
@@ -2058,11 +2057,11 @@ var W = class e4 extends Rr {
|
|
|
2058
2057
|
let s2 = o2.ns !== void 0 && o2.ns !== null;
|
|
2059
2058
|
o2.ns = o2.ns || a2.ns, o2.keyPrefix !== `` && (o2.keyPrefix = o2.keyPrefix || n2 || a2.keyPrefix);
|
|
2060
2059
|
let c2 = { ...this.options, ...o2 };
|
|
2061
|
-
Array.isArray(i2) && !s2 && (c2.ns = i2), typeof o2.keyPrefix == `function` && (o2.keyPrefix =
|
|
2060
|
+
Array.isArray(i2) && !s2 && (c2.ns = i2), typeof o2.keyPrefix == `function` && (o2.keyPrefix = H(o2.keyPrefix, c2));
|
|
2062
2061
|
let l2 = this.options.keySeparator || `.`, u2;
|
|
2063
|
-
return o2.keyPrefix && Array.isArray(e7) ? u2 = e7.map((e8) => (typeof e8 == `function` && (e8 =
|
|
2062
|
+
return o2.keyPrefix && Array.isArray(e7) ? u2 = e7.map((e8) => (typeof e8 == `function` && (e8 = H(e8, c2)), `${o2.keyPrefix}${l2}${e8}`)) : (typeof e7 == `function` && (e7 = H(e7, c2)), u2 = o2.keyPrefix ? `${o2.keyPrefix}${l2}${e7}` : e7), this.t(u2, o2);
|
|
2064
2063
|
};
|
|
2065
|
-
return
|
|
2064
|
+
return I(e6) ? a2.lng = e6 : a2.lngs = e6, a2.ns = t2, a2.keyPrefix = n2, a2;
|
|
2066
2065
|
}
|
|
2067
2066
|
t(...e6) {
|
|
2068
2067
|
return this.translator?.translate(...e6);
|
|
@@ -2091,16 +2090,16 @@ var W = class e4 extends Rr {
|
|
|
2091
2090
|
return !(s2 && !a2(s2, e6) || r2 && !a2(i2, e6));
|
|
2092
2091
|
}
|
|
2093
2092
|
loadNamespaces(e6, t2) {
|
|
2094
|
-
let n2 =
|
|
2095
|
-
return this.options.ns ? (
|
|
2093
|
+
let n2 = L();
|
|
2094
|
+
return this.options.ns ? (I(e6) && (e6 = [e6]), e6.forEach((e7) => {
|
|
2096
2095
|
this.options.ns.includes(e7) || this.options.ns.push(e7);
|
|
2097
2096
|
}), this.loadResources((e7) => {
|
|
2098
2097
|
n2.resolve(), t2 && t2(e7);
|
|
2099
2098
|
}), n2) : (t2 && t2(), Promise.resolve());
|
|
2100
2099
|
}
|
|
2101
2100
|
loadLanguages(e6, t2) {
|
|
2102
|
-
let n2 =
|
|
2103
|
-
|
|
2101
|
+
let n2 = L();
|
|
2102
|
+
I(e6) && (e6 = [e6]);
|
|
2104
2103
|
let r2 = this.options.preload || [], i2 = e6.filter((e7) => !r2.includes(e7) && this.services.languageUtils.isSupportedCode(e7));
|
|
2105
2104
|
return i2.length ? (this.options.preload = r2.concat(i2), this.loadResources((e7) => {
|
|
2106
2105
|
n2.resolve(), t2 && t2(e7);
|
|
@@ -2116,24 +2115,24 @@ var W = class e4 extends Rr {
|
|
|
2116
2115
|
}
|
|
2117
2116
|
} catch {
|
|
2118
2117
|
}
|
|
2119
|
-
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
|
|
2118
|
+
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 qr(oi());
|
|
2120
2119
|
return e6.toLowerCase().indexOf(`-latn`) > 1 ? `ltr` : t2.includes(n2.getLanguagePartFromCode(e6)) || e6.toLowerCase().indexOf(`-arab`) > 1 ? `rtl` : `ltr`;
|
|
2121
2120
|
}
|
|
2122
2121
|
static createInstance(t2 = {}, n2) {
|
|
2123
2122
|
let r2 = new e4(t2, n2);
|
|
2124
2123
|
return r2.createInstance = e4.createInstance, r2;
|
|
2125
2124
|
}
|
|
2126
|
-
cloneInstance(t2 = {}, n2 =
|
|
2125
|
+
cloneInstance(t2 = {}, n2 = ci) {
|
|
2127
2126
|
let r2 = t2.forkResourceStore;
|
|
2128
2127
|
r2 && delete t2.forkResourceStore;
|
|
2129
2128
|
let i2 = { ...this.options, preload: false, ...t2, isClone: true }, a2 = new e4(i2);
|
|
2130
2129
|
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e6) => {
|
|
2131
2130
|
a2[e6] = this[e6];
|
|
2132
|
-
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new
|
|
2133
|
-
let e6 = { ...
|
|
2134
|
-
a2.services.interpolator = new
|
|
2131
|
+
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new Vr(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) {
|
|
2132
|
+
let e6 = { ...oi().interpolation, ...this.options.interpolation, ...t2.interpolation }, n3 = { ...i2, interpolation: e6 };
|
|
2133
|
+
a2.services.interpolator = new $r(n3);
|
|
2135
2134
|
}
|
|
2136
|
-
return a2.translator = new
|
|
2135
|
+
return a2.translator = new Kr(a2.services, i2), a2.translator.on(`*`, (e6, ...t3) => {
|
|
2137
2136
|
a2.emit(e6, ...t3);
|
|
2138
2137
|
}), a2.init(i2, n2), a2.translator.options = i2, a2.translator.backendConnector.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, a2;
|
|
2139
2138
|
}
|
|
@@ -2141,9 +2140,9 @@ var W = class e4 extends Rr {
|
|
|
2141
2140
|
return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
|
|
2142
2141
|
}
|
|
2143
2142
|
}.createInstance();
|
|
2144
|
-
|
|
2145
|
-
var
|
|
2146
|
-
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 =
|
|
2143
|
+
U.createInstance, U.dir, U.init, U.loadResources, U.reloadResources, U.use, U.changeLanguage, U.getFixedT, U.t, U.exists, U.setDefaultNamespace, U.hasLoadedNamespace, U.loadNamespaces, U.loadLanguages;
|
|
2144
|
+
var ui = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 = false, disableAutoInit: i2 = false, bindI18n: a2 }, { icu: o2 } = {}) => {
|
|
2145
|
+
let s2 = { lng: e6, fallbackLng: `en`, keySeparator: false, react: { useSuspense: r2, bindI18n: a2 }, _polyfill: { isLoading: false } }, c2 = U.createInstance(i2 ? s2 : void 0);
|
|
2147
2146
|
return o2 && c2.use(o2), t2 && c2.use({ type: `backend`, read: async (e7, n3, r3) => {
|
|
2148
2147
|
try {
|
|
2149
2148
|
return r3(null, await t2(e7));
|
|
@@ -2152,38 +2151,38 @@ var li = ({ locale: e6, asyncMessagesLoader: t2, messages: n2, useSuspense: r2 =
|
|
|
2152
2151
|
}
|
|
2153
2152
|
} }), n2 && (s2.resources = { [e6]: { translation: n2 } }), i2 || c2.init(s2), c2;
|
|
2154
2153
|
};
|
|
2155
|
-
function
|
|
2156
|
-
let n2 = t2 && t2.cache ? t2.cache :
|
|
2157
|
-
return (t2 && t2.strategy ? t2.strategy :
|
|
2154
|
+
function di(e6, t2) {
|
|
2155
|
+
let n2 = t2 && t2.cache ? t2.cache : xi, r2 = t2 && t2.serializer ? t2.serializer : yi;
|
|
2156
|
+
return (t2 && t2.strategy ? t2.strategy : gi)(e6, { cache: n2, serializer: r2 });
|
|
2158
2157
|
}
|
|
2159
|
-
function
|
|
2158
|
+
function fi(e6) {
|
|
2160
2159
|
return e6 == null || typeof e6 == `number` || typeof e6 == `boolean`;
|
|
2161
2160
|
}
|
|
2162
|
-
function
|
|
2163
|
-
let i2 =
|
|
2161
|
+
function pi(e6, t2, n2, r2) {
|
|
2162
|
+
let i2 = fi(r2) ? r2 : n2(r2), a2 = t2.get(i2);
|
|
2164
2163
|
return a2 === void 0 && (a2 = e6.call(this, r2), t2.set(i2, a2)), a2;
|
|
2165
2164
|
}
|
|
2166
|
-
function
|
|
2165
|
+
function mi(e6, t2, n2) {
|
|
2167
2166
|
let r2 = Array.prototype.slice.call(arguments, 3), i2 = n2(r2), a2 = t2.get(i2);
|
|
2168
2167
|
return a2 === void 0 && (a2 = e6.apply(this, r2), t2.set(i2, a2)), a2;
|
|
2169
2168
|
}
|
|
2170
|
-
function
|
|
2169
|
+
function hi(e6, t2, n2, r2, i2) {
|
|
2171
2170
|
return n2.bind(t2, e6, r2, i2);
|
|
2172
2171
|
}
|
|
2173
|
-
function hi(e6, t2) {
|
|
2174
|
-
let n2 = e6.length === 1 ? fi : pi;
|
|
2175
|
-
return mi(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2176
|
-
}
|
|
2177
2172
|
function gi(e6, t2) {
|
|
2178
|
-
|
|
2173
|
+
let n2 = e6.length === 1 ? pi : mi;
|
|
2174
|
+
return hi(e6, this, n2, t2.cache.create(), t2.serializer);
|
|
2179
2175
|
}
|
|
2180
2176
|
function _i(e6, t2) {
|
|
2181
|
-
return
|
|
2177
|
+
return hi(e6, this, mi, t2.cache.create(), t2.serializer);
|
|
2178
|
+
}
|
|
2179
|
+
function vi(e6, t2) {
|
|
2180
|
+
return hi(e6, this, pi, t2.cache.create(), t2.serializer);
|
|
2182
2181
|
}
|
|
2183
|
-
var
|
|
2182
|
+
var yi = function() {
|
|
2184
2183
|
return JSON.stringify(arguments);
|
|
2185
2184
|
};
|
|
2186
|
-
var
|
|
2185
|
+
var bi = class {
|
|
2187
2186
|
constructor() {
|
|
2188
2187
|
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2189
2188
|
}
|
|
@@ -2194,14 +2193,14 @@ var yi = class {
|
|
|
2194
2193
|
this.cache[e6] = t2;
|
|
2195
2194
|
}
|
|
2196
2195
|
};
|
|
2197
|
-
var
|
|
2198
|
-
return new
|
|
2196
|
+
var xi = { create: function() {
|
|
2197
|
+
return new bi();
|
|
2199
2198
|
} };
|
|
2200
|
-
var
|
|
2201
|
-
var
|
|
2202
|
-
function
|
|
2199
|
+
var Si = { variadic: _i, monadic: vi };
|
|
2200
|
+
var Ci = /(?:[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;
|
|
2201
|
+
function wi(e6) {
|
|
2203
2202
|
let t2 = {};
|
|
2204
|
-
return e6.replace(
|
|
2203
|
+
return e6.replace(Ci, (e7) => {
|
|
2205
2204
|
let n2 = e7.length;
|
|
2206
2205
|
switch (e7[0]) {
|
|
2207
2206
|
case `G`:
|
|
@@ -2288,10 +2287,10 @@ function Ci(e6) {
|
|
|
2288
2287
|
return ``;
|
|
2289
2288
|
}), t2;
|
|
2290
2289
|
}
|
|
2291
|
-
var
|
|
2292
|
-
function
|
|
2290
|
+
var Ti = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
2291
|
+
function Ei(e6) {
|
|
2293
2292
|
if (e6.length === 0) throw Error(`Number skeleton cannot be empty`);
|
|
2294
|
-
let t2 = e6.split(
|
|
2293
|
+
let t2 = e6.split(Ti).filter((e7) => e7.length > 0), n2 = [];
|
|
2295
2294
|
for (let e7 of t2) {
|
|
2296
2295
|
let t3 = e7.split(`/`);
|
|
2297
2296
|
if (t3.length === 0) throw Error(`Invalid number skeleton`);
|
|
@@ -2301,20 +2300,20 @@ function Ti(e6) {
|
|
|
2301
2300
|
}
|
|
2302
2301
|
return n2;
|
|
2303
2302
|
}
|
|
2304
|
-
function
|
|
2303
|
+
function Di(e6) {
|
|
2305
2304
|
return e6.replace(/^(.*?)-/, ``);
|
|
2306
2305
|
}
|
|
2307
|
-
var
|
|
2308
|
-
var
|
|
2309
|
-
var
|
|
2310
|
-
var
|
|
2311
|
-
function
|
|
2306
|
+
var Oi = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
2307
|
+
var ki = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
2308
|
+
var Ai = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
2309
|
+
var ji = /^(0+)$/;
|
|
2310
|
+
function Mi(e6) {
|
|
2312
2311
|
let t2 = {};
|
|
2313
|
-
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(
|
|
2312
|
+
return e6[e6.length - 1] === `r` ? t2.roundingPriority = `morePrecision` : e6[e6.length - 1] === `s` && (t2.roundingPriority = `lessPrecision`), e6.replace(ki, function(e7, n2, r2) {
|
|
2314
2313
|
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), ``;
|
|
2315
2314
|
}), t2;
|
|
2316
2315
|
}
|
|
2317
|
-
function
|
|
2316
|
+
function Ni(e6) {
|
|
2318
2317
|
switch (e6) {
|
|
2319
2318
|
case `sign-auto`:
|
|
2320
2319
|
return { signDisplay: `auto` };
|
|
@@ -2338,19 +2337,19 @@ function Mi(e6) {
|
|
|
2338
2337
|
return { signDisplay: `never` };
|
|
2339
2338
|
}
|
|
2340
2339
|
}
|
|
2341
|
-
function
|
|
2340
|
+
function Pi(e6) {
|
|
2342
2341
|
let t2;
|
|
2343
2342
|
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) {
|
|
2344
2343
|
let n2 = e6.slice(0, 2);
|
|
2345
|
-
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !
|
|
2344
|
+
if (n2 === `+!` ? (t2.signDisplay = `always`, e6 = e6.slice(2)) : n2 === `+?` && (t2.signDisplay = `exceptZero`, e6 = e6.slice(2)), !ji.test(e6)) throw Error(`Malformed concise eng/scientific notation`);
|
|
2346
2345
|
t2.minimumIntegerDigits = e6.length;
|
|
2347
2346
|
}
|
|
2348
2347
|
return t2;
|
|
2349
2348
|
}
|
|
2350
|
-
function Pi(e6) {
|
|
2351
|
-
return Mi(e6) || {};
|
|
2352
|
-
}
|
|
2353
2349
|
function Fi(e6) {
|
|
2350
|
+
return Ni(e6) || {};
|
|
2351
|
+
}
|
|
2352
|
+
function Ii(e6) {
|
|
2354
2353
|
let t2 = {};
|
|
2355
2354
|
for (let n2 of e6) {
|
|
2356
2355
|
switch (n2.stem) {
|
|
@@ -2374,7 +2373,7 @@ function Fi(e6) {
|
|
|
2374
2373
|
continue;
|
|
2375
2374
|
case `measure-unit`:
|
|
2376
2375
|
case `unit`:
|
|
2377
|
-
t2.style = `unit`, t2.unit =
|
|
2376
|
+
t2.style = `unit`, t2.unit = Di(n2.options[0]);
|
|
2378
2377
|
continue;
|
|
2379
2378
|
case `compact-short`:
|
|
2380
2379
|
case `K`:
|
|
@@ -2385,10 +2384,10 @@ function Fi(e6) {
|
|
|
2385
2384
|
t2.notation = `compact`, t2.compactDisplay = `long`;
|
|
2386
2385
|
continue;
|
|
2387
2386
|
case `scientific`:
|
|
2388
|
-
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2387
|
+
t2 = { ...t2, notation: `scientific`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...Fi(t3) }), {}) };
|
|
2389
2388
|
continue;
|
|
2390
2389
|
case `engineering`:
|
|
2391
|
-
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...
|
|
2390
|
+
t2 = { ...t2, notation: `engineering`, ...n2.options.reduce((e8, t3) => ({ ...e8, ...Fi(t3) }), {}) };
|
|
2392
2391
|
continue;
|
|
2393
2392
|
case `notation-simple`:
|
|
2394
2393
|
t2.notation = `standard`;
|
|
@@ -2431,7 +2430,7 @@ function Fi(e6) {
|
|
|
2431
2430
|
continue;
|
|
2432
2431
|
case `integer-width`:
|
|
2433
2432
|
if (n2.options.length > 1) throw RangeError(`integer-width stems only accept a single optional option`);
|
|
2434
|
-
n2.options[0].replace(
|
|
2433
|
+
n2.options[0].replace(Ai, function(e8, n3, r3, i2, a2, o2) {
|
|
2435
2434
|
if (n3) t2.minimumIntegerDigits = r3.length;
|
|
2436
2435
|
else if (i2 && a2) throw Error(`We currently do not support maximum integer digits`);
|
|
2437
2436
|
else if (o2) throw Error(`We currently do not support exact integer digits`);
|
|
@@ -2439,83 +2438,83 @@ function Fi(e6) {
|
|
|
2439
2438
|
});
|
|
2440
2439
|
continue;
|
|
2441
2440
|
}
|
|
2442
|
-
if (
|
|
2441
|
+
if (ji.test(n2.stem)) {
|
|
2443
2442
|
t2.minimumIntegerDigits = n2.stem.length;
|
|
2444
2443
|
continue;
|
|
2445
2444
|
}
|
|
2446
|
-
if (
|
|
2445
|
+
if (Oi.test(n2.stem)) {
|
|
2447
2446
|
if (n2.options.length > 1) throw RangeError(`Fraction-precision stems only accept a single optional option`);
|
|
2448
|
-
n2.stem.replace(
|
|
2447
|
+
n2.stem.replace(Oi, function(e9, n3, r3, i2, a2, o2) {
|
|
2449
2448
|
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), ``;
|
|
2450
2449
|
});
|
|
2451
2450
|
let e8 = n2.options[0];
|
|
2452
|
-
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...
|
|
2451
|
+
e8 === `w` ? t2 = { ...t2, trailingZeroDisplay: `stripIfInteger` } : e8 && (t2 = { ...t2, ...Mi(e8) });
|
|
2453
2452
|
continue;
|
|
2454
2453
|
}
|
|
2455
|
-
if (
|
|
2456
|
-
t2 = { ...t2, ...
|
|
2454
|
+
if (ki.test(n2.stem)) {
|
|
2455
|
+
t2 = { ...t2, ...Mi(n2.stem) };
|
|
2457
2456
|
continue;
|
|
2458
2457
|
}
|
|
2459
|
-
let e7 =
|
|
2458
|
+
let e7 = Ni(n2.stem);
|
|
2460
2459
|
e7 && (t2 = { ...t2, ...e7 });
|
|
2461
|
-
let r2 =
|
|
2460
|
+
let r2 = Pi(n2.stem);
|
|
2462
2461
|
r2 && (t2 = { ...t2, ...r2 });
|
|
2463
2462
|
}
|
|
2464
2463
|
return t2;
|
|
2465
2464
|
}
|
|
2466
|
-
var
|
|
2465
|
+
var Li = function(e6) {
|
|
2467
2466
|
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;
|
|
2468
2467
|
}({});
|
|
2469
|
-
function
|
|
2468
|
+
function Ri(e6) {
|
|
2470
2469
|
return e6.type === 0;
|
|
2471
2470
|
}
|
|
2472
|
-
function
|
|
2471
|
+
function zi(e6) {
|
|
2473
2472
|
return e6.type === 1;
|
|
2474
2473
|
}
|
|
2475
|
-
function
|
|
2474
|
+
function Bi(e6) {
|
|
2476
2475
|
return e6.type === 2;
|
|
2477
2476
|
}
|
|
2478
|
-
function
|
|
2477
|
+
function Vi(e6) {
|
|
2479
2478
|
return e6.type === 3;
|
|
2480
2479
|
}
|
|
2481
|
-
function
|
|
2480
|
+
function Hi(e6) {
|
|
2482
2481
|
return e6.type === 4;
|
|
2483
2482
|
}
|
|
2484
|
-
function
|
|
2483
|
+
function Ui(e6) {
|
|
2485
2484
|
return e6.type === 5;
|
|
2486
2485
|
}
|
|
2487
|
-
function
|
|
2486
|
+
function Wi(e6) {
|
|
2488
2487
|
return e6.type === 6;
|
|
2489
2488
|
}
|
|
2490
|
-
function
|
|
2489
|
+
function Gi(e6) {
|
|
2491
2490
|
return e6.type === 7;
|
|
2492
2491
|
}
|
|
2493
|
-
function
|
|
2492
|
+
function Ki(e6) {
|
|
2494
2493
|
return e6.type === 8;
|
|
2495
2494
|
}
|
|
2496
|
-
function
|
|
2495
|
+
function qi(e6) {
|
|
2497
2496
|
return !!(e6 && typeof e6 == `object` && e6.type === 0);
|
|
2498
2497
|
}
|
|
2499
|
-
function
|
|
2498
|
+
function Ji(e6) {
|
|
2500
2499
|
return !!(e6 && typeof e6 == `object` && e6.type === 1);
|
|
2501
2500
|
}
|
|
2502
|
-
var
|
|
2503
|
-
var
|
|
2504
|
-
function
|
|
2501
|
+
var Yi = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
2502
|
+
var W = { "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`] };
|
|
2503
|
+
function Xi(e6, t2) {
|
|
2505
2504
|
let n2 = ``;
|
|
2506
2505
|
for (let r2 = 0; r2 < e6.length; r2++) {
|
|
2507
2506
|
let i2 = e6.charAt(r2);
|
|
2508
2507
|
if (i2 === `j`) {
|
|
2509
2508
|
let a2 = 0;
|
|
2510
2509
|
for (; r2 + 1 < e6.length && e6.charAt(r2 + 1) === i2; ) a2++, r2++;
|
|
2511
|
-
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 =
|
|
2510
|
+
let o2 = 1 + (a2 & 1), s2 = a2 < 2 ? 1 : 3 + (a2 >> 1), c2 = Zi(t2);
|
|
2512
2511
|
for ((c2 == `H` || c2 == `k`) && (s2 = 0); s2-- > 0; ) n2 += `a`;
|
|
2513
2512
|
for (; o2-- > 0; ) n2 = c2 + n2;
|
|
2514
2513
|
} else n2 += i2 === `J` ? `H` : i2;
|
|
2515
2514
|
}
|
|
2516
2515
|
return n2;
|
|
2517
2516
|
}
|
|
2518
|
-
function
|
|
2517
|
+
function Zi(e6) {
|
|
2519
2518
|
let t2 = e6.hourCycle;
|
|
2520
2519
|
if (t2 === void 0) {
|
|
2521
2520
|
let n3 = e6;
|
|
@@ -2534,36 +2533,36 @@ function Xi(e6) {
|
|
|
2534
2533
|
throw Error(`Invalid hourCycle`);
|
|
2535
2534
|
}
|
|
2536
2535
|
let n2 = e6.language, r2;
|
|
2537
|
-
return n2 !== `root` && (r2 = e6.maximize().region), (
|
|
2536
|
+
return n2 !== `root` && (r2 = e6.maximize().region), (W[`${n2}-${r2}`] || W[r2 || ``] || W[n2 || ``] || W[`${n2}-001`] || W[`001`])[0].charAt(0);
|
|
2538
2537
|
}
|
|
2539
|
-
var
|
|
2540
|
-
var
|
|
2541
|
-
function
|
|
2538
|
+
var Qi = RegExp(`^${Yi.source}*`);
|
|
2539
|
+
var $i = RegExp(`${Yi.source}*$`);
|
|
2540
|
+
function G(e6, t2) {
|
|
2542
2541
|
return { start: e6, end: t2 };
|
|
2543
2542
|
}
|
|
2544
|
-
var
|
|
2545
|
-
var
|
|
2546
|
-
var
|
|
2547
|
-
var
|
|
2543
|
+
var ea = !!Object.fromEntries;
|
|
2544
|
+
var ta = !!String.prototype.trimStart;
|
|
2545
|
+
var na = !!String.prototype.trimEnd;
|
|
2546
|
+
var ra = ea ? Object.fromEntries : function(e6) {
|
|
2548
2547
|
let t2 = {};
|
|
2549
2548
|
for (let [n2, r2] of e6) t2[n2] = r2;
|
|
2550
2549
|
return t2;
|
|
2551
2550
|
};
|
|
2552
|
-
var
|
|
2551
|
+
var ia = ta ? function(e6) {
|
|
2553
2552
|
return e6.trimStart();
|
|
2554
2553
|
} : function(e6) {
|
|
2555
|
-
return e6.replace(
|
|
2554
|
+
return e6.replace(Qi, ``);
|
|
2556
2555
|
};
|
|
2557
|
-
var
|
|
2556
|
+
var aa = na ? function(e6) {
|
|
2558
2557
|
return e6.trimEnd();
|
|
2559
2558
|
} : function(e6) {
|
|
2560
|
-
return e6.replace(
|
|
2559
|
+
return e6.replace($i, ``);
|
|
2561
2560
|
};
|
|
2562
|
-
var
|
|
2563
|
-
function
|
|
2564
|
-
return
|
|
2561
|
+
var oa = RegExp(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`, `yu`);
|
|
2562
|
+
function sa(e6, t2) {
|
|
2563
|
+
return oa.lastIndex = t2, oa.exec(e6)[1] ?? ``;
|
|
2565
2564
|
}
|
|
2566
|
-
function
|
|
2565
|
+
function ca(e6) {
|
|
2567
2566
|
if (e6.length === 0) return null;
|
|
2568
2567
|
let t2 = 1, n2 = 1;
|
|
2569
2568
|
for (let r2 = 0; r2 < e6.length; ) {
|
|
@@ -2584,7 +2583,7 @@ function sa(e6) {
|
|
|
2584
2583
|
}
|
|
2585
2584
|
return { offset: e6.length, line: t2, column: n2 };
|
|
2586
2585
|
}
|
|
2587
|
-
var
|
|
2586
|
+
var la = class {
|
|
2588
2587
|
constructor(e6, t2 = {}) {
|
|
2589
2588
|
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;
|
|
2590
2589
|
}
|
|
@@ -2593,10 +2592,10 @@ var ca = class {
|
|
|
2593
2592
|
if (this.message.length > 0) {
|
|
2594
2593
|
let e6 = this.message.charCodeAt(0);
|
|
2595
2594
|
if (e6 !== 35 && e6 !== 39 && e6 !== 60 && e6 !== 123 && e6 !== 125) {
|
|
2596
|
-
let e7 =
|
|
2595
|
+
let e7 = ca(this.message);
|
|
2597
2596
|
if (e7) {
|
|
2598
2597
|
let t2 = this.clonePosition();
|
|
2599
|
-
return this.position = e7, { val: [{ type: 0, value: this.message, location:
|
|
2598
|
+
return this.position = e7, { val: [{ type: 0, value: this.message, location: G(t2, this.clonePosition()) }], err: null };
|
|
2600
2599
|
}
|
|
2601
2600
|
}
|
|
2602
2601
|
}
|
|
@@ -2613,11 +2612,11 @@ var ca = class {
|
|
|
2613
2612
|
} else if (i2 === 125 && e6 > 0) break;
|
|
2614
2613
|
else if (i2 === 35 && (t2 === `plural` || t2 === `selectordinal`)) {
|
|
2615
2614
|
let e7 = this.clonePosition();
|
|
2616
|
-
this.bump(), r2.push({ type: 7, location:
|
|
2615
|
+
this.bump(), r2.push({ type: 7, location: G(e7, this.clonePosition()) });
|
|
2617
2616
|
} else if (i2 === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
2618
2617
|
if (n2) break;
|
|
2619
|
-
return this.error(26,
|
|
2620
|
-
} else if (i2 === 60 && !this.ignoreTag &&
|
|
2618
|
+
return this.error(26, G(this.clonePosition(), this.clonePosition()));
|
|
2619
|
+
} else if (i2 === 60 && !this.ignoreTag && ua(this.peek() || 0)) {
|
|
2621
2620
|
let n3 = this.parseTag(e6, t2);
|
|
2622
2621
|
if (n3.err) return n3;
|
|
2623
2622
|
r2.push(n3.val);
|
|
@@ -2633,23 +2632,23 @@ var ca = class {
|
|
|
2633
2632
|
let n2 = this.clonePosition();
|
|
2634
2633
|
this.bump();
|
|
2635
2634
|
let r2 = this.parseTagName();
|
|
2636
|
-
if (this.bumpSpace(), this.bumpIf(`/>`)) return { val: { type: 0, value: `<${r2}/>`, location:
|
|
2635
|
+
if (this.bumpSpace(), this.bumpIf(`/>`)) return { val: { type: 0, value: `<${r2}/>`, location: G(n2, this.clonePosition()) }, err: null };
|
|
2637
2636
|
if (this.bumpIf(`>`)) {
|
|
2638
2637
|
let i2 = this.parseMessage(e6 + 1, t2, true);
|
|
2639
2638
|
if (i2.err) return i2;
|
|
2640
2639
|
let a2 = i2.val, o2 = this.clonePosition();
|
|
2641
2640
|
if (this.bumpIf(`</`)) {
|
|
2642
|
-
if (this.isEOF() || !
|
|
2641
|
+
if (this.isEOF() || !ua(this.char())) return this.error(23, G(o2, this.clonePosition()));
|
|
2643
2642
|
let e7 = this.clonePosition();
|
|
2644
|
-
return r2 === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? { val: { type: 8, value: r2, children: a2, location:
|
|
2643
|
+
return r2 === this.parseTagName() ? (this.bumpSpace(), this.bumpIf(`>`) ? { val: { type: 8, value: r2, children: a2, location: G(n2, this.clonePosition()) }, err: null } : this.error(23, G(o2, this.clonePosition()))) : this.error(26, G(e7, this.clonePosition()));
|
|
2645
2644
|
}
|
|
2646
|
-
return this.error(27,
|
|
2645
|
+
return this.error(27, G(n2, this.clonePosition()));
|
|
2647
2646
|
}
|
|
2648
|
-
return this.error(23,
|
|
2647
|
+
return this.error(23, G(n2, this.clonePosition()));
|
|
2649
2648
|
}
|
|
2650
2649
|
parseTagName() {
|
|
2651
2650
|
let e6 = this.offset();
|
|
2652
|
-
for (this.bump(); !this.isEOF() &&
|
|
2651
|
+
for (this.bump(); !this.isEOF() && fa(this.char()); ) this.bump();
|
|
2653
2652
|
return this.message.slice(e6, this.offset());
|
|
2654
2653
|
}
|
|
2655
2654
|
parseLiteral(e6, t2) {
|
|
@@ -2669,11 +2668,11 @@ var ca = class {
|
|
|
2669
2668
|
if (a2) r2 += a2;
|
|
2670
2669
|
else break;
|
|
2671
2670
|
}
|
|
2672
|
-
let i2 =
|
|
2671
|
+
let i2 = G(n2, this.clonePosition());
|
|
2673
2672
|
return { val: { type: 0, value: r2, location: i2 }, err: null };
|
|
2674
2673
|
}
|
|
2675
2674
|
tryParseLeftAngleBracket() {
|
|
2676
|
-
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !
|
|
2675
|
+
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || !da(this.peek() || 0)) ? (this.bump(), `<`) : null;
|
|
2677
2676
|
}
|
|
2678
2677
|
tryParseQuote(e6) {
|
|
2679
2678
|
if (this.isEOF() || this.char() !== 39) return null;
|
|
@@ -2713,29 +2712,29 @@ var ca = class {
|
|
|
2713
2712
|
}
|
|
2714
2713
|
parseArgument(e6, t2) {
|
|
2715
2714
|
let n2 = this.clonePosition();
|
|
2716
|
-
if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(1,
|
|
2717
|
-
if (this.char() === 125) return this.bump(), this.error(2,
|
|
2715
|
+
if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(1, G(n2, this.clonePosition()));
|
|
2716
|
+
if (this.char() === 125) return this.bump(), this.error(2, G(n2, this.clonePosition()));
|
|
2718
2717
|
let r2 = this.parseIdentifierIfPossible().value;
|
|
2719
|
-
if (!r2) return this.error(3,
|
|
2720
|
-
if (this.bumpSpace(), this.isEOF()) return this.error(1,
|
|
2718
|
+
if (!r2) return this.error(3, G(n2, this.clonePosition()));
|
|
2719
|
+
if (this.bumpSpace(), this.isEOF()) return this.error(1, G(n2, this.clonePosition()));
|
|
2721
2720
|
switch (this.char()) {
|
|
2722
2721
|
case 125:
|
|
2723
|
-
return this.bump(), { val: { type: 1, value: r2, location:
|
|
2722
|
+
return this.bump(), { val: { type: 1, value: r2, location: G(n2, this.clonePosition()) }, err: null };
|
|
2724
2723
|
case 44:
|
|
2725
|
-
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(1,
|
|
2724
|
+
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(1, G(n2, this.clonePosition())) : this.parseArgumentOptions(e6, t2, r2, n2);
|
|
2726
2725
|
default:
|
|
2727
|
-
return this.error(3,
|
|
2726
|
+
return this.error(3, G(n2, this.clonePosition()));
|
|
2728
2727
|
}
|
|
2729
2728
|
}
|
|
2730
2729
|
parseIdentifierIfPossible() {
|
|
2731
|
-
let e6 = this.clonePosition(), t2 = this.offset(), n2 =
|
|
2732
|
-
return this.bumpTo(r2), { value: n2, location:
|
|
2730
|
+
let e6 = this.clonePosition(), t2 = this.offset(), n2 = sa(this.message, t2), r2 = t2 + n2.length;
|
|
2731
|
+
return this.bumpTo(r2), { value: n2, location: G(e6, this.clonePosition()) };
|
|
2733
2732
|
}
|
|
2734
2733
|
parseArgumentOptions(e6, t2, n2, r2) {
|
|
2735
2734
|
let i2 = this.clonePosition(), a2 = this.parseIdentifierIfPossible().value, o2 = this.clonePosition();
|
|
2736
2735
|
switch (a2) {
|
|
2737
2736
|
case ``:
|
|
2738
|
-
return this.error(4,
|
|
2737
|
+
return this.error(4, G(i2, o2));
|
|
2739
2738
|
case `number`:
|
|
2740
2739
|
case `date`:
|
|
2741
2740
|
case `time`: {
|
|
@@ -2745,15 +2744,15 @@ var ca = class {
|
|
|
2745
2744
|
this.bumpSpace();
|
|
2746
2745
|
let t4 = this.clonePosition(), n3 = this.parseSimpleArgStyleIfPossible();
|
|
2747
2746
|
if (n3.err) return n3;
|
|
2748
|
-
let r3 =
|
|
2749
|
-
if (r3.length === 0) return this.error(6,
|
|
2750
|
-
e7 = { style: r3, styleLocation:
|
|
2747
|
+
let r3 = aa(n3.val);
|
|
2748
|
+
if (r3.length === 0) return this.error(6, G(this.clonePosition(), this.clonePosition()));
|
|
2749
|
+
e7 = { style: r3, styleLocation: G(t4, this.clonePosition()) };
|
|
2751
2750
|
}
|
|
2752
2751
|
let t3 = this.tryParseArgumentClose(r2);
|
|
2753
2752
|
if (t3.err) return t3;
|
|
2754
|
-
let i3 =
|
|
2753
|
+
let i3 = G(r2, this.clonePosition());
|
|
2755
2754
|
if (e7 && e7.style.startsWith(`::`)) {
|
|
2756
|
-
let t4 =
|
|
2755
|
+
let t4 = ia(e7.style.slice(2));
|
|
2757
2756
|
if (a2 === `number`) {
|
|
2758
2757
|
let r3 = this.parseNumberSkeletonFromString(t4, e7.styleLocation);
|
|
2759
2758
|
return r3.err ? r3 : { val: { type: 2, value: n2, location: i3, style: r3.val }, err: null };
|
|
@@ -2761,8 +2760,8 @@ var ca = class {
|
|
|
2761
2760
|
{
|
|
2762
2761
|
if (t4.length === 0) return this.error(10, i3);
|
|
2763
2762
|
let r3 = t4;
|
|
2764
|
-
this.locale && (r3 =
|
|
2765
|
-
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ?
|
|
2763
|
+
this.locale && (r3 = Xi(t4, this.locale));
|
|
2764
|
+
let o3 = { type: 1, pattern: r3, location: e7.styleLocation, parsedOptions: this.shouldParseSkeletons ? wi(r3) : {} };
|
|
2766
2765
|
return { val: { type: a2 === `date` ? 3 : 4, value: n2, location: i3, style: o3 }, err: null };
|
|
2767
2766
|
}
|
|
2768
2767
|
}
|
|
@@ -2772,11 +2771,11 @@ var ca = class {
|
|
|
2772
2771
|
case `selectordinal`:
|
|
2773
2772
|
case `select`: {
|
|
2774
2773
|
let i3 = this.clonePosition();
|
|
2775
|
-
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(12,
|
|
2774
|
+
if (this.bumpSpace(), !this.bumpIf(`,`)) return this.error(12, G(i3, { ...i3 }));
|
|
2776
2775
|
this.bumpSpace();
|
|
2777
2776
|
let o3 = this.parseIdentifierIfPossible(), s2 = 0;
|
|
2778
2777
|
if (a2 !== `select` && o3.value === `offset`) {
|
|
2779
|
-
if (!this.bumpIf(`:`)) return this.error(13,
|
|
2778
|
+
if (!this.bumpIf(`:`)) return this.error(13, G(this.clonePosition(), this.clonePosition()));
|
|
2780
2779
|
this.bumpSpace();
|
|
2781
2780
|
let e7 = this.tryParseDecimalInteger(13, 14);
|
|
2782
2781
|
if (e7.err) return e7;
|
|
@@ -2786,15 +2785,15 @@ var ca = class {
|
|
|
2786
2785
|
if (c2.err) return c2;
|
|
2787
2786
|
let l2 = this.tryParseArgumentClose(r2);
|
|
2788
2787
|
if (l2.err) return l2;
|
|
2789
|
-
let u2 =
|
|
2790
|
-
return a2 === `select` ? { val: { type: 5, value: n2, options:
|
|
2788
|
+
let u2 = G(r2, this.clonePosition());
|
|
2789
|
+
return a2 === `select` ? { val: { type: 5, value: n2, options: ra(c2.val), location: u2 }, err: null } : { val: { type: 6, value: n2, options: ra(c2.val), offset: s2, pluralType: a2 === `plural` ? `cardinal` : `ordinal`, location: u2 }, err: null };
|
|
2791
2790
|
}
|
|
2792
2791
|
default:
|
|
2793
|
-
return this.error(5,
|
|
2792
|
+
return this.error(5, G(i2, o2));
|
|
2794
2793
|
}
|
|
2795
2794
|
}
|
|
2796
2795
|
tryParseArgumentClose(e6) {
|
|
2797
|
-
return this.isEOF() || this.char() !== 125 ? this.error(1,
|
|
2796
|
+
return this.isEOF() || this.char() !== 125 ? this.error(1, G(e6, this.clonePosition())) : (this.bump(), { val: true, err: null });
|
|
2798
2797
|
}
|
|
2799
2798
|
parseSimpleArgStyleIfPossible() {
|
|
2800
2799
|
let e6 = 0, t2 = this.clonePosition();
|
|
@@ -2802,7 +2801,7 @@ var ca = class {
|
|
|
2802
2801
|
case 39: {
|
|
2803
2802
|
this.bump();
|
|
2804
2803
|
let e7 = this.clonePosition();
|
|
2805
|
-
if (!this.bumpUntil(`'`)) return this.error(11,
|
|
2804
|
+
if (!this.bumpUntil(`'`)) return this.error(11, G(e7, this.clonePosition()));
|
|
2806
2805
|
this.bump();
|
|
2807
2806
|
break;
|
|
2808
2807
|
}
|
|
@@ -2821,11 +2820,11 @@ var ca = class {
|
|
|
2821
2820
|
parseNumberSkeletonFromString(e6, t2) {
|
|
2822
2821
|
let n2 = [];
|
|
2823
2822
|
try {
|
|
2824
|
-
n2 =
|
|
2823
|
+
n2 = Ei(e6);
|
|
2825
2824
|
} catch {
|
|
2826
2825
|
return this.error(7, t2);
|
|
2827
2826
|
}
|
|
2828
|
-
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ?
|
|
2827
|
+
return { val: { type: 0, tokens: n2, location: t2, parsedOptions: this.shouldParseSkeletons ? Ii(n2) : {} }, err: null };
|
|
2829
2828
|
}
|
|
2830
2829
|
tryParsePluralOrSelectOptions(e6, t2, n2, r2) {
|
|
2831
2830
|
let i2 = false, a2 = [], o2 = /* @__PURE__ */ new Set(), { value: s2, location: c2 } = r2;
|
|
@@ -2835,20 +2834,20 @@ var ca = class {
|
|
|
2835
2834
|
if (t2 !== `select` && this.bumpIf(`=`)) {
|
|
2836
2835
|
let t3 = this.tryParseDecimalInteger(16, 19);
|
|
2837
2836
|
if (t3.err) return t3;
|
|
2838
|
-
c2 =
|
|
2837
|
+
c2 = G(e7, this.clonePosition()), s2 = this.message.slice(e7.offset, this.offset());
|
|
2839
2838
|
} else break;
|
|
2840
2839
|
}
|
|
2841
2840
|
if (o2.has(s2)) return this.error(t2 === `select` ? 21 : 20, c2);
|
|
2842
2841
|
s2 === `other` && (i2 = true), this.bumpSpace();
|
|
2843
2842
|
let r3 = this.clonePosition();
|
|
2844
|
-
if (!this.bumpIf(`{`)) return this.error(t2 === `select` ? 17 : 18,
|
|
2843
|
+
if (!this.bumpIf(`{`)) return this.error(t2 === `select` ? 17 : 18, G(this.clonePosition(), this.clonePosition()));
|
|
2845
2844
|
let l2 = this.parseMessage(e6 + 1, t2, n2);
|
|
2846
2845
|
if (l2.err) return l2;
|
|
2847
2846
|
let u2 = this.tryParseArgumentClose(r3);
|
|
2848
2847
|
if (u2.err) return u2;
|
|
2849
|
-
a2.push([s2, { value: l2.val, location:
|
|
2848
|
+
a2.push([s2, { value: l2.val, location: G(r3, this.clonePosition()) }]), o2.add(s2), this.bumpSpace(), { value: s2, location: c2 } = this.parseIdentifierIfPossible();
|
|
2850
2849
|
}
|
|
2851
|
-
return a2.length === 0 ? this.error(t2 === `select` ? 15 : 16,
|
|
2850
|
+
return a2.length === 0 ? this.error(t2 === `select` ? 15 : 16, G(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !i2 ? this.error(22, G(this.clonePosition(), this.clonePosition())) : { val: a2, err: null };
|
|
2852
2851
|
}
|
|
2853
2852
|
tryParseDecimalInteger(e6, t2) {
|
|
2854
2853
|
let n2 = 1, r2 = this.clonePosition();
|
|
@@ -2859,7 +2858,7 @@ var ca = class {
|
|
|
2859
2858
|
if (e7 >= 48 && e7 <= 57) i2 = true, a2 = a2 * 10 + (e7 - 48), this.bump();
|
|
2860
2859
|
else break;
|
|
2861
2860
|
}
|
|
2862
|
-
let o2 =
|
|
2861
|
+
let o2 = G(r2, this.clonePosition());
|
|
2863
2862
|
return i2 ? (a2 *= n2, Number.isSafeInteger(a2) ? { val: a2, err: null } : this.error(t2, o2)) : this.error(e6, o2);
|
|
2864
2863
|
}
|
|
2865
2864
|
offset() {
|
|
@@ -2907,7 +2906,7 @@ var ca = class {
|
|
|
2907
2906
|
}
|
|
2908
2907
|
}
|
|
2909
2908
|
bumpSpace() {
|
|
2910
|
-
for (; !this.isEOF() &&
|
|
2909
|
+
for (; !this.isEOF() && pa(this.char()); ) this.bump();
|
|
2911
2910
|
}
|
|
2912
2911
|
peek() {
|
|
2913
2912
|
if (this.isEOF()) return null;
|
|
@@ -2915,34 +2914,34 @@ var ca = class {
|
|
|
2915
2914
|
return this.message.charCodeAt(t2 + (e6 >= 65536 ? 2 : 1)) ?? null;
|
|
2916
2915
|
}
|
|
2917
2916
|
};
|
|
2918
|
-
function la(e6) {
|
|
2919
|
-
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
2920
|
-
}
|
|
2921
2917
|
function ua(e6) {
|
|
2922
|
-
return
|
|
2918
|
+
return e6 >= 97 && e6 <= 122 || e6 >= 65 && e6 <= 90;
|
|
2923
2919
|
}
|
|
2924
2920
|
function da(e6) {
|
|
2925
|
-
return e6
|
|
2921
|
+
return ua(e6) || e6 === 47;
|
|
2926
2922
|
}
|
|
2927
2923
|
function fa(e6) {
|
|
2928
|
-
return e6 >=
|
|
2924
|
+
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;
|
|
2929
2925
|
}
|
|
2930
2926
|
function pa(e6) {
|
|
2927
|
+
return e6 >= 9 && e6 <= 13 || e6 === 32 || e6 === 133 || e6 >= 8206 && e6 <= 8207 || e6 === 8232 || e6 === 8233;
|
|
2928
|
+
}
|
|
2929
|
+
function ma(e6) {
|
|
2931
2930
|
e6.forEach((e7) => {
|
|
2932
|
-
if (delete e7.location,
|
|
2933
|
-
else
|
|
2931
|
+
if (delete e7.location, Ui(e7) || Wi(e7)) for (let t2 in e7.options) delete e7.options[t2].location, ma(e7.options[t2].value);
|
|
2932
|
+
else Bi(e7) && qi(e7.style) || (Vi(e7) || Hi(e7)) && Ji(e7.style) ? delete e7.style.location : Ki(e7) && ma(e7.children);
|
|
2934
2933
|
});
|
|
2935
2934
|
}
|
|
2936
|
-
function
|
|
2935
|
+
function ha(e6, t2 = {}) {
|
|
2937
2936
|
t2 = { shouldParseSkeletons: true, requiresOtherClause: true, ...t2 };
|
|
2938
|
-
let n2 = new
|
|
2937
|
+
let n2 = new la(e6, t2).parse();
|
|
2939
2938
|
if (n2.err) {
|
|
2940
|
-
let e7 = SyntaxError(
|
|
2939
|
+
let e7 = SyntaxError(Li[n2.err.kind]);
|
|
2941
2940
|
throw e7.location = n2.err.location, e7.originalMessage = n2.err.message, e7;
|
|
2942
2941
|
}
|
|
2943
|
-
return t2?.captureLocation ||
|
|
2942
|
+
return t2?.captureLocation || ma(n2.val), n2.val;
|
|
2944
2943
|
}
|
|
2945
|
-
var
|
|
2944
|
+
var ga = class extends Error {
|
|
2946
2945
|
constructor(e6, t2, n2) {
|
|
2947
2946
|
super(e6), this.code = t2, this.originalMessage = n2;
|
|
2948
2947
|
}
|
|
@@ -2950,54 +2949,54 @@ var ha = class extends Error {
|
|
|
2950
2949
|
return `[formatjs Error: ${this.code}] ${this.message}`;
|
|
2951
2950
|
}
|
|
2952
2951
|
};
|
|
2953
|
-
var
|
|
2952
|
+
var _a = class extends ga {
|
|
2954
2953
|
constructor(e6, t2, n2, r2) {
|
|
2955
2954
|
super(`Invalid values for "${e6}": "${t2}". Options are "${Object.keys(n2).join(`", "`)}"`, `INVALID_VALUE`, r2);
|
|
2956
2955
|
}
|
|
2957
2956
|
};
|
|
2958
|
-
var
|
|
2957
|
+
var va = class extends ga {
|
|
2959
2958
|
constructor(e6, t2, n2) {
|
|
2960
2959
|
super(`Value for "${e6}" must be of type ${t2}`, `INVALID_VALUE`, n2);
|
|
2961
2960
|
}
|
|
2962
2961
|
};
|
|
2963
|
-
var
|
|
2962
|
+
var ya = class extends ga {
|
|
2964
2963
|
constructor(e6, t2) {
|
|
2965
2964
|
super(`The intl string context variable "${e6}" was not provided to the string "${t2}"`, `MISSING_VALUE`, t2);
|
|
2966
2965
|
}
|
|
2967
2966
|
};
|
|
2968
|
-
function
|
|
2967
|
+
function ba(e6) {
|
|
2969
2968
|
return e6.length < 2 ? e6 : e6.reduce((e7, t2) => {
|
|
2970
2969
|
let n2 = e7[e7.length - 1];
|
|
2971
2970
|
return !n2 || n2.type !== 0 || t2.type !== 0 ? e7.push(t2) : n2.value += t2.value, e7;
|
|
2972
2971
|
}, []);
|
|
2973
2972
|
}
|
|
2974
|
-
function
|
|
2973
|
+
function xa(e6) {
|
|
2975
2974
|
return typeof e6 == `function`;
|
|
2976
2975
|
}
|
|
2977
|
-
function
|
|
2978
|
-
if (e6.length === 1 &&
|
|
2976
|
+
function Sa(e6, t2, n2, r2, i2, a2, o2) {
|
|
2977
|
+
if (e6.length === 1 && Ri(e6[0])) return [{ type: 0, value: e6[0].value }];
|
|
2979
2978
|
let s2 = [];
|
|
2980
2979
|
for (let c2 of e6) {
|
|
2981
|
-
if (
|
|
2980
|
+
if (Ri(c2)) {
|
|
2982
2981
|
s2.push({ type: 0, value: c2.value });
|
|
2983
2982
|
continue;
|
|
2984
2983
|
}
|
|
2985
|
-
if (
|
|
2984
|
+
if (Gi(c2)) {
|
|
2986
2985
|
typeof a2 == `number` && s2.push({ type: 0, value: n2.getNumberFormat(t2).format(a2) });
|
|
2987
2986
|
continue;
|
|
2988
2987
|
}
|
|
2989
2988
|
let { value: e7 } = c2;
|
|
2990
|
-
if (!(i2 && e7 in i2)) throw new
|
|
2989
|
+
if (!(i2 && e7 in i2)) throw new ya(e7, o2);
|
|
2991
2990
|
let l2 = i2[e7];
|
|
2992
|
-
if (
|
|
2993
|
-
else if (
|
|
2994
|
-
let e8 = typeof c2.style == `string` ? r2.date[c2.style] :
|
|
2991
|
+
if (zi(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 });
|
|
2992
|
+
else if (Vi(c2)) {
|
|
2993
|
+
let e8 = typeof c2.style == `string` ? r2.date[c2.style] : Ji(c2.style) ? c2.style.parsedOptions : void 0;
|
|
2995
2994
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
2996
|
-
} else if (
|
|
2997
|
-
let e8 = typeof c2.style == `string` ? r2.time[c2.style] :
|
|
2995
|
+
} else if (Hi(c2)) {
|
|
2996
|
+
let e8 = typeof c2.style == `string` ? r2.time[c2.style] : Ji(c2.style) ? c2.style.parsedOptions : r2.time.medium;
|
|
2998
2997
|
s2.push({ type: 0, value: n2.getDateTimeFormat(t2, e8).format(l2) });
|
|
2999
|
-
} else if (
|
|
3000
|
-
let e8 = typeof c2.style == `string` ? r2.number[c2.style] :
|
|
2998
|
+
} else if (Bi(c2)) {
|
|
2999
|
+
let e8 = typeof c2.style == `string` ? r2.number[c2.style] : qi(c2.style) ? c2.style.parsedOptions : void 0;
|
|
3001
3000
|
if (e8 && e8.scale) {
|
|
3002
3001
|
let t3 = e8.scale || 1;
|
|
3003
3002
|
if (typeof l2 == `bigint`) {
|
|
@@ -3007,40 +3006,40 @@ function xa(e6, t2, n2, r2, i2, a2, o2) {
|
|
|
3007
3006
|
}
|
|
3008
3007
|
s2.push({ type: 0, value: n2.getNumberFormat(t2, e8).format(l2) });
|
|
3009
3008
|
} else {
|
|
3010
|
-
if (
|
|
3009
|
+
if (Ki(c2)) {
|
|
3011
3010
|
let { children: e8, value: l3 } = c2, u2 = i2[l3];
|
|
3012
|
-
if (!
|
|
3013
|
-
let d2 = u2(
|
|
3011
|
+
if (!xa(u2)) throw new va(l3, `function`, o2);
|
|
3012
|
+
let d2 = u2(Sa(e8, t2, n2, r2, i2, a2).map((e9) => e9.value));
|
|
3014
3013
|
Array.isArray(d2) || (d2 = [d2]), s2.push(...d2.map((e9) => ({ type: typeof e9 == `string` ? 0 : 1, value: e9 })));
|
|
3015
3014
|
}
|
|
3016
|
-
if (
|
|
3015
|
+
if (Ui(c2)) {
|
|
3017
3016
|
let e8 = l2, a3 = (Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0) || c2.options.other;
|
|
3018
|
-
if (!a3) throw new
|
|
3019
|
-
s2.push(...
|
|
3020
|
-
} else if (
|
|
3017
|
+
if (!a3) throw new _a(c2.value, l2, Object.keys(c2.options), o2);
|
|
3018
|
+
s2.push(...Sa(a3.value, t2, n2, r2, i2));
|
|
3019
|
+
} else if (Wi(c2)) {
|
|
3021
3020
|
let e8 = `=${l2}`, a3 = Object.prototype.hasOwnProperty.call(c2.options, e8) ? c2.options[e8] : void 0;
|
|
3022
3021
|
if (!a3) {
|
|
3023
|
-
if (!Intl.PluralRules) throw new
|
|
3022
|
+
if (!Intl.PluralRules) throw new ga(`Intl.PluralRules is not available in this environment.
|
|
3024
3023
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3025
3024
|
`, `MISSING_INTL_API`, o2);
|
|
3026
3025
|
let e9 = typeof l2 == `bigint` ? Number(l2) : l2, r3 = n2.getPluralRules(t2, { type: c2.pluralType }).select(e9 - (c2.offset || 0));
|
|
3027
3026
|
a3 = (Object.prototype.hasOwnProperty.call(c2.options, r3) ? c2.options[r3] : void 0) || c2.options.other;
|
|
3028
3027
|
}
|
|
3029
|
-
if (!a3) throw new
|
|
3028
|
+
if (!a3) throw new _a(c2.value, l2, Object.keys(c2.options), o2);
|
|
3030
3029
|
let u2 = typeof l2 == `bigint` ? Number(l2) : l2;
|
|
3031
|
-
s2.push(...
|
|
3030
|
+
s2.push(...Sa(a3.value, t2, n2, r2, i2, u2 - (c2.offset || 0)));
|
|
3032
3031
|
}
|
|
3033
3032
|
}
|
|
3034
3033
|
}
|
|
3035
|
-
return
|
|
3034
|
+
return ba(s2);
|
|
3036
3035
|
}
|
|
3037
|
-
function
|
|
3036
|
+
function Ca(e6, t2) {
|
|
3038
3037
|
return t2 ? { ...e6, ...t2, ...Object.keys(e6).reduce((n2, r2) => (n2[r2] = { ...e6[r2], ...t2[r2] }, n2), {}) } : e6;
|
|
3039
3038
|
}
|
|
3040
|
-
function
|
|
3041
|
-
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] =
|
|
3039
|
+
function wa(e6, t2) {
|
|
3040
|
+
return t2 ? Object.keys(e6).reduce((n2, r2) => (n2[r2] = Ca(e6[r2], t2[r2]), n2), { ...e6 }) : e6;
|
|
3042
3041
|
}
|
|
3043
|
-
function
|
|
3042
|
+
function Ta(e6) {
|
|
3044
3043
|
return { create() {
|
|
3045
3044
|
return { get(t2) {
|
|
3046
3045
|
return e6[t2];
|
|
@@ -3049,23 +3048,23 @@ function wa(e6) {
|
|
|
3049
3048
|
} };
|
|
3050
3049
|
} };
|
|
3051
3050
|
}
|
|
3052
|
-
function
|
|
3053
|
-
return { getNumberFormat:
|
|
3051
|
+
function Ea(e6 = { number: {}, dateTime: {}, pluralRules: {} }) {
|
|
3052
|
+
return { getNumberFormat: di((...e7) => new Intl.NumberFormat(...e7), { cache: Ta(e6.number), strategy: Si.variadic }), getDateTimeFormat: di((...e7) => new Intl.DateTimeFormat(...e7), { cache: Ta(e6.dateTime), strategy: Si.variadic }), getPluralRules: di((...e7) => new Intl.PluralRules(...e7), { cache: Ta(e6.pluralRules), strategy: Si.variadic }) };
|
|
3054
3053
|
}
|
|
3055
|
-
var
|
|
3054
|
+
var Da = class e5 {
|
|
3056
3055
|
constructor(t2, n2 = e5.defaultLocale, r2, i2) {
|
|
3057
3056
|
if (this.formatterCache = { number: {}, dateTime: {}, pluralRules: {} }, this.format = (e6) => {
|
|
3058
3057
|
let t3 = this.formatToParts(e6);
|
|
3059
3058
|
if (t3.length === 1) return t3[0].value;
|
|
3060
3059
|
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), []);
|
|
3061
3060
|
return n3.length <= 1 ? n3[0] || `` : n3;
|
|
3062
|
-
}, this.formatToParts = (e6) =>
|
|
3061
|
+
}, this.formatToParts = (e6) => Sa(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`) {
|
|
3063
3062
|
if (this.message = t2, !e5.__parse) throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3064
3063
|
let { ...n3 } = i2 || {};
|
|
3065
3064
|
this.ast = e5.__parse(t2, { ...n3, locale: this.resolvedLocale });
|
|
3066
3065
|
} else this.ast = t2;
|
|
3067
3066
|
if (!Array.isArray(this.ast)) throw TypeError(`A message must be provided as a String or AST.`);
|
|
3068
|
-
this.formats =
|
|
3067
|
+
this.formats = wa(e5.formats, r2), this.formatters = i2 && i2.formatters || Ea(this.formatterCache);
|
|
3069
3068
|
}
|
|
3070
3069
|
static {
|
|
3071
3070
|
this.memoizedDefaultLocale = null;
|
|
@@ -3081,14 +3080,14 @@ var Ea = class e5 {
|
|
|
3081
3080
|
};
|
|
3082
3081
|
}
|
|
3083
3082
|
static {
|
|
3084
|
-
this.__parse =
|
|
3083
|
+
this.__parse = ha;
|
|
3085
3084
|
}
|
|
3086
3085
|
static {
|
|
3087
3086
|
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` } } };
|
|
3088
3087
|
}
|
|
3089
3088
|
};
|
|
3090
|
-
var
|
|
3091
|
-
function
|
|
3089
|
+
var Oa = [`__proto__`, `constructor`, `prototype`];
|
|
3090
|
+
function ka(e6, t2, n2) {
|
|
3092
3091
|
function r2(e7) {
|
|
3093
3092
|
return e7 && e7.indexOf(`###`) > -1 ? e7.replace(/###/g, `.`) : e7;
|
|
3094
3093
|
}
|
|
@@ -3098,49 +3097,49 @@ function Oa(e6, t2, n2) {
|
|
|
3098
3097
|
for (var a2 = typeof t2 == `string` ? t2.split(`.`) : [].concat(t2); a2.length > 1; ) {
|
|
3099
3098
|
if (i2()) return {};
|
|
3100
3099
|
var o2 = r2(a2.shift());
|
|
3101
|
-
if (
|
|
3100
|
+
if (Oa.indexOf(o2) > -1) return {};
|
|
3102
3101
|
!e6[o2] && n2 && (e6[o2] = new n2()), e6 = e6[o2];
|
|
3103
3102
|
}
|
|
3104
3103
|
if (i2()) return {};
|
|
3105
3104
|
var s2 = r2(a2.shift());
|
|
3106
|
-
return
|
|
3105
|
+
return Oa.indexOf(s2) > -1 ? {} : { obj: e6, k: s2 };
|
|
3107
3106
|
}
|
|
3108
|
-
function
|
|
3109
|
-
var r2 =
|
|
3107
|
+
function Aa(e6, t2, n2) {
|
|
3108
|
+
var r2 = ka(e6, t2, Object), i2 = r2.obj, a2 = r2.k;
|
|
3110
3109
|
i2 !== void 0 && (i2[a2] = n2);
|
|
3111
3110
|
}
|
|
3112
|
-
function
|
|
3113
|
-
var n2 =
|
|
3111
|
+
function ja(e6, t2) {
|
|
3112
|
+
var n2 = ka(e6, t2), r2 = n2.obj, i2 = n2.k;
|
|
3114
3113
|
if (r2) return r2[i2];
|
|
3115
3114
|
}
|
|
3116
|
-
function
|
|
3115
|
+
function Ma(e6) {
|
|
3117
3116
|
return [...arguments].slice(1).forEach(function(t2) {
|
|
3118
3117
|
if (t2) for (var n2 = 0, r2 = Object.keys(t2); n2 < r2.length; n2++) {
|
|
3119
3118
|
var i2 = r2[n2];
|
|
3120
|
-
|
|
3119
|
+
Oa.indexOf(i2) > -1 || e6[i2] === void 0 && (e6[i2] = t2[i2]);
|
|
3121
3120
|
}
|
|
3122
3121
|
}), e6;
|
|
3123
3122
|
}
|
|
3124
|
-
function
|
|
3125
|
-
return
|
|
3123
|
+
function Na(e6, t2) {
|
|
3124
|
+
return Ra(e6) || La(e6, t2) || Fa(e6, t2) || Pa();
|
|
3126
3125
|
}
|
|
3127
|
-
function
|
|
3126
|
+
function Pa() {
|
|
3128
3127
|
throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3129
3128
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
3130
3129
|
}
|
|
3131
|
-
function
|
|
3130
|
+
function Fa(e6, t2) {
|
|
3132
3131
|
if (e6) {
|
|
3133
|
-
if (typeof e6 == `string`) return
|
|
3132
|
+
if (typeof e6 == `string`) return Ia(e6, t2);
|
|
3134
3133
|
var n2 = {}.toString.call(e6).slice(8, -1);
|
|
3135
|
-
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) ?
|
|
3134
|
+
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) ? Ia(e6, t2) : void 0;
|
|
3136
3135
|
}
|
|
3137
3136
|
}
|
|
3138
|
-
function
|
|
3137
|
+
function Ia(e6, t2) {
|
|
3139
3138
|
(t2 == null || t2 > e6.length) && (t2 = e6.length);
|
|
3140
3139
|
for (var n2 = 0, r2 = Array(t2); n2 < t2; n2++) r2[n2] = e6[n2];
|
|
3141
3140
|
return r2;
|
|
3142
3141
|
}
|
|
3143
|
-
function
|
|
3142
|
+
function La(e6, t2) {
|
|
3144
3143
|
var n2 = e6 == null ? null : typeof Symbol < `u` && e6[Symbol.iterator] || e6[`@@iterator`];
|
|
3145
3144
|
if (n2 != null) {
|
|
3146
3145
|
var r2, i2, a2, o2, s2 = [], c2 = true, l2 = false;
|
|
@@ -3161,10 +3160,10 @@ function Ia(e6, t2) {
|
|
|
3161
3160
|
return s2;
|
|
3162
3161
|
}
|
|
3163
3162
|
}
|
|
3164
|
-
function
|
|
3163
|
+
function Ra(e6) {
|
|
3165
3164
|
if (Array.isArray(e6)) return e6;
|
|
3166
3165
|
}
|
|
3167
|
-
function
|
|
3166
|
+
function za(e6, t2) {
|
|
3168
3167
|
var n2 = Object.keys(e6);
|
|
3169
3168
|
if (Object.getOwnPropertySymbols) {
|
|
3170
3169
|
var r2 = Object.getOwnPropertySymbols(e6);
|
|
@@ -3174,101 +3173,101 @@ function Ra(e6, t2) {
|
|
|
3174
3173
|
}
|
|
3175
3174
|
return n2;
|
|
3176
3175
|
}
|
|
3177
|
-
function
|
|
3176
|
+
function Ba(e6) {
|
|
3178
3177
|
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
3179
3178
|
var n2 = arguments[t2] == null ? {} : arguments[t2];
|
|
3180
|
-
t2 % 2 ?
|
|
3181
|
-
|
|
3182
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) :
|
|
3179
|
+
t2 % 2 ? za(Object(n2), true).forEach(function(t3) {
|
|
3180
|
+
Va(e6, t3, n2[t3]);
|
|
3181
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n2)) : za(Object(n2)).forEach(function(t3) {
|
|
3183
3182
|
Object.defineProperty(e6, t3, Object.getOwnPropertyDescriptor(n2, t3));
|
|
3184
3183
|
});
|
|
3185
3184
|
}
|
|
3186
3185
|
return e6;
|
|
3187
3186
|
}
|
|
3188
|
-
function
|
|
3189
|
-
return (t2 =
|
|
3187
|
+
function Va(e6, t2, n2) {
|
|
3188
|
+
return (t2 = Ga(t2)) in e6 ? Object.defineProperty(e6, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e6[t2] = n2, e6;
|
|
3190
3189
|
}
|
|
3191
|
-
function
|
|
3190
|
+
function Ha(e6, t2) {
|
|
3192
3191
|
if (!(e6 instanceof t2)) throw TypeError(`Cannot call a class as a function`);
|
|
3193
3192
|
}
|
|
3194
|
-
function
|
|
3193
|
+
function Ua(e6, t2) {
|
|
3195
3194
|
for (var n2 = 0; n2 < t2.length; n2++) {
|
|
3196
3195
|
var r2 = t2[n2];
|
|
3197
|
-
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6,
|
|
3196
|
+
r2.enumerable = r2.enumerable || false, r2.configurable = true, `value` in r2 && (r2.writable = true), Object.defineProperty(e6, Ga(r2.key), r2);
|
|
3198
3197
|
}
|
|
3199
3198
|
}
|
|
3200
|
-
function
|
|
3201
|
-
return t2 &&
|
|
3199
|
+
function Wa(e6, t2, n2) {
|
|
3200
|
+
return t2 && Ua(e6.prototype, t2), n2 && Ua(e6, n2), Object.defineProperty(e6, "prototype", { writable: false }), e6;
|
|
3202
3201
|
}
|
|
3203
|
-
function
|
|
3204
|
-
var t2 =
|
|
3205
|
-
return
|
|
3202
|
+
function Ga(e6) {
|
|
3203
|
+
var t2 = Ka(e6, `string`);
|
|
3204
|
+
return K(t2) == `symbol` ? t2 : t2 + ``;
|
|
3206
3205
|
}
|
|
3207
|
-
function
|
|
3208
|
-
if (
|
|
3206
|
+
function Ka(e6, t2) {
|
|
3207
|
+
if (K(e6) != `object` || !e6) return e6;
|
|
3209
3208
|
var n2 = e6[Symbol.toPrimitive];
|
|
3210
3209
|
if (n2 !== void 0) {
|
|
3211
3210
|
var r2 = n2.call(e6, t2 || `default`);
|
|
3212
|
-
if (
|
|
3211
|
+
if (K(r2) != `object`) return r2;
|
|
3213
3212
|
throw TypeError(`@@toPrimitive must return a primitive value.`);
|
|
3214
3213
|
}
|
|
3215
3214
|
return (t2 === `string` ? String : Number)(e6);
|
|
3216
3215
|
}
|
|
3217
|
-
function
|
|
3216
|
+
function K(e6) {
|
|
3218
3217
|
"@babel/helpers - typeof";
|
|
3219
|
-
return
|
|
3218
|
+
return K = typeof Symbol == `function` && typeof Symbol.iterator == `symbol` ? function(e7) {
|
|
3220
3219
|
return typeof e7;
|
|
3221
3220
|
} : function(e7) {
|
|
3222
3221
|
return e7 && typeof Symbol == `function` && e7.constructor === Symbol && e7 !== Symbol.prototype ? `symbol` : typeof e7;
|
|
3223
|
-
},
|
|
3222
|
+
}, K(e6);
|
|
3224
3223
|
}
|
|
3225
|
-
var
|
|
3226
|
-
var
|
|
3227
|
-
function
|
|
3224
|
+
var qa = `https://www.i18next.com/how-to/using-icu-or-mf2`;
|
|
3225
|
+
var Ja = [`zero`, `one`, `two`, `few`, `many`, `other`];
|
|
3226
|
+
function Ya() {
|
|
3228
3227
|
return { memoize: true, memoizeFallback: false, bindI18n: ``, bindI18nStore: ``, parseErrorHandler: function(e6, t2, n2, r2) {
|
|
3229
3228
|
return n2;
|
|
3230
3229
|
}, parseLngForICU: function(e6) {
|
|
3231
3230
|
return e6;
|
|
3232
3231
|
}, escapeVariables: false };
|
|
3233
3232
|
}
|
|
3234
|
-
function
|
|
3235
|
-
return n2 && t2 &&
|
|
3233
|
+
function Xa(e6, t2, n2, r2) {
|
|
3234
|
+
return n2 && t2 && K(t2) === `object` ? `${r2} resolved to an object or array, but i18next-icu does not support returnObjects or joinArrays and returns the raw value unformatted.` : n2 && typeof t2 == `string` && t2.indexOf(`{{`) > -1 ? `${r2} could not be parsed (${e6.message}). It contains "{{": i18next interpolation like {{name}} does not work with ICU, use {name}.` : `${r2} could not be ${n2 ? `parsed` : `formatted`}: ${e6.message}`;
|
|
3236
3235
|
}
|
|
3237
|
-
var
|
|
3236
|
+
var Za = function() {
|
|
3238
3237
|
function e6(t2) {
|
|
3239
|
-
|
|
3238
|
+
Ha(this, e6), this.type = `i18nFormat`, this.mem = {}, this.warned = /* @__PURE__ */ new Set(), this.init(null, t2);
|
|
3240
3239
|
}
|
|
3241
|
-
return
|
|
3240
|
+
return Wa(e6, [{ key: `init`, value: function(e7, t2) {
|
|
3242
3241
|
var n2 = this, r2 = e7 && e7.options && e7.options.i18nFormat || {};
|
|
3243
|
-
if (this.options =
|
|
3242
|
+
if (this.options = Ma(r2, t2, this.options || {}, Ya()), this.formats = this.options.formats, e7) {
|
|
3244
3243
|
var i2 = this.options, a2 = i2.bindI18n, o2 = i2.bindI18nStore, s2 = i2.memoize;
|
|
3245
|
-
e7.IntlMessageFormat =
|
|
3244
|
+
e7.IntlMessageFormat = Da, e7.ICU = this, this.i18next = e7, this.debug = !!(e7.options && e7.options.debug), this.debug && e7.options.interpolation && e7.options.interpolation.escapeValue !== false && !this.options.escapeVariables && this.warn(`interpolation.escapeValue is not applied, values are inserted without HTML escaping. Set the i18next-icu option escapeVariables: true to escape them, or interpolation.escapeValue: false if your output is escaped elsewhere (e.g. by React).`), s2 && (a2 && e7.on(a2, function() {
|
|
3246
3245
|
return n2.clearCache();
|
|
3247
3246
|
}), o2 && e7.store.on(o2, function() {
|
|
3248
3247
|
return n2.clearCache();
|
|
3249
3248
|
}));
|
|
3250
3249
|
}
|
|
3251
3250
|
} }, { key: `addUserDefinedFormats`, value: function(e7) {
|
|
3252
|
-
this.formats = this.formats ?
|
|
3251
|
+
this.formats = this.formats ? Ba(Ba({}, this.formats), e7) : e7, this.clearCache();
|
|
3253
3252
|
} }, { key: `parse`, value: function(e7, t2, n2, r2, i2, a2) {
|
|
3254
3253
|
var o2 = a2 && a2.resolved && a2.resolved.res, s2 = this.options.memoize && [n2, r2, i2], c2;
|
|
3255
3254
|
if (this.options.memoize) {
|
|
3256
|
-
var l2 =
|
|
3255
|
+
var l2 = ja(this.mem, s2);
|
|
3257
3256
|
l2 && l2.res === e7 && (c2 = l2.fc);
|
|
3258
3257
|
}
|
|
3259
3258
|
try {
|
|
3260
|
-
c2 || (this.debug && typeof e7 == `string` && e7.indexOf(`$t(`) > -1 && this.firstTime(`nesting ${n2} ${r2} ${i2}`) && this.warn(`key "${i2}" (${n2}/${r2}) contains "$t(", but i18next-icu does not support nesting, the text is output as is.`), c2 = new
|
|
3261
|
-
var u2 = t2 && t2.replace &&
|
|
3259
|
+
c2 || (this.debug && typeof e7 == `string` && e7.indexOf(`$t(`) > -1 && this.firstTime(`nesting ${n2} ${r2} ${i2}`) && this.warn(`key "${i2}" (${n2}/${r2}) contains "$t(", but i18next-icu does not support nesting, the text is output as is.`), c2 = new Da(e7, this.options.parseLngForICU(n2), this.formats, { ignoreTag: true }), this.options.memoize && (this.options.memoizeFallback || !a2 || o2) && Aa(this.mem, s2, { res: e7, fc: c2 }));
|
|
3260
|
+
var u2 = t2 && t2.replace && K(t2.replace) === `object` ? Ba(Ba({}, t2), t2.replace) : t2;
|
|
3262
3261
|
return c2.format(this.escapeVariableValues(u2));
|
|
3263
3262
|
} catch (a3) {
|
|
3264
|
-
return this.debug && this.firstTime(`error ${n2} ${r2} ${i2}`) && this.warn(
|
|
3263
|
+
return this.debug && this.firstTime(`error ${n2} ${r2} ${i2}`) && this.warn(Xa(a3, e7, !c2, `key "${i2}" (${n2}/${r2})`)), this.options.parseErrorHandler(a3, i2, e7, t2);
|
|
3265
3264
|
}
|
|
3266
3265
|
} }, { key: `addLookupKeys`, value: function(e7, t2, n2, r2, i2) {
|
|
3267
3266
|
return this.debug && i2 && this.checkSuffixKeys(t2, n2, r2, i2), e7;
|
|
3268
3267
|
} }, { key: `checkSuffixKeys`, value: function(e7, t2, n2, r2) {
|
|
3269
3268
|
var i2 = r2.count, a2 = r2.context, o2 = this.i18next.options, s2 = o2.pluralSeparator, c2 = s2 === void 0 ? `_` : s2, l2 = o2.contextSeparator, u2 = l2 === void 0 ? `_` : l2, d2 = this.i18next.services.resourceStore, f2 = `key "${e7}" (${t2}/${n2})`;
|
|
3270
3269
|
if (i2 !== void 0 && this.firstTime(`plural ${t2} ${n2} ${e7}`)) {
|
|
3271
|
-
var p2 =
|
|
3270
|
+
var p2 = Ja.concat(Ja.map(function(e8) {
|
|
3272
3271
|
return `ordinal${c2}${e8}`;
|
|
3273
3272
|
})).map(function(t3) {
|
|
3274
3273
|
return `${e7}${c2}${t3}`;
|
|
@@ -3282,33 +3281,33 @@ var Xa = function() {
|
|
|
3282
3281
|
} }, { key: `firstTime`, value: function(e7) {
|
|
3283
3282
|
return !this.warned.has(e7) && (this.warned.add(e7), true);
|
|
3284
3283
|
} }, { key: `warn`, value: function(e7) {
|
|
3285
|
-
this.i18next.services.logger.warn(`i18next-icu: ${e7} See ${
|
|
3284
|
+
this.i18next.services.logger.warn(`i18next-icu: ${e7} See ${qa}`);
|
|
3286
3285
|
} }, { key: `clearCache`, value: function() {
|
|
3287
3286
|
this.mem = {};
|
|
3288
3287
|
} }, { key: `escapeVariableValues`, value: function(e7) {
|
|
3289
|
-
if (!this.options.escapeVariables || !e7 ||
|
|
3288
|
+
if (!this.options.escapeVariables || !e7 || K(e7) !== `object`) return e7;
|
|
3290
3289
|
for (var t2 = {}, n2 = 0, r2 = Object.entries(e7); n2 < r2.length; n2++) {
|
|
3291
|
-
var i2 =
|
|
3290
|
+
var i2 = Na(r2[n2], 2), a2 = i2[0], o2 = i2[1];
|
|
3292
3291
|
t2[a2] = typeof o2 == `string` ? o2.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`) : o2;
|
|
3293
3292
|
}
|
|
3294
3293
|
return t2;
|
|
3295
3294
|
} }]), e6;
|
|
3296
3295
|
}();
|
|
3297
|
-
|
|
3298
|
-
function
|
|
3296
|
+
Za.type = `i18nFormat`;
|
|
3297
|
+
function Qa({ icuOptions: e6 = {}, ...t2 }) {
|
|
3299
3298
|
let { parseErrorHandler: n2 = void 0 } = t2;
|
|
3300
|
-
return
|
|
3299
|
+
return ui(t2, { icu: new Za({ parseErrorHandler: n2, bindI18n: t2.bindI18n, ...e6 }) });
|
|
3301
3300
|
}
|
|
3302
|
-
var
|
|
3301
|
+
var $a = (e6, t2, n2, r2) => {
|
|
3303
3302
|
let i2 = [n2, { code: t2, ...r2 || {} }];
|
|
3304
3303
|
if (e6?.services?.logger?.forward) return e6.services.logger.forward(i2, `warn`, `react-i18next::`, true);
|
|
3305
|
-
|
|
3304
|
+
q(i2[0]) && (i2[0] = `react-i18next:: ${i2[0]}`), e6?.services?.logger?.warn ? e6.services.logger.warn(...i2) : console?.warn && console.warn(...i2);
|
|
3306
3305
|
};
|
|
3307
|
-
var
|
|
3308
|
-
var
|
|
3309
|
-
|
|
3306
|
+
var eo = {};
|
|
3307
|
+
var to = (e6, t2, n2, r2) => {
|
|
3308
|
+
q(n2) && eo[n2] || (q(n2) && (eo[n2] = /* @__PURE__ */ new Date()), $a(e6, t2, n2, r2));
|
|
3310
3309
|
};
|
|
3311
|
-
var
|
|
3310
|
+
var no = (e6, t2) => () => {
|
|
3312
3311
|
if (e6.isInitialized) t2();
|
|
3313
3312
|
else {
|
|
3314
3313
|
let n2 = () => {
|
|
@@ -3319,29 +3318,29 @@ var to = (e6, t2) => () => {
|
|
|
3319
3318
|
e6.on(`initialized`, n2);
|
|
3320
3319
|
}
|
|
3321
3320
|
};
|
|
3322
|
-
var
|
|
3323
|
-
e6.loadNamespaces(t2,
|
|
3321
|
+
var ro = (e6, t2, n2) => {
|
|
3322
|
+
e6.loadNamespaces(t2, no(e6, n2));
|
|
3324
3323
|
};
|
|
3325
|
-
var
|
|
3326
|
-
if (
|
|
3324
|
+
var io = (e6, t2, n2, r2) => {
|
|
3325
|
+
if (q(n2) && (n2 = [n2]), e6.options.preload && e6.options.preload.indexOf(t2) > -1) return ro(e6, n2, r2);
|
|
3327
3326
|
n2.forEach((t3) => {
|
|
3328
3327
|
e6.options.ns.indexOf(t3) < 0 && e6.options.ns.push(t3);
|
|
3329
|
-
}), e6.loadLanguages(t2,
|
|
3328
|
+
}), e6.loadLanguages(t2, no(e6, r2));
|
|
3330
3329
|
};
|
|
3331
|
-
var
|
|
3330
|
+
var ao = (e6, t2, n2 = {}) => !t2.languages || !t2.languages.length ? (to(t2, `NO_LANGUAGES`, `i18n.languages were undefined or empty`, { languages: t2.languages }), true) : t2.hasLoadedNamespace(e6, { lng: n2.lng, precheck: (t3, r2) => {
|
|
3332
3331
|
if (n2.bindI18n && n2.bindI18n.indexOf(`languageChanging`) > -1 && t3.services.backendConnector.backend && t3.isLanguageChangingTo && !r2(t3.isLanguageChangingTo, e6)) return false;
|
|
3333
3332
|
} });
|
|
3334
|
-
var
|
|
3335
|
-
var
|
|
3336
|
-
var
|
|
3337
|
-
var
|
|
3338
|
-
var
|
|
3339
|
-
var
|
|
3340
|
-
var
|
|
3341
|
-
var
|
|
3342
|
-
var
|
|
3343
|
-
var
|
|
3344
|
-
var
|
|
3333
|
+
var q = (e6) => typeof e6 == `string`;
|
|
3334
|
+
var oo = (e6) => typeof e6 == `object` && !!e6;
|
|
3335
|
+
var so = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3336
|
+
var co = { "&": `&`, "&": `&`, "<": `<`, "<": `<`, ">": `>`, ">": `>`, "'": `'`, "'": `'`, """: `"`, """: `"`, " ": ` `, " ": ` `, "©": `\xA9`, "©": `\xA9`, "®": `\xAE`, "®": `\xAE`, "…": `\u2026`, "…": `\u2026`, "/": `/`, "/": `/` };
|
|
3337
|
+
var lo = (e6) => co[e6];
|
|
3338
|
+
var uo = { bindI18n: `languageChanged`, bindI18nStore: ``, transEmptyNodeValue: ``, transSupportBasicHtmlNodes: true, transWrapTextNodes: ``, transKeepBasicHtmlNodesFor: [`br`, `strong`, `i`, `p`], useSuspense: true, unescape: (e6) => e6.replace(so, lo) };
|
|
3339
|
+
var fo = () => uo;
|
|
3340
|
+
var po;
|
|
3341
|
+
var mo = () => po;
|
|
3342
|
+
var ho = i();
|
|
3343
|
+
var go = class {
|
|
3345
3344
|
constructor() {
|
|
3346
3345
|
this.usedNamespaces = {};
|
|
3347
3346
|
}
|
|
@@ -3354,32 +3353,32 @@ var ho = class {
|
|
|
3354
3353
|
return Object.keys(this.usedNamespaces);
|
|
3355
3354
|
}
|
|
3356
3355
|
};
|
|
3357
|
-
var
|
|
3356
|
+
var _o = (e6, t2) => {
|
|
3358
3357
|
let n2 = d();
|
|
3359
3358
|
return l(() => {
|
|
3360
3359
|
n2.current = t2 ? n2.current : e6;
|
|
3361
3360
|
}, [e6, t2]), n2.current;
|
|
3362
3361
|
};
|
|
3363
|
-
var
|
|
3364
|
-
var
|
|
3365
|
-
var
|
|
3366
|
-
let { i18n: n2 } = t2, { i18n: r2, defaultNS: i2 } = c(
|
|
3367
|
-
if (a2 && !a2.reportNamespaces && (a2.reportNamespaces = new
|
|
3368
|
-
|
|
3369
|
-
let e7 = (e8, t4) =>
|
|
3362
|
+
var vo = (e6, t2, n2, r2) => e6.getFixedT(t2, n2, r2);
|
|
3363
|
+
var yo = (e6, t2, n2, r2) => s(vo(e6, t2, n2, r2), [e6, t2, n2, r2]);
|
|
3364
|
+
var bo = (e6, t2 = {}) => {
|
|
3365
|
+
let { i18n: n2 } = t2, { i18n: r2, defaultNS: i2 } = c(ho) || {}, a2 = n2 || r2 || mo();
|
|
3366
|
+
if (a2 && !a2.reportNamespaces && (a2.reportNamespaces = new go()), !a2) {
|
|
3367
|
+
to(a2, `NO_I18NEXT_INSTANCE`, `useTranslation: You will need to pass in an i18next instance by using initReactI18next`);
|
|
3368
|
+
let e7 = (e8, t4) => q(t4) ? t4 : oo(t4) && q(t4.defaultValue) ? t4.defaultValue : Array.isArray(e8) ? e8[e8.length - 1] : e8, t3 = [e7, {}, false];
|
|
3370
3369
|
return t3.t = e7, t3.i18n = {}, t3.ready = false, t3;
|
|
3371
3370
|
}
|
|
3372
|
-
a2.options.react?.wait &&
|
|
3373
|
-
let o2 = { ...
|
|
3374
|
-
p2 =
|
|
3375
|
-
let m2 = (a2.isInitialized || a2.initializedStoreOnce) && p2.every((e7) =>
|
|
3371
|
+
a2.options.react?.wait && to(a2, `DEPRECATED_OPTION`, `useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.`);
|
|
3372
|
+
let o2 = { ...fo(), ...a2.options.react, ...t2 }, { useSuspense: s2, keyPrefix: u2 } = o2, p2 = e6 || i2 || a2.options?.defaultNS;
|
|
3373
|
+
p2 = q(p2) ? [p2] : p2 || [`translation`], a2.reportNamespaces.addUsedNamespaces?.(p2);
|
|
3374
|
+
let m2 = (a2.isInitialized || a2.initializedStoreOnce) && p2.every((e7) => ao(e7, a2, o2)), h2 = yo(a2, t2.lng || null, o2.nsMode === `fallback` ? p2 : p2[0], u2), g2 = () => h2, _2 = () => vo(a2, t2.lng || null, o2.nsMode === `fallback` ? p2 : p2[0], u2), [v2, y2] = f(g2), b2 = p2.join();
|
|
3376
3375
|
t2.lng && (b2 = `${t2.lng}${b2}`);
|
|
3377
|
-
let x2 =
|
|
3376
|
+
let x2 = _o(b2), S2 = d(true);
|
|
3378
3377
|
l(() => {
|
|
3379
3378
|
let { bindI18n: e7, bindI18nStore: n3 } = o2;
|
|
3380
|
-
S2.current = true, !m2 && !s2 && (t2.lng ?
|
|
3379
|
+
S2.current = true, !m2 && !s2 && (t2.lng ? io(a2, t2.lng, p2, () => {
|
|
3381
3380
|
S2.current && y2(_2);
|
|
3382
|
-
}) :
|
|
3381
|
+
}) : ro(a2, p2, () => {
|
|
3383
3382
|
S2.current && y2(_2);
|
|
3384
3383
|
})), m2 && x2 && x2 !== b2 && S2.current && y2(_2);
|
|
3385
3384
|
let r3 = () => {
|
|
@@ -3394,134 +3393,134 @@ var yo = (e6, t2 = {}) => {
|
|
|
3394
3393
|
let C2 = [v2, a2, m2];
|
|
3395
3394
|
if (C2.t = v2, C2.i18n = a2, C2.ready = m2, m2 || !m2 && !s2) return C2;
|
|
3396
3395
|
throw new Promise((e7) => {
|
|
3397
|
-
t2.lng ?
|
|
3396
|
+
t2.lng ? io(a2, t2.lng, p2, () => e7()) : ro(a2, p2, () => e7());
|
|
3398
3397
|
});
|
|
3399
3398
|
};
|
|
3400
|
-
function
|
|
3399
|
+
function xo({ i18n: e6, defaultNS: t2, children: n2 }) {
|
|
3401
3400
|
let r2 = u(() => ({ i18n: e6, defaultNS: t2 }), [e6, t2]);
|
|
3402
|
-
return a(
|
|
3401
|
+
return a(ho.Provider, { value: r2 }, n2);
|
|
3403
3402
|
}
|
|
3404
|
-
var
|
|
3405
|
-
var
|
|
3406
|
-
var
|
|
3403
|
+
var So = F(`@wix/site-service-locale`);
|
|
3404
|
+
var Co = F(`@wix/site-service-renderer-configuration`);
|
|
3405
|
+
var wo = () => {
|
|
3407
3406
|
let e6, t2;
|
|
3408
3407
|
try {
|
|
3409
|
-
e6 = m(
|
|
3408
|
+
e6 = m(Co).languageCode;
|
|
3410
3409
|
} catch {
|
|
3411
3410
|
}
|
|
3412
3411
|
try {
|
|
3413
|
-
t2 = m(
|
|
3412
|
+
t2 = m(So).language;
|
|
3414
3413
|
} catch {
|
|
3415
3414
|
}
|
|
3416
3415
|
return e6 || t2;
|
|
3417
3416
|
};
|
|
3418
|
-
var
|
|
3419
|
-
var
|
|
3420
|
-
function
|
|
3417
|
+
var To = `wix-warmup-data`;
|
|
3418
|
+
var Eo = null;
|
|
3419
|
+
function Do(e6) {
|
|
3421
3420
|
if (typeof document < `u`) try {
|
|
3422
|
-
let t2 = document.getElementById(
|
|
3423
|
-
return t2 ? (
|
|
3421
|
+
let t2 = document.getElementById(To)?.textContent;
|
|
3422
|
+
return t2 ? (Eo?.text !== t2 && (Eo = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), Eo.data[e6] ?? void 0) : void 0;
|
|
3424
3423
|
} catch {
|
|
3425
3424
|
return;
|
|
3426
3425
|
}
|
|
3427
3426
|
}
|
|
3428
|
-
var
|
|
3429
|
-
var
|
|
3430
|
-
var
|
|
3431
|
-
var
|
|
3432
|
-
var
|
|
3433
|
-
let t2 = e6.scope ??
|
|
3434
|
-
return n2 || (n2 = /* @__PURE__ */ new Map(),
|
|
3427
|
+
var Oo = 5e3;
|
|
3428
|
+
var ko = 100;
|
|
3429
|
+
var Ao = {};
|
|
3430
|
+
var jo = /* @__PURE__ */ new WeakMap();
|
|
3431
|
+
var Mo = (e6) => {
|
|
3432
|
+
let t2 = e6.scope ?? Ao, n2 = jo.get(t2);
|
|
3433
|
+
return n2 || (n2 = /* @__PURE__ */ new Map(), jo.set(t2, n2)), n2;
|
|
3435
3434
|
};
|
|
3436
|
-
function
|
|
3435
|
+
function No({ key: e6, warmupData: t2, fetchData: n2 }) {
|
|
3437
3436
|
if (e6 === null) return n2();
|
|
3438
3437
|
if (t2.isServer) return n2().then((n3) => (t2.set(e6, n3), n3));
|
|
3439
|
-
let r2 =
|
|
3438
|
+
let r2 = Mo(t2), i2 = Date.now();
|
|
3440
3439
|
for (let [e7, t3] of r2) t3.expiresAt <= i2 && r2.delete(e7);
|
|
3441
3440
|
let a2 = r2.get(e6);
|
|
3442
3441
|
if (a2) return a2.promise;
|
|
3443
|
-
let o2 =
|
|
3442
|
+
let o2 = Do(e6);
|
|
3444
3443
|
if (o2 !== void 0) {
|
|
3445
|
-
let t3 =
|
|
3446
|
-
return r2.set(e6, { promise: t3, expiresAt: i2 +
|
|
3444
|
+
let t3 = Vn(o2);
|
|
3445
|
+
return r2.set(e6, { promise: t3, expiresAt: i2 + Oo }), t3;
|
|
3447
3446
|
}
|
|
3448
3447
|
let s2 = (async () => await t2.get(e6) ?? n2())();
|
|
3449
|
-
r2.size >=
|
|
3448
|
+
r2.size >= ko && r2.delete(r2.keys().next().value);
|
|
3450
3449
|
let c2 = { promise: s2, expiresAt: 1 / 0 };
|
|
3451
3450
|
return r2.set(e6, c2), s2.then(() => {
|
|
3452
|
-
c2.expiresAt = Date.now() +
|
|
3451
|
+
c2.expiresAt = Date.now() + Oo;
|
|
3453
3452
|
}, () => {
|
|
3454
3453
|
r2.get(e6) === c2 && r2.delete(e6);
|
|
3455
3454
|
}), s2;
|
|
3456
3455
|
}
|
|
3457
|
-
var
|
|
3458
|
-
var
|
|
3459
|
-
var
|
|
3460
|
-
var
|
|
3461
|
-
function
|
|
3462
|
-
let n2 =
|
|
3456
|
+
var Po = `blog-builder:i18n`;
|
|
3457
|
+
var Fo = `translation`;
|
|
3458
|
+
var Io = () => Do(Po);
|
|
3459
|
+
var Lo = /* @__PURE__ */ new Map();
|
|
3460
|
+
function Ro(e6, t2) {
|
|
3461
|
+
let n2 = Lo.get(e6);
|
|
3463
3462
|
if (n2) return n2;
|
|
3464
|
-
let r2 =
|
|
3465
|
-
return
|
|
3463
|
+
let r2 = Io(), i2 = r2?.locale === e6 ? r2.messages : void 0, a2 = Qa({ locale: e6, useSuspense: true, ...i2 ? { messages: i2 } : { asyncMessagesLoader: t2 } });
|
|
3464
|
+
return Lo.set(e6, a2), a2;
|
|
3466
3465
|
}
|
|
3467
|
-
function
|
|
3468
|
-
let t2 = () => e6.loadNamespaces(
|
|
3466
|
+
function zo(e6) {
|
|
3467
|
+
let t2 = () => e6.loadNamespaces(Fo).then(() => void 0, () => void 0);
|
|
3469
3468
|
return e6.isInitialized ? t2() : new Promise((n2) => {
|
|
3470
3469
|
e6.on(`initialized`, () => void t2().then(n2));
|
|
3471
3470
|
});
|
|
3472
3471
|
}
|
|
3473
|
-
function
|
|
3472
|
+
function Bo(e6, t2) {
|
|
3474
3473
|
return e6.getResourceBundle(t2, `translation`) ?? e6.getResourceBundle(`en`, `translation`);
|
|
3475
3474
|
}
|
|
3476
|
-
var
|
|
3475
|
+
var Vo = (e6, t2, n2) => {
|
|
3477
3476
|
let r2 = t2.lastIndexOf(`?`), i2 = e6[r2 === -1 || r2 < t2.lastIndexOf(`/`) ? t2 : t2.slice(0, r2)];
|
|
3478
3477
|
return i2 ? typeof i2 == `function` ? i2() : Promise.resolve(i2) : new Promise((e7, r3) => {
|
|
3479
3478
|
(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.`))));
|
|
3480
3479
|
});
|
|
3481
3480
|
};
|
|
3482
|
-
var
|
|
3483
|
-
|
|
3484
|
-
var
|
|
3485
|
-
function
|
|
3486
|
-
let t2 =
|
|
3487
|
-
return t2 || (t2 =
|
|
3481
|
+
var Ho = (e6) => e6.split(`-`)[0] ?? e6;
|
|
3482
|
+
br({ isDev: false, loadMessages: (e6) => Vo(Object.assign({ "../assets/locale/messages_en.dev.json": () => yn(() => Promise.resolve().then(() => qo), void 0, import.meta.url), "../assets/locale/messages_en.json": () => yn(() => Promise.resolve().then(() => Yo), void 0, import.meta.url) }), `../assets/locale/messages_${Ho(e6)}.json`, 4), loadDevMessages: (e6) => Vo(Object.assign({ "../assets/locale/messages_en.dev.json": () => yn(() => Promise.resolve().then(() => qo), void 0, import.meta.url) }), `../assets/locale/messages_${Ho(e6)}.dev.json`, 4) });
|
|
3483
|
+
var Uo = /* @__PURE__ */ new WeakMap();
|
|
3484
|
+
function Wo(e6) {
|
|
3485
|
+
let t2 = Uo.get(e6);
|
|
3486
|
+
return t2 || (t2 = zo(e6).finally(() => Uo.delete(e6)), Uo.set(e6, t2)), t2;
|
|
3488
3487
|
}
|
|
3489
|
-
function
|
|
3490
|
-
let n2 =
|
|
3488
|
+
function Go({ i18n: e6, locale: t2 }) {
|
|
3489
|
+
let n2 = Kn(), r2 = _r();
|
|
3491
3490
|
if (!n2) return null;
|
|
3492
|
-
if (!e6.isInitialized || !e6.hasLoadedNamespace(`translation`)) throw
|
|
3493
|
-
let i2 =
|
|
3494
|
-
return i2 && r2.set(
|
|
3495
|
-
}
|
|
3496
|
-
function
|
|
3497
|
-
let t2 =
|
|
3498
|
-
return { i18n:
|
|
3499
|
-
}
|
|
3500
|
-
var
|
|
3501
|
-
var
|
|
3502
|
-
var
|
|
3503
|
-
var
|
|
3504
|
-
var
|
|
3505
|
-
var
|
|
3506
|
-
var
|
|
3507
|
-
let n2 =
|
|
3491
|
+
if (!e6.isInitialized || !e6.hasLoadedNamespace(`translation`)) throw Wo(e6);
|
|
3492
|
+
let i2 = Bo(e6, t2);
|
|
3493
|
+
return i2 && r2.set(Po, { locale: t2, messages: i2 }), null;
|
|
3494
|
+
}
|
|
3495
|
+
function Ko(e6) {
|
|
3496
|
+
let t2 = wo(), n2 = Io()?.locale ?? t2 ?? `en`;
|
|
3497
|
+
return { i18n: Ro(n2, e6), locale: n2 };
|
|
3498
|
+
}
|
|
3499
|
+
var qo = y({ default: () => Jo });
|
|
3500
|
+
var Jo = { "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` };
|
|
3501
|
+
var Yo = y({ default: () => Zo, title: () => Xo });
|
|
3502
|
+
var Xo = `My App`;
|
|
3503
|
+
var Zo = { "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: Xo, "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.` };
|
|
3504
|
+
var Qo = Object.assign({ "../assets/locale/messages_en.dev.json": qo, "../assets/locale/messages_en.json": Yo });
|
|
3505
|
+
var $o = (e6, t2) => {
|
|
3506
|
+
let n2 = Qo[`../assets/locale/messages_${Ho(e6)}${t2}.json`];
|
|
3508
3507
|
return n2 ? Promise.resolve(n2) : Promise.reject(Error(`no messages file`));
|
|
3509
3508
|
};
|
|
3510
|
-
var
|
|
3511
|
-
var
|
|
3512
|
-
var
|
|
3513
|
-
function
|
|
3509
|
+
var es = br({ isDev: false, loadMessages: (e6) => $o(e6, ``), loadDevMessages: (e6) => $o(e6, `.dev`) });
|
|
3510
|
+
var ts = [{ path: `richContent.nodes.buttonData.styles.background.gradient.centerX` }, { path: `richContent.nodes.buttonData.styles.background.gradient.centerY` }, { path: `richContent.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `richContent.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `richContent.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `richContent.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `richContent.nodes.galleryData.items.image.media.duration` }, { path: `richContent.nodes.galleryData.items.video.media.duration` }, { path: `richContent.nodes.galleryData.items.video.thumbnail.duration` }, { path: `richContent.nodes.galleryData.options.item.ratio` }, { path: `richContent.nodes.imageData.image.duration` }, { path: `richContent.nodes.imageData.crop.x` }, { path: `richContent.nodes.imageData.crop.y` }, { path: `richContent.nodes.imageData.crop.width` }, { path: `richContent.nodes.imageData.crop.height` }, { path: `richContent.nodes.mapData.mapSettings.lat` }, { path: `richContent.nodes.mapData.mapSettings.lng` }, { path: `richContent.nodes.pollData.poll.image.duration` }, { path: `richContent.nodes.pollData.poll.options.image.duration` }, { path: `richContent.nodes.pollData.design.poll.background.image.duration` }, { path: `richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.nodes.appEmbedData.image.duration` }, { path: `richContent.nodes.videoData.video.duration` }, { path: `richContent.nodes.videoData.thumbnail.duration` }, { path: `richContent.nodes.audioData.audio.duration` }, { path: `richContent.nodes.audioData.coverImage.duration` }, { path: `richContent.nodes.layoutData.backgroundImage.media.duration` }, { path: `richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `richContent.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `richContent.nodes.layoutData.backdropImage.media.duration` }, { path: `richContent.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `richContent.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `richContent.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `richContent.nodes.layoutData.background.gradient.centerX` }, { path: `richContent.nodes.layoutData.background.gradient.centerY` }, { path: `richContent.nodes.layoutData.background.gradient.stops.position` }, { path: `richContent.nodes.layoutData.backdrop.gradient.centerX` }, { path: `richContent.nodes.layoutData.backdrop.gradient.centerY` }, { path: `richContent.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `richContent.nodes.shapeData.shape.duration` }, { path: `richContent.nodes.cardData.background.gradient.centerX` }, { path: `richContent.nodes.cardData.background.gradient.centerY` }, { path: `richContent.nodes.cardData.background.gradient.stops.position` }, { path: `richContent.nodes.cardData.backgroundImage.media.duration` }, { path: `richContent.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `richContent.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `richContent.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `richContent.nodes.tocData.fontSize` }, { path: `richContent.nodes.tocData.itemSpacing` }, { path: `richContent.nodes.smartBlockCellData.shape.duration` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.stops.position` }];
|
|
3511
|
+
var ns = [{ path: `richContent.metadata.createdTimestamp` }, { path: `richContent.metadata.updatedTimestamp` }];
|
|
3512
|
+
function rs(e6) {
|
|
3514
3513
|
return P(Object.assign(e6, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/blog-paywall-service`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/blog-paywall-service`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/blog-paywall-service`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/blog-paywall-service`, destPath: `` }], _: [{ srcPath: `/_api/blog-paywall-service`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/blog-paywall-service/v1/post-paywalls`, destPath: `/v1/post-paywalls` }] } }));
|
|
3515
3514
|
}
|
|
3516
|
-
var
|
|
3517
|
-
function
|
|
3515
|
+
var is = `@wix/auto_sdk_blog_post-paywalls`;
|
|
3516
|
+
function as(e6) {
|
|
3518
3517
|
function t2({ host: t3 }) {
|
|
3519
|
-
return { entityFqdn: `wix.blog.blog_paywall_service.v1.post_paywall`, method: `GET`, methodFqn: `wix.blog.blog_paywall_service.v1.PostPaywallService.GetPostPaywall`, packageName:
|
|
3518
|
+
return { entityFqdn: `wix.blog.blog_paywall_service.v1.post_paywall`, method: `GET`, methodFqn: `wix.blog.blog_paywall_service.v1.PostPaywallService.GetPostPaywall`, packageName: is, migrationOptions: { optInTransformResponse: true }, url: rs({ protoPath: `/v1/post-paywalls/{postFqdn}/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: fn, paths: ts }, { transformFn: k, paths: ns }]) };
|
|
3520
3519
|
}
|
|
3521
3520
|
return t2;
|
|
3522
3521
|
}
|
|
3523
|
-
async function
|
|
3524
|
-
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 =
|
|
3522
|
+
async function os(e6, t2) {
|
|
3523
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = as(D({ postFqdn: e6?.postFqdn, postId: e6?.postId, language: t2?.language }, []));
|
|
3525
3524
|
r2?.onSiteCall?.();
|
|
3526
3525
|
try {
|
|
3527
3526
|
let e7 = await n2.request(i2);
|
|
@@ -3531,29 +3530,29 @@ async function as(e6, t2) {
|
|
|
3531
3530
|
throw r2?.onError?.(e7), t3;
|
|
3532
3531
|
}
|
|
3533
3532
|
}
|
|
3534
|
-
function
|
|
3535
|
-
return (t2, n2) =>
|
|
3533
|
+
function ss(e6) {
|
|
3534
|
+
return (t2, n2) => os(t2, n2, { httpClient: e6 });
|
|
3536
3535
|
}
|
|
3537
|
-
var
|
|
3538
|
-
function
|
|
3536
|
+
var cs = M(ss);
|
|
3537
|
+
function ls(e6) {
|
|
3539
3538
|
return Object.keys(e6).length === 1 && `$and` in e6 && Array.isArray(e6.$and);
|
|
3540
3539
|
}
|
|
3541
|
-
function
|
|
3540
|
+
function us(e6) {
|
|
3542
3541
|
return Object.keys(e6).length === 1 && `$or` in e6 && Array.isArray(e6.$or);
|
|
3543
3542
|
}
|
|
3544
|
-
function
|
|
3543
|
+
function ds(e6) {
|
|
3545
3544
|
return Object.keys(e6).length === 1 && `$not` in e6 && typeof e6.$not == `object`;
|
|
3546
3545
|
}
|
|
3547
|
-
function
|
|
3548
|
-
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $and: [...
|
|
3546
|
+
function J(e6, t2) {
|
|
3547
|
+
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $and: [...ls(e6) ? e6.$and : [e6], ...ls(t2) ? t2.$and : [t2]] };
|
|
3549
3548
|
}
|
|
3550
|
-
function
|
|
3551
|
-
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $or: [...
|
|
3549
|
+
function fs(e6, t2) {
|
|
3550
|
+
return e6 === void 0 || Object.keys(e6).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e6 : { $or: [...us(e6) ? e6.$or : [e6], ...us(t2) ? t2.$or : [t2]] };
|
|
3552
3551
|
}
|
|
3553
|
-
function
|
|
3554
|
-
if (e6 !== void 0 && Object.keys(e6).length !== 0) return
|
|
3552
|
+
function ps(e6) {
|
|
3553
|
+
if (e6 !== void 0 && Object.keys(e6).length !== 0) return ds(e6) ? e6.$not : { $not: e6 };
|
|
3555
3554
|
}
|
|
3556
|
-
var
|
|
3555
|
+
var ms = class {
|
|
3557
3556
|
_items;
|
|
3558
3557
|
_fetchNextPage;
|
|
3559
3558
|
_fetchPrevPage;
|
|
@@ -3583,7 +3582,7 @@ var ps = class {
|
|
|
3583
3582
|
return await this._fetchPrevPage();
|
|
3584
3583
|
}
|
|
3585
3584
|
};
|
|
3586
|
-
var
|
|
3585
|
+
var hs = class extends ms {
|
|
3587
3586
|
_nextCursor;
|
|
3588
3587
|
_prevCursor;
|
|
3589
3588
|
cursors;
|
|
@@ -3597,7 +3596,7 @@ var ms = class extends ps {
|
|
|
3597
3596
|
return !!this._prevCursor;
|
|
3598
3597
|
}
|
|
3599
3598
|
};
|
|
3600
|
-
var
|
|
3599
|
+
var gs = class extends ms {
|
|
3601
3600
|
_totalCount;
|
|
3602
3601
|
_offset;
|
|
3603
3602
|
_tooManyToCount;
|
|
@@ -3620,76 +3619,76 @@ var hs = class extends ps {
|
|
|
3620
3619
|
return !!(this._limit !== 0 && this.currentPage && this.currentPage > 0);
|
|
3621
3620
|
}
|
|
3622
3621
|
};
|
|
3623
|
-
function
|
|
3622
|
+
function _s(e6) {
|
|
3624
3623
|
let t2 = (n2) => ({ query: n2, async find() {
|
|
3625
3624
|
try {
|
|
3626
3625
|
let r2 = e6.requestTransformer(e6.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e6.func(r2), { [$e]: a2, [et]: o2 } = e6.responseTransformer(i2);
|
|
3627
3626
|
if (e6.pagingMethod === `OFFSET`) {
|
|
3628
3627
|
let e7 = n2;
|
|
3629
|
-
return new
|
|
3628
|
+
return new gs({ 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 });
|
|
3630
3629
|
}
|
|
3631
3630
|
let s2 = n2.cursorPaging;
|
|
3632
|
-
return new
|
|
3631
|
+
return new hs({ 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 });
|
|
3633
3632
|
} catch (t3) {
|
|
3634
3633
|
throw e6.errorTransformer(t3);
|
|
3635
3634
|
}
|
|
3636
3635
|
}, skipTo(e7) {
|
|
3637
3636
|
return t2({ ...n2, cursorPaging: { cursor: e7, limit: n2.cursorPaging.limit } });
|
|
3638
3637
|
}, eq(r2, i2) {
|
|
3639
|
-
let a2 = i2 === void 0 ? null : i2, o2 = { [
|
|
3640
|
-
return t2({ ...n2, filter:
|
|
3638
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [Y(e6.transformationPaths, r2)]: a2 };
|
|
3639
|
+
return t2({ ...n2, filter: J(n2.filter, o2) });
|
|
3641
3640
|
}, ne(r2, i2) {
|
|
3642
|
-
let a2 = i2 === void 0 ? null : i2, o2 = { [
|
|
3643
|
-
return t2({ ...n2, filter:
|
|
3641
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [Y(e6.transformationPaths, r2)]: { $ne: a2 } };
|
|
3642
|
+
return t2({ ...n2, filter: J(n2.filter, o2) });
|
|
3644
3643
|
}, ge(r2, i2) {
|
|
3645
|
-
let a2 = { [
|
|
3646
|
-
return t2({ ...n2, filter:
|
|
3644
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $gte: i2 } };
|
|
3645
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3647
3646
|
}, gt(r2, i2) {
|
|
3648
|
-
let a2 = { [
|
|
3649
|
-
return t2({ ...n2, filter:
|
|
3647
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $gt: i2 } };
|
|
3648
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3650
3649
|
}, le(r2, i2) {
|
|
3651
|
-
let a2 = { [
|
|
3652
|
-
return t2({ ...n2, filter:
|
|
3650
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $lte: i2 } };
|
|
3651
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3653
3652
|
}, lt(r2, i2) {
|
|
3654
|
-
let a2 = { [
|
|
3655
|
-
return t2({ ...n2, filter:
|
|
3653
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $lt: i2 } };
|
|
3654
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3656
3655
|
}, isNotEmpty(e7) {
|
|
3657
3656
|
return this.ne(e7, null);
|
|
3658
3657
|
}, isEmpty(e7) {
|
|
3659
3658
|
return this.eq(e7, null);
|
|
3660
3659
|
}, startsWith(r2, i2) {
|
|
3661
|
-
let a2 = { [
|
|
3662
|
-
return t2({ ...n2, filter:
|
|
3660
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $startsWith: i2 } };
|
|
3661
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3663
3662
|
}, endsWith(r2, i2) {
|
|
3664
|
-
let a2 = { [
|
|
3665
|
-
return t2({ ...n2, filter:
|
|
3663
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $endsWith: i2 } };
|
|
3664
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3666
3665
|
}, contains(r2, i2) {
|
|
3667
|
-
let a2 = { [
|
|
3668
|
-
return t2({ ...n2, filter:
|
|
3666
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $contains: i2 } };
|
|
3667
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3669
3668
|
}, hasSome(r2, ...i2) {
|
|
3670
|
-
let a2 = { [
|
|
3671
|
-
return t2({ ...n2, filter:
|
|
3669
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $hasSome: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
3670
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3672
3671
|
}, hasAll(r2, ...i2) {
|
|
3673
|
-
let a2 = { [
|
|
3674
|
-
return t2({ ...n2, filter:
|
|
3672
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $hasAll: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
3673
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3675
3674
|
}, between(e7, t3, n3) {
|
|
3676
3675
|
return this.ge(e7, t3).lt(e7, n3);
|
|
3677
3676
|
}, in(r2, i2) {
|
|
3678
|
-
let a2 = { [
|
|
3679
|
-
return t2({ ...n2, filter:
|
|
3677
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $in: i2 } };
|
|
3678
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3680
3679
|
}, exists(r2, i2 = true) {
|
|
3681
|
-
let a2 = { [
|
|
3682
|
-
return t2({ ...n2, filter:
|
|
3680
|
+
let a2 = { [Y(e6.transformationPaths, r2)]: { $exists: i2 } };
|
|
3681
|
+
return t2({ ...n2, filter: J(n2.filter, a2) });
|
|
3683
3682
|
}, or(e7) {
|
|
3684
|
-
return t2({ ...n2, filter:
|
|
3683
|
+
return t2({ ...n2, filter: fs(n2.filter, e7.query.filter) });
|
|
3685
3684
|
}, and(e7) {
|
|
3686
|
-
return t2({ ...n2, filter:
|
|
3685
|
+
return t2({ ...n2, filter: J(n2.filter, e7.query.filter) });
|
|
3687
3686
|
}, not(e7) {
|
|
3688
|
-
return t2({ ...n2, filter:
|
|
3687
|
+
return t2({ ...n2, filter: ps(e7.query.filter) });
|
|
3689
3688
|
}, ascending(...r2) {
|
|
3690
|
-
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName:
|
|
3689
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: Y(e6.transformationPaths, t3), order: `ASC` }))] });
|
|
3691
3690
|
}, descending(...r2) {
|
|
3692
|
-
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName:
|
|
3691
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: Y(e6.transformationPaths, t3), order: `DESC` }))] });
|
|
3693
3692
|
}, skip(e7) {
|
|
3694
3693
|
return t2({ ...n2, paging: { offset: e7, limit: `limit` in n2.paging ? n2.paging.limit : 50 } });
|
|
3695
3694
|
}, limit(r2) {
|
|
@@ -3702,71 +3701,71 @@ function gs(e6) {
|
|
|
3702
3701
|
} });
|
|
3703
3702
|
return t2({ filter: {}, ...e6.pagingMethod === `OFFSET` ? { paging: { offset: 0, limit: 50 } } : { cursorPaging: { limit: 50 } } });
|
|
3704
3703
|
}
|
|
3705
|
-
function
|
|
3704
|
+
function Y(e6, t2) {
|
|
3706
3705
|
let n2 = Object.entries(e6).find(([e7]) => e7 === t2 || t2.startsWith(`${e7}.`))?.[0];
|
|
3707
3706
|
return n2 ? t2.replace(n2, e6[n2]) : nt(t2, { ...e6, ...tt });
|
|
3708
3707
|
}
|
|
3709
|
-
var
|
|
3710
|
-
var
|
|
3711
|
-
var
|
|
3712
|
-
var
|
|
3713
|
-
var
|
|
3714
|
-
var
|
|
3715
|
-
function
|
|
3708
|
+
var vs = `filter`;
|
|
3709
|
+
var ys = `sort`;
|
|
3710
|
+
var bs = `cursorPaging`;
|
|
3711
|
+
var xs = `paging`;
|
|
3712
|
+
var Ss = [vs, ys, bs];
|
|
3713
|
+
var Cs = [vs, ys, xs];
|
|
3714
|
+
function ws(e6, t2) {
|
|
3716
3715
|
return !e6 || typeof e6 != `object` ? false : t2.some((t3) => e6.hasOwnProperty(t3));
|
|
3717
3716
|
}
|
|
3718
|
-
function ws(e6) {
|
|
3719
|
-
return Cs(e6, xs);
|
|
3720
|
-
}
|
|
3721
3717
|
function Ts(e6) {
|
|
3722
|
-
return
|
|
3718
|
+
return ws(e6, Ss);
|
|
3723
3719
|
}
|
|
3724
3720
|
function Es(e6) {
|
|
3721
|
+
return ws(e6, Cs);
|
|
3722
|
+
}
|
|
3723
|
+
function Ds(e6) {
|
|
3725
3724
|
let { hasOptionsParameter: t2 } = e6;
|
|
3726
3725
|
return function(...n2) {
|
|
3727
|
-
return t2 ?
|
|
3726
|
+
return t2 ? ks(n2, e6) : Os(n2, e6);
|
|
3728
3727
|
};
|
|
3729
3728
|
}
|
|
3730
|
-
function
|
|
3729
|
+
function Os(e6, t2) {
|
|
3731
3730
|
return e6.length === 0 ? t2.builderQueryFunction() : t2.typedQueryFunction(e6[0]);
|
|
3732
3731
|
}
|
|
3733
|
-
function
|
|
3732
|
+
function ks(e6, t2) {
|
|
3734
3733
|
switch (e6.length) {
|
|
3735
3734
|
case 0:
|
|
3736
3735
|
return t2.builderQueryFunction();
|
|
3737
3736
|
case 1:
|
|
3738
|
-
return
|
|
3737
|
+
return Ts(e6[0]) || Es(e6[0]) ? t2.typedQueryFunction(e6[0]) : t2.builderQueryFunction(e6[0]);
|
|
3739
3738
|
default:
|
|
3740
3739
|
return t2.typedQueryFunction(e6[0], e6[1]);
|
|
3741
3740
|
}
|
|
3742
3741
|
}
|
|
3743
|
-
var
|
|
3744
|
-
var
|
|
3745
|
-
function
|
|
3742
|
+
var As = [{ path: `like.createdDate` }];
|
|
3743
|
+
var js = [{ path: `likes.createdDate` }];
|
|
3744
|
+
function Ms(e6) {
|
|
3746
3745
|
return P(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` }] } }));
|
|
3747
3746
|
}
|
|
3748
|
-
var
|
|
3749
|
-
function
|
|
3747
|
+
var Ns = `@wix/auto_sdk_blog_likes`;
|
|
3748
|
+
function Ps(e6) {
|
|
3750
3749
|
function t2({ host: t3 }) {
|
|
3751
|
-
let n2 = A(e6, [{ transformFn: st, paths:
|
|
3752
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.CreateLike`, packageName:
|
|
3750
|
+
let n2 = A(e6, [{ transformFn: st, paths: As }]);
|
|
3751
|
+
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.CreateLike`, packageName: Ns, migrationOptions: { optInTransformResponse: true }, url: Ms({ protoPath: `/v1/likes`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: As }]) };
|
|
3753
3752
|
}
|
|
3754
3753
|
return t2;
|
|
3755
3754
|
}
|
|
3756
|
-
function
|
|
3755
|
+
function Fs(e6) {
|
|
3757
3756
|
function t2({ host: t3 }) {
|
|
3758
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.QueryLikes`, packageName:
|
|
3757
|
+
return { entityFqdn: `wix.blog.v1.like`, method: `POST`, methodFqn: `wix.blog.v1.LikeService.QueryLikes`, packageName: Ns, migrationOptions: { optInTransformResponse: true }, url: Ms({ protoPath: `/v1/likes/query`, data: e6, host: t3 }), data: e6, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: js }]) };
|
|
3759
3758
|
}
|
|
3760
3759
|
return t2;
|
|
3761
3760
|
}
|
|
3762
|
-
function
|
|
3761
|
+
function Is(e6) {
|
|
3763
3762
|
function t2({ host: t3 }) {
|
|
3764
|
-
return { entityFqdn: `wix.blog.v1.like`, method: `DELETE`, methodFqn: `wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId`, packageName:
|
|
3763
|
+
return { entityFqdn: `wix.blog.v1.like`, method: `DELETE`, methodFqn: `wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId`, packageName: Ns, migrationOptions: { optInTransformResponse: true }, url: Ms({ protoPath: `/v1/likes/fqdn/{fqdn}/entity-id/{entityId}`, data: e6, host: t3 }), params: N(e6) };
|
|
3765
3764
|
}
|
|
3766
3765
|
return t2;
|
|
3767
3766
|
}
|
|
3768
|
-
async function
|
|
3769
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
3767
|
+
async function Ls(e6) {
|
|
3768
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Ps(D({ like: e6?.like }));
|
|
3770
3769
|
n2?.onSiteCall?.();
|
|
3771
3770
|
try {
|
|
3772
3771
|
let e7 = await t2.request(r2);
|
|
@@ -3776,10 +3775,10 @@ async function Is(e6) {
|
|
|
3776
3775
|
throw n2?.onError?.(e7), t3;
|
|
3777
3776
|
}
|
|
3778
3777
|
}
|
|
3779
|
-
function
|
|
3778
|
+
function Rs() {
|
|
3780
3779
|
let { httpClient: e6, sideEffects: t2 } = arguments[0];
|
|
3781
|
-
return
|
|
3782
|
-
let r2 =
|
|
3780
|
+
return _s({ func: async (n2) => {
|
|
3781
|
+
let r2 = Fs(n2);
|
|
3783
3782
|
t2?.onSiteCall?.();
|
|
3784
3783
|
try {
|
|
3785
3784
|
let n3 = await e6.request(r2);
|
|
@@ -3797,8 +3796,8 @@ function Ls() {
|
|
|
3797
3796
|
throw j(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
3798
3797
|
}, pagingMethod: `CURSOR`, transformationPaths: {} });
|
|
3799
3798
|
}
|
|
3800
|
-
async function
|
|
3801
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
3799
|
+
async function zs(e6) {
|
|
3800
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Fs(D({ query: e6 }));
|
|
3802
3801
|
n2?.onSiteCall?.();
|
|
3803
3802
|
try {
|
|
3804
3803
|
let e7 = await t2.request(r2);
|
|
@@ -3808,8 +3807,8 @@ async function Rs(e6) {
|
|
|
3808
3807
|
throw n2?.onError?.(e7), t3;
|
|
3809
3808
|
}
|
|
3810
3809
|
}
|
|
3811
|
-
async function
|
|
3812
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
3810
|
+
async function Bs(e6) {
|
|
3811
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Is(D({ fqdn: e6?.fqdn, entityId: e6?.entityId }));
|
|
3813
3812
|
n2?.onSiteCall?.();
|
|
3814
3813
|
try {
|
|
3815
3814
|
let e7 = await t2.request(r2);
|
|
@@ -3819,34 +3818,34 @@ async function zs(e6) {
|
|
|
3819
3818
|
throw n2?.onError?.(e7), t3;
|
|
3820
3819
|
}
|
|
3821
3820
|
}
|
|
3822
|
-
function Bs(e6) {
|
|
3823
|
-
return (t2) => Is(t2, { httpClient: e6 });
|
|
3824
|
-
}
|
|
3825
3821
|
function Vs(e6) {
|
|
3826
|
-
return () => Ls({ httpClient: e6 });
|
|
3822
|
+
return (t2) => Ls(t2, { httpClient: e6 });
|
|
3827
3823
|
}
|
|
3828
3824
|
function Hs(e6) {
|
|
3829
|
-
return (
|
|
3825
|
+
return () => Rs({ httpClient: e6 });
|
|
3830
3826
|
}
|
|
3831
3827
|
function Us(e6) {
|
|
3832
3828
|
return (t2) => zs(t2, { httpClient: e6 });
|
|
3833
3829
|
}
|
|
3834
3830
|
function Ws(e6) {
|
|
3835
|
-
|
|
3831
|
+
return (t2) => Bs(t2, { httpClient: e6 });
|
|
3832
|
+
}
|
|
3833
|
+
function Gs(e6) {
|
|
3834
|
+
let t2 = Ds({ builderQueryFunction: () => Hs(e6)(), typedQueryFunction: (t3) => Us(e6)(t3), hasOptionsParameter: false });
|
|
3836
3835
|
function n2(e7) {
|
|
3837
3836
|
return t2(...arguments);
|
|
3838
3837
|
}
|
|
3839
3838
|
return n2;
|
|
3840
3839
|
}
|
|
3841
|
-
var
|
|
3842
|
-
var Ks = M(Us);
|
|
3840
|
+
var Ks = M(Vs);
|
|
3843
3841
|
var qs = M(Ws);
|
|
3844
|
-
|
|
3842
|
+
var Js = M(Gs);
|
|
3843
|
+
function Ys(e6) {
|
|
3845
3844
|
if (!e6) return;
|
|
3846
3845
|
let t2 = ``;
|
|
3847
3846
|
return (e6.filename || e6.altText) && (t2 = `/${encodeURIComponent(e6.filename || e6.altText)}`), e6.id ? `wix:image://v1/${e6.id}${t2}#originWidth=${e6.width}&originHeight=${e6.height}` : e6.url;
|
|
3848
3847
|
}
|
|
3849
|
-
function
|
|
3848
|
+
function X(e6) {
|
|
3850
3849
|
if (e6) return [`http://`, `https://`].some((t2) => e6.base?.startsWith(t2)) ? `${e6.base}${e6.path}` : `http://${e6.base}${e6.path}`;
|
|
3851
3850
|
}
|
|
3852
3851
|
var Xs = [{ path: `categories.updatedDate` }, { path: `categories.coverImage.urlExpirationDate` }];
|
|
@@ -3857,7 +3856,7 @@ function Qs(e6) {
|
|
|
3857
3856
|
var $s = `@wix/auto_sdk_blog_categories`;
|
|
3858
3857
|
function ec(e6) {
|
|
3859
3858
|
function t2({ host: t3 }) {
|
|
3860
|
-
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.ListCategories`, packageName: $s, migrationOptions: { optInTransformResponse: true }, url: Qs({ protoPath: `/v3/categories`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: Xs }, { transformFn:
|
|
3859
|
+
return { entityFqdn: `wix.blog.v3.category`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.CategoryService.ListCategories`, packageName: $s, migrationOptions: { optInTransformResponse: true }, url: Qs({ protoPath: `/v3/categories`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: Xs }, { transformFn: fn, paths: Zs }]) };
|
|
3861
3860
|
}
|
|
3862
3861
|
return t2;
|
|
3863
3862
|
}
|
|
@@ -3868,7 +3867,7 @@ async function rc(e6) {
|
|
|
3868
3867
|
n2?.onSiteCall?.();
|
|
3869
3868
|
try {
|
|
3870
3869
|
let e7 = await t2.request(r2);
|
|
3871
|
-
return n2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn:
|
|
3870
|
+
return n2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn: X, paths: tc }, { transformFn: Ys, paths: nc }]));
|
|
3872
3871
|
} catch (e7) {
|
|
3873
3872
|
let t3 = j(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { paging: `$[0].paging`, fieldsets: `$[0].fieldsets`, language: `$[0].language` }, singleArgumentUnchanged: false }, [`options`]);
|
|
3874
3873
|
throw n2?.onError?.(e7), t3;
|
|
@@ -3903,13 +3902,13 @@ function dc(e6) {
|
|
|
3903
3902
|
var fc = `@wix/auto_sdk_blog_posts`;
|
|
3904
3903
|
function pc(e6) {
|
|
3905
3904
|
function t2({ host: t3 }) {
|
|
3906
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: sc }, { transformFn:
|
|
3905
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: k, paths: sc }, { transformFn: pn, paths: cc }, { transformFn: fn, paths: lc }]) };
|
|
3907
3906
|
}
|
|
3908
3907
|
return t2;
|
|
3909
3908
|
}
|
|
3910
3909
|
function mc(e6) {
|
|
3911
3910
|
function t2({ host: t3 }) {
|
|
3912
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}/metrics`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn:
|
|
3911
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `GET`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics`, packageName: fc, migrationOptions: { optInTransformResponse: true }, url: dc({ protoPath: `/v3/posts/{postId}/metrics`, data: e6, host: t3 }), params: N(e6), transformResponse: (e7) => A(e7, [{ transformFn: fn, paths: uc }]) };
|
|
3913
3912
|
}
|
|
3914
3913
|
return t2;
|
|
3915
3914
|
}
|
|
@@ -3922,7 +3921,7 @@ async function vc(e6, t2) {
|
|
|
3922
3921
|
r2?.onSiteCall?.();
|
|
3923
3922
|
try {
|
|
3924
3923
|
let e7 = await n2.request(i2);
|
|
3925
|
-
return r2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn:
|
|
3924
|
+
return r2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn: X, paths: hc }, { transformFn: Ys, paths: gc }, { transformFn: oc, paths: _c }]), [`post.richContent`, `post.rich_content`]);
|
|
3926
3925
|
} catch (e7) {
|
|
3927
3926
|
let t3 = j(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { postId: `$[0]`, fieldsets: `$[1].fieldsets` }, singleArgumentUnchanged: false }, [`postId`, `options`]);
|
|
3928
3927
|
throw r2?.onError?.(e7), t3;
|
|
@@ -3963,7 +3962,7 @@ function Oc(e6) {
|
|
|
3963
3962
|
var kc = [{ path: `tags.url` }];
|
|
3964
3963
|
function Ac(e6) {
|
|
3965
3964
|
let { httpClient: t2, sideEffects: n2 } = arguments[1];
|
|
3966
|
-
return
|
|
3965
|
+
return _s({ func: async (r2) => {
|
|
3967
3966
|
let i2 = Oc({ ...r2, ...e6 ?? {} });
|
|
3968
3967
|
n2?.onSiteCall?.();
|
|
3969
3968
|
try {
|
|
@@ -3976,7 +3975,7 @@ function Ac(e6) {
|
|
|
3976
3975
|
let n3 = [t3, e6];
|
|
3977
3976
|
return D({ ...n3?.[1], query: n3?.[0] });
|
|
3978
3977
|
}, responseTransformer: ({ data: e7 }) => {
|
|
3979
|
-
let t3 = O(A(e7, [{ transformFn:
|
|
3978
|
+
let t3 = O(A(e7, [{ transformFn: X, paths: kc }]));
|
|
3980
3979
|
return { items: t3?.tags, pagingMetadata: t3?.pagingMetadata };
|
|
3981
3980
|
}, errorTransformer: (e7) => {
|
|
3982
3981
|
throw j(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
@@ -3987,7 +3986,7 @@ async function jc(e6, t2) {
|
|
|
3987
3986
|
r2?.onSiteCall?.();
|
|
3988
3987
|
try {
|
|
3989
3988
|
let e7 = await n2.request(i2);
|
|
3990
|
-
return r2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn:
|
|
3989
|
+
return r2?.onSuccess?.(e7), O(A(e7.data, [{ transformFn: X, paths: kc }]));
|
|
3991
3990
|
} catch (e7) {
|
|
3992
3991
|
let t3 = j(e7, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`, `options`]);
|
|
3993
3992
|
throw r2?.onError?.(e7), t3;
|
|
@@ -4000,14 +3999,14 @@ function Nc(e6) {
|
|
|
4000
3999
|
return (t2, n2) => jc(t2, n2, { httpClient: e6 });
|
|
4001
4000
|
}
|
|
4002
4001
|
function Pc(e6) {
|
|
4003
|
-
let t2 =
|
|
4002
|
+
let t2 = Ds({ builderQueryFunction: (t3) => Mc(e6)(t3), typedQueryFunction: (t3, n3) => Nc(e6)(t3, n3), hasOptionsParameter: true });
|
|
4004
4003
|
function n2(e7, n3) {
|
|
4005
4004
|
return t2(...arguments);
|
|
4006
4005
|
}
|
|
4007
4006
|
return n2;
|
|
4008
4007
|
}
|
|
4009
4008
|
var Fc = M(Pc);
|
|
4010
|
-
var Ic = (e6) => O(A(e6, [{ transformFn:
|
|
4009
|
+
var Ic = (e6) => O(A(e6, [{ transformFn: X, paths: [{ path: `posts.url` }, { path: `posts.translations.url` }] }, { transformFn: Ys, paths: [{ path: `posts.heroImage` }, { path: `posts.media.wixMedia.image` }] }, { transformFn: oc, paths: [{ path: `posts.media.wixMedia.videoV2` }] }]), [`posts.richContent`, `posts.rich_content`]).posts ?? [];
|
|
4011
4010
|
var Lc = `https://blog.wixsite.com/blog-demo-posts`;
|
|
4012
4011
|
M((e6) => async (t2) => {
|
|
4013
4012
|
let n2 = await e6.fetchWithAuth(`${globalThis.location.origin}/_serverless/blog-demo-posts/v3/demo-posts?${N(t2)}`);
|
|
@@ -4049,7 +4048,7 @@ var Gc = async (e6) => {
|
|
|
4049
4048
|
};
|
|
4050
4049
|
var Kc = `wix.blog.v4.post`;
|
|
4051
4050
|
var qc = async (e6, t2) => {
|
|
4052
|
-
let n2 = await
|
|
4051
|
+
let n2 = await cs({ postFqdn: Kc, postId: e6 }, t2 ? { language: t2 } : void 0);
|
|
4053
4052
|
if (typeof n2 != `object` || !n2) throw Error(`No Wix SDK context for the post paywall read`);
|
|
4054
4053
|
let { richContent: r2 } = n2;
|
|
4055
4054
|
return D(r2);
|
|
@@ -4085,7 +4084,7 @@ var il = `@wix/auto_sdk_blog_posts`;
|
|
|
4085
4084
|
function al(e6) {
|
|
4086
4085
|
function t2({ host: t3 }) {
|
|
4087
4086
|
let n2 = A(e6, [{ transformFn: dn, paths: nl }]);
|
|
4088
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: il, migrationOptions: { optInTransformResponse: true }, url: rl({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: $c }, { transformFn:
|
|
4087
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: il, migrationOptions: { optInTransformResponse: true }, url: rl({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => A(e7, [{ transformFn: k, paths: $c }, { transformFn: pn, paths: el }, { transformFn: fn, paths: tl }]) };
|
|
4089
4088
|
}
|
|
4090
4089
|
return t2;
|
|
4091
4090
|
}
|
|
@@ -4270,11 +4269,11 @@ var zl = (e6) => Ll(e6?.[Rl]);
|
|
|
4270
4269
|
var Bl = (e6) => {
|
|
4271
4270
|
let t2;
|
|
4272
4271
|
try {
|
|
4273
|
-
t2 = m(
|
|
4272
|
+
t2 = m(Qn);
|
|
4274
4273
|
} catch {
|
|
4275
4274
|
return;
|
|
4276
4275
|
}
|
|
4277
|
-
return
|
|
4276
|
+
return dr(t2, e6);
|
|
4278
4277
|
};
|
|
4279
4278
|
var Vl = 1e4;
|
|
4280
4279
|
function Hl(e6) {
|
|
@@ -4286,317 +4285,340 @@ function Hl(e6) {
|
|
|
4286
4285
|
}
|
|
4287
4286
|
var Ul = `wix.blog.v3.post`;
|
|
4288
4287
|
var Wl = async (e6) => {
|
|
4289
|
-
await
|
|
4288
|
+
await Ks({ like: { entityId: e6, fqdn: Ul } });
|
|
4290
4289
|
};
|
|
4291
4290
|
var Gl = async (e6) => {
|
|
4292
|
-
await
|
|
4291
|
+
await qs({ fqdn: Ul, entityId: e6 });
|
|
4292
|
+
};
|
|
4293
|
+
var Kl = 100;
|
|
4294
|
+
var ql;
|
|
4295
|
+
var Jl = (e6) => {
|
|
4296
|
+
let t2 = [...e6.keys()];
|
|
4297
|
+
for (let n2 = 0; n2 < t2.length; n2 += Kl) {
|
|
4298
|
+
let r2 = t2.slice(n2, n2 + Kl);
|
|
4299
|
+
Js().eq(`fqdn`, Ul).in(`entityId`, r2).limit(r2.length).find().then(({ items: t3 }) => {
|
|
4300
|
+
let n3 = new Set(t3.map((e7) => e7.entityId));
|
|
4301
|
+
for (let t4 of r2) e6.get(t4)?.forEach((e7) => e7.resolve(n3.has(t4)));
|
|
4302
|
+
}, (t3) => {
|
|
4303
|
+
for (let n3 of r2) e6.get(n3)?.forEach((e7) => e7.reject(t3));
|
|
4304
|
+
});
|
|
4305
|
+
}
|
|
4293
4306
|
};
|
|
4294
|
-
var
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4307
|
+
var Yl = (e6) => new Promise((t2, n2) => {
|
|
4308
|
+
if (!ql) {
|
|
4309
|
+
let e7 = /* @__PURE__ */ new Map();
|
|
4310
|
+
ql = e7, setTimeout(() => {
|
|
4311
|
+
ql = void 0, Jl(e7);
|
|
4312
|
+
});
|
|
4313
|
+
}
|
|
4314
|
+
ql.set(e6, [...ql.get(e6) ?? [], { resolve: t2, reject: n2 }]);
|
|
4315
|
+
});
|
|
4316
|
+
var Xl = (e6) => typeof e6 == `number` ? e6 : void 0;
|
|
4317
|
+
var Zl = async (e6, t2 = true) => {
|
|
4318
|
+
let [n2, r2] = await Promise.allSettled([Yl(e6), t2 ? Cc(e6) : void 0]), i2 = r2.status === `fulfilled` ? r2.value?.metrics : void 0;
|
|
4319
|
+
return { liked: n2.status === `fulfilled` && n2.value, likeCount: Xl(i2?.likes), viewCount: Xl(i2?.views), commentCount: Xl(i2?.comments) };
|
|
4298
4320
|
};
|
|
4299
|
-
var
|
|
4300
|
-
var
|
|
4321
|
+
var Ql = F(`@wix/site-service-editor-context`);
|
|
4322
|
+
var $l = () => {
|
|
4301
4323
|
try {
|
|
4302
|
-
return !!m(
|
|
4324
|
+
return !!m(Ql).previewMode;
|
|
4303
4325
|
} catch {
|
|
4304
4326
|
return false;
|
|
4305
4327
|
}
|
|
4306
4328
|
};
|
|
4307
|
-
var
|
|
4308
|
-
var
|
|
4309
|
-
var
|
|
4329
|
+
var eu = { liked: false, baselineLiked: false, freshLikeCount: void 0, viewCount: void 0, commentCount: void 0, isLikeCountLoaded: false };
|
|
4330
|
+
var tu = `wix-blog:post-like-toggled`;
|
|
4331
|
+
var nu = () => {
|
|
4310
4332
|
let e6 = window;
|
|
4311
|
-
return e6[
|
|
4333
|
+
return e6[tu] ??= /* @__PURE__ */ new Map();
|
|
4312
4334
|
};
|
|
4313
|
-
var
|
|
4314
|
-
|
|
4335
|
+
var ru = (e6) => {
|
|
4336
|
+
nu().set(e6.postId, e6.liked), window.dispatchEvent(new CustomEvent(tu, { detail: e6 }));
|
|
4315
4337
|
};
|
|
4316
|
-
var
|
|
4317
|
-
var
|
|
4318
|
-
let
|
|
4338
|
+
var iu = (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 });
|
|
4339
|
+
var au = (e6, t2, n2 = false, r2, i2 = true) => {
|
|
4340
|
+
let a2 = $l() || n2, [c2, p2] = f(eu), m2 = d(eu), h2 = d(t2), g2 = d(/* @__PURE__ */ new Set()), _2 = d(false), v2 = d(false), y2 = d(void 0), b2 = Xn(), [x2, S2] = f(0);
|
|
4319
4341
|
l(() => {
|
|
4320
|
-
let e7 =
|
|
4321
|
-
|
|
4342
|
+
let e7 = b2?.addMemberLoginListener?.(() => {
|
|
4343
|
+
nu().clear(), S2((e8) => e8 + 1);
|
|
4322
4344
|
});
|
|
4323
4345
|
return () => {
|
|
4324
|
-
e7 !== void 0 &&
|
|
4346
|
+
e7 !== void 0 && b2?.removeMemberLoginListener?.(e7);
|
|
4325
4347
|
};
|
|
4326
|
-
}, [
|
|
4327
|
-
let
|
|
4328
|
-
let t3 =
|
|
4329
|
-
Object.keys(n3).every((e8) => n3[e8] === t3[e8]) || (
|
|
4330
|
-
}, []),
|
|
4331
|
-
|
|
4348
|
+
}, [b2]);
|
|
4349
|
+
let C2 = s((e7) => {
|
|
4350
|
+
let t3 = m2.current, n3 = { ...t3, ...e7 };
|
|
4351
|
+
Object.keys(n3).every((e8) => n3[e8] === t3[e8]) || (m2.current = n3, g2.current.forEach((e8) => e8()), o(() => p2(n3)));
|
|
4352
|
+
}, []), ee2 = u(() => ({ get: () => iu(m2.current, h2.current), subscribe: (e7) => (g2.current.add(e7), () => {
|
|
4353
|
+
g2.current.delete(e7);
|
|
4332
4354
|
}) }), []);
|
|
4333
4355
|
l(() => {
|
|
4334
|
-
|
|
4356
|
+
h2.current !== t2 && (h2.current = t2, g2.current.forEach((e7) => e7()));
|
|
4335
4357
|
}, [t2]), l(() => {
|
|
4336
|
-
if (
|
|
4337
|
-
|
|
4358
|
+
if (y2.current !== e6 && (y2.current = e6, C2(eu)), v2.current = false, !e6 || a2) {
|
|
4359
|
+
C2({ isLikeCountLoaded: true });
|
|
4338
4360
|
return;
|
|
4339
4361
|
}
|
|
4340
4362
|
let t3 = false;
|
|
4341
|
-
return
|
|
4342
|
-
t3 ||
|
|
4363
|
+
return Zl(e6, i2).then(({ liked: e7, likeCount: n3, viewCount: r3, commentCount: i3 }) => {
|
|
4364
|
+
t3 || C2({ isLikeCountLoaded: true, viewCount: r3, commentCount: i3, baselineLiked: e7, freshLikeCount: n3, ...!v2.current && { liked: e7 } });
|
|
4343
4365
|
}).catch((n3) => {
|
|
4344
|
-
t3 ||
|
|
4366
|
+
t3 || C2({ isLikeCountLoaded: true }), Nl(r2, n3, { feature: Al.likes, action: `read-like-state`, level: `warning`, contexts: { likes: { postId: e6 } } });
|
|
4345
4367
|
}), () => {
|
|
4346
4368
|
t3 = true;
|
|
4347
4369
|
};
|
|
4348
|
-
}, [e6,
|
|
4370
|
+
}, [e6, a2, r2, C2, x2, i2]), l(() => {
|
|
4349
4371
|
if (!e6) return;
|
|
4350
4372
|
let t3 = (e7) => {
|
|
4351
|
-
|
|
4352
|
-
}, n3 =
|
|
4373
|
+
v2.current = true, C2({ liked: e7 });
|
|
4374
|
+
}, n3 = nu().get(e6);
|
|
4353
4375
|
n3 !== void 0 && t3(n3);
|
|
4354
4376
|
let r3 = (n4) => {
|
|
4355
4377
|
let { detail: r4 } = n4;
|
|
4356
4378
|
r4.postId === e6 && t3(r4.liked);
|
|
4357
4379
|
};
|
|
4358
|
-
return window.addEventListener(
|
|
4359
|
-
}, [e6,
|
|
4360
|
-
let
|
|
4361
|
-
if (!e6 ||
|
|
4362
|
-
|
|
4363
|
-
let n3 = !
|
|
4364
|
-
if (
|
|
4365
|
-
|
|
4380
|
+
return window.addEventListener(tu, r3), () => window.removeEventListener(tu, r3);
|
|
4381
|
+
}, [e6, C2]);
|
|
4382
|
+
let w2 = s(async (t3) => {
|
|
4383
|
+
if (!e6 || _2.current) return;
|
|
4384
|
+
v2.current = true;
|
|
4385
|
+
let n3 = !m2.current.liked;
|
|
4386
|
+
if (C2({ liked: n3 }), ru({ postId: e6, liked: n3 }), !a2) {
|
|
4387
|
+
_2.current = true;
|
|
4366
4388
|
try {
|
|
4367
4389
|
await (n3 ? Wl(e6) : Gl(e6));
|
|
4368
4390
|
} catch (t4) {
|
|
4369
|
-
|
|
4391
|
+
C2({ liked: !n3 }), ru({ postId: e6, liked: !n3 }), Nl(r2, t4, { feature: Al.likes, action: n3 ? `like-post` : `unlike-post`, contexts: { likes: { postId: e6 } } });
|
|
4370
4392
|
} finally {
|
|
4371
|
-
|
|
4393
|
+
_2.current = false;
|
|
4372
4394
|
}
|
|
4373
4395
|
}
|
|
4374
|
-
}, [e6,
|
|
4375
|
-
return { ...
|
|
4396
|
+
}, [e6, a2, r2, C2]);
|
|
4397
|
+
return { ...iu(c2, t2), toggleLike: w2, liveLikes: ee2 };
|
|
4376
4398
|
};
|
|
4377
|
-
var
|
|
4378
|
-
var
|
|
4399
|
+
var ou = F(`@wix/viewer-service-multilingual`);
|
|
4400
|
+
var su = () => {
|
|
4379
4401
|
let e6;
|
|
4380
4402
|
try {
|
|
4381
|
-
let { multilingualEnabled: t3, currentLocale: n3 } = m(
|
|
4403
|
+
let { multilingualEnabled: t3, currentLocale: n3 } = m(ou);
|
|
4382
4404
|
t3 && n3 && !n3.primaryLocale && (e6 = n3.regionalFormat);
|
|
4383
4405
|
} catch {
|
|
4384
4406
|
}
|
|
4385
4407
|
let t2, n2;
|
|
4386
4408
|
try {
|
|
4387
|
-
({ locale: t2, language: n2 } = m(
|
|
4409
|
+
({ locale: t2, language: n2 } = m(So));
|
|
4388
4410
|
} catch {
|
|
4389
4411
|
}
|
|
4390
4412
|
return e6 || t2 || n2;
|
|
4391
4413
|
};
|
|
4392
|
-
var
|
|
4414
|
+
var cu = () => {
|
|
4393
4415
|
try {
|
|
4394
|
-
return Xc(m(
|
|
4416
|
+
return Xc(m(Qn));
|
|
4395
4417
|
} catch {
|
|
4396
4418
|
return;
|
|
4397
4419
|
}
|
|
4398
4420
|
};
|
|
4399
|
-
var
|
|
4421
|
+
var lu = (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);
|
|
4400
4422
|
var Q = { timeToRead: `post.time-to-read`, viewCount: `post.view-count`, commentCount: `post.comment-count`, likeCount: `post.like-count`, noPostsTitle: `post-list.empty-state.title`, noPostsDescription: `post-list.empty-state.description`, noRelatedPostsTitle: `related-posts.empty-state.title`, noRelatedPostsDescription: `related-posts.empty-state.description`, canvasPostTitle: `canvas.post-title`, canvasAuthorName: `canvas.author-name`, canvasExcerpt: `canvas.excerpt`, canvasContent: `canvas.content`, canvasCategory: `canvas.category`, canvasCategoryNumbered: `canvas.category-numbered`, canvasTagNumbered: `canvas.tag-numbered`, canvasCoverAlt: `cover-media.placeholder-alt`, canvasAuthorPhotoAlt: `canvas.author-photo-alt` };
|
|
4401
|
-
var
|
|
4402
|
-
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted:
|
|
4423
|
+
var uu = (e6, t2) => {
|
|
4424
|
+
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: lu(r2, `full`, t2) });
|
|
4403
4425
|
return { timeToRead: (t3) => e6(Q.timeToRead, { count: t3 }), viewCount: n2(Q.viewCount), commentCount: n2(Q.commentCount), likeCount: n2(Q.likeCount), noPostsEmptyState: () => ({ title: e6(Q.noPostsTitle), description: e6(Q.noPostsDescription) }), noRelatedPostsEmptyState: () => ({ title: e6(Q.noRelatedPostsTitle), description: e6(Q.noRelatedPostsDescription) }), canvas: { postTitle: () => e6(Q.canvasPostTitle), authorName: () => e6(Q.canvasAuthorName), excerpt: () => e6(Q.canvasExcerpt), content: () => e6(Q.canvasContent), category: () => e6(Q.canvasCategory), categoryNumbered: (t3) => e6(Q.canvasCategoryNumbered, { number: t3 }), tagNumbered: (t3) => e6(Q.canvasTagNumbered, { number: t3 }), coverAlt: () => e6(Q.canvasCoverAlt), authorPhotoAlt: () => e6(Q.canvasAuthorPhotoAlt) } };
|
|
4404
4426
|
};
|
|
4405
|
-
var
|
|
4406
|
-
var
|
|
4407
|
-
var
|
|
4408
|
-
var
|
|
4427
|
+
var du = i({ isEditor: false, isPreview: false });
|
|
4428
|
+
var fu = () => c(du);
|
|
4429
|
+
var pu = ({ isEditor: e6, isPreview: t2 }) => e6 && !t2;
|
|
4430
|
+
var mu = () => {
|
|
4409
4431
|
try {
|
|
4410
|
-
let { SSR: e6, SEO: t2 } = m(
|
|
4432
|
+
let { SSR: e6, SEO: t2 } = m(Gn);
|
|
4411
4433
|
return e6 || t2;
|
|
4412
4434
|
} catch {
|
|
4413
4435
|
return false;
|
|
4414
4436
|
}
|
|
4415
4437
|
};
|
|
4416
|
-
var
|
|
4417
|
-
let e6 =
|
|
4418
|
-
return
|
|
4438
|
+
var hu = () => {
|
|
4439
|
+
let e6 = mu();
|
|
4440
|
+
return pu(fu()) && !e6;
|
|
4419
4441
|
};
|
|
4420
|
-
var
|
|
4421
|
-
var
|
|
4442
|
+
var gu = (e6) => ({ href: e6 ?? `#`, target: `_self` });
|
|
4443
|
+
var _u = (e6) => {
|
|
4422
4444
|
if (!e6) return;
|
|
4423
4445
|
let t2 = e6 instanceof Date ? e6 : new Date(e6);
|
|
4424
4446
|
return Number.isFinite(t2.getTime()) ? t2.toISOString() : void 0;
|
|
4425
4447
|
};
|
|
4426
|
-
var
|
|
4427
|
-
var
|
|
4428
|
-
var $ = (e6) => ({ text: e6, html: `<p>${
|
|
4429
|
-
var
|
|
4430
|
-
var
|
|
4431
|
-
var
|
|
4432
|
-
var
|
|
4433
|
-
var
|
|
4434
|
-
var
|
|
4448
|
+
var vu = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
|
|
4449
|
+
var yu = (e6) => e6.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`);
|
|
4450
|
+
var $ = (e6) => ({ text: e6, html: `<p>${yu(e6)}</p>`, linkList: [] });
|
|
4451
|
+
var bu = 6e4;
|
|
4452
|
+
var xu = bu * 60;
|
|
4453
|
+
var Su = xu * 24;
|
|
4454
|
+
var Cu = Su * 7;
|
|
4455
|
+
var wu = (e6) => e6 < bu ? [`second`, e6 / 1e3] : e6 < xu ? [`minute`, e6 / bu] : e6 < Su ? [`hour`, e6 / xu] : [`day`, e6 / Su];
|
|
4456
|
+
var Tu = (e6, t2, n2 = Date.now()) => {
|
|
4435
4457
|
let r2 = e6 instanceof Date ? e6 : new Date(e6), i2 = n2 - r2.getTime();
|
|
4436
|
-
if (i2 >= 0 && i2 <
|
|
4437
|
-
let [e7, n3] =
|
|
4458
|
+
if (i2 >= 0 && i2 < Cu) {
|
|
4459
|
+
let [e7, n3] = wu(i2);
|
|
4438
4460
|
return new Intl.RelativeTimeFormat(t2).format(-Math.round(n3), e7);
|
|
4439
4461
|
}
|
|
4440
4462
|
let a2 = r2.getFullYear() === new Date(n2).getFullYear();
|
|
4441
4463
|
return new Intl.DateTimeFormat(t2, { ...a2 ? {} : { year: `numeric` }, month: `short`, day: `numeric` }).format(r2);
|
|
4442
4464
|
};
|
|
4443
|
-
var
|
|
4444
|
-
var
|
|
4445
|
-
var
|
|
4465
|
+
var Eu = `https://static.wixstatic.com/media/`;
|
|
4466
|
+
var Du = 100;
|
|
4467
|
+
var Ou = (e6, t2 = ``) => {
|
|
4446
4468
|
let n2 = e6?.profile?.photo;
|
|
4447
4469
|
if (!n2?.url) return;
|
|
4448
|
-
let r2 = e6?.profile?.nickname, { _id: i2 } = n2, a2 = i2 || (n2.url.startsWith(
|
|
4449
|
-
return { ...a2 && { uri: a2 }, url: n2.url, name: r2 ?? a2 ?? `author-photo`, width: n2.width ||
|
|
4450
|
-
};
|
|
4451
|
-
var
|
|
4452
|
-
var
|
|
4453
|
-
var
|
|
4454
|
-
var
|
|
4455
|
-
var
|
|
4470
|
+
let r2 = e6?.profile?.nickname, { _id: i2 } = n2, a2 = i2 || (n2.url.startsWith(Eu) ? n2.url.slice(35).split(/[?#]/)[0] : void 0);
|
|
4471
|
+
return { ...a2 && { uri: a2 }, url: n2.url, name: r2 ?? a2 ?? `author-photo`, width: n2.width || Du, height: n2.height || Du, alt: r2 ?? t2 };
|
|
4472
|
+
};
|
|
4473
|
+
var ku = `https://static.wixstatic.com/media/`;
|
|
4474
|
+
var Au = `wix:image://`;
|
|
4475
|
+
var ju = 1200;
|
|
4476
|
+
var Mu = 800;
|
|
4477
|
+
var Nu = (e6) => {
|
|
4456
4478
|
if (!e6) return;
|
|
4457
4479
|
let t2 = Number.parseInt(e6, 10);
|
|
4458
4480
|
return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
|
|
4459
4481
|
};
|
|
4460
|
-
var
|
|
4461
|
-
if (!e6.startsWith(
|
|
4482
|
+
var Pu = (e6) => {
|
|
4483
|
+
if (!e6.startsWith(Au)) {
|
|
4462
4484
|
let t3 = e6.split(/[?#]/)[0];
|
|
4463
4485
|
return t3 ? { uri: t3 } : void 0;
|
|
4464
4486
|
}
|
|
4465
4487
|
let [t2, n2] = e6.slice(12).split(`#`), [, r2, i2] = t2.split(`/`).filter(Boolean);
|
|
4466
4488
|
if (!r2) return;
|
|
4467
4489
|
let a2 = new URLSearchParams(n2 ?? ``);
|
|
4468
|
-
return { uri: decodeURIComponent(r2), name: i2 ? decodeURIComponent(i2) : void 0, width:
|
|
4490
|
+
return { uri: decodeURIComponent(r2), name: i2 ? decodeURIComponent(i2) : void 0, width: Nu(a2.get(`originWidth`)), height: Nu(a2.get(`originHeight`)) };
|
|
4469
4491
|
};
|
|
4470
|
-
var
|
|
4492
|
+
var Fu = (e6, t2) => {
|
|
4471
4493
|
if (!e6) return;
|
|
4472
|
-
let n2 =
|
|
4494
|
+
let n2 = Pu(e6);
|
|
4473
4495
|
if (!n2) return;
|
|
4474
4496
|
let r2 = n2.name ?? n2.uri;
|
|
4475
|
-
return { uri: n2.uri, url: `${
|
|
4497
|
+
return { uri: n2.uri, url: `${ku}${n2.uri}`, name: r2, width: n2.width ?? ju, height: n2.height ?? Mu, alt: t2 ?? r2 };
|
|
4476
4498
|
};
|
|
4477
|
-
var
|
|
4499
|
+
var Iu = (e6) => {
|
|
4478
4500
|
let t2 = e6?.media?.wixMedia?.image;
|
|
4479
4501
|
if (!t2) return;
|
|
4480
|
-
let n2 =
|
|
4502
|
+
let n2 = Pu(t2);
|
|
4481
4503
|
if (!n2) return;
|
|
4482
4504
|
let r2 = n2.name ?? n2.uri;
|
|
4483
|
-
return { uri: n2.uri, url: `${
|
|
4505
|
+
return { uri: n2.uri, url: `${ku}${n2.uri}`, name: r2, width: n2.width ?? ju, height: n2.height ?? Mu, alt: e6?.media?.altText ?? e6?.title ?? r2 };
|
|
4484
4506
|
};
|
|
4485
|
-
var
|
|
4486
|
-
var
|
|
4487
|
-
var
|
|
4507
|
+
var Lu = `https://static.wixstatic.com/media/`;
|
|
4508
|
+
var Ru = `wix:video://`;
|
|
4509
|
+
var zu = (e6) => {
|
|
4488
4510
|
if (!e6) return;
|
|
4489
4511
|
let t2 = Number.parseInt(e6, 10);
|
|
4490
4512
|
return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
|
|
4491
4513
|
};
|
|
4492
|
-
var
|
|
4493
|
-
if (!e6.startsWith(
|
|
4514
|
+
var Bu = (e6) => {
|
|
4515
|
+
if (!e6.startsWith(Ru)) return;
|
|
4494
4516
|
let [t2, n2] = e6.slice(12).split(`#`), [, r2] = t2.split(`/`).filter(Boolean);
|
|
4495
4517
|
if (!r2) return;
|
|
4496
4518
|
let i2 = new URLSearchParams(n2 ?? ``), a2 = i2.get(`posterUri`);
|
|
4497
|
-
return { id: decodeURIComponent(r2), posterUrl: a2 ? `${
|
|
4519
|
+
return { id: decodeURIComponent(r2), posterUrl: a2 ? `${Lu}${a2}` : void 0, posterWidth: zu(i2.get(`posterWidth`)), posterHeight: zu(i2.get(`posterHeight`)) };
|
|
4498
4520
|
};
|
|
4499
|
-
var
|
|
4500
|
-
var
|
|
4501
|
-
var
|
|
4521
|
+
var Vu = [/https?:\/\/(?:www\.|m\.)?youtube\.com\/watch\?(?:[^#]*&)?v=([\w-]+)/i, /https?:\/\/(?:www\.)?youtube\.com\/embed\/([\w-]+)/i, /https?:\/\/youtu\.be\/([\w-]+)/i];
|
|
4522
|
+
var Hu = [/https?:\/\/player\.vimeo\.com\/video\/(\d+)/i, /https?:\/\/vimeo\.com\/(\d+)/i];
|
|
4523
|
+
var Uu = (e6, t2) => {
|
|
4502
4524
|
for (let n2 of e6) {
|
|
4503
4525
|
let e7 = n2.exec(t2);
|
|
4504
4526
|
if (e7) return e7[1];
|
|
4505
4527
|
}
|
|
4506
4528
|
};
|
|
4507
|
-
var
|
|
4508
|
-
let t2 =
|
|
4529
|
+
var Wu = (e6) => {
|
|
4530
|
+
let t2 = Uu(Vu, e6);
|
|
4509
4531
|
if (t2) return { provider: `youtube`, embedUrl: `https://www.youtube.com/embed/${t2}?autoplay=1` };
|
|
4510
|
-
let n2 =
|
|
4532
|
+
let n2 = Uu(Hu, e6);
|
|
4511
4533
|
return n2 ? { provider: `vimeo`, embedUrl: `https://player.vimeo.com/video/${n2}?autoplay=1` } : { provider: `unknown` };
|
|
4512
4534
|
};
|
|
4513
|
-
var
|
|
4535
|
+
var Gu = (e6, t2 = []) => {
|
|
4514
4536
|
let n2 = e6?.media;
|
|
4515
4537
|
if (!n2 || n2.displayed === false) return;
|
|
4516
|
-
let r2 =
|
|
4538
|
+
let r2 = Iu(e6);
|
|
4517
4539
|
if (r2) return { kind: `image`, image: r2 };
|
|
4518
|
-
let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ?
|
|
4540
|
+
let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ? Bu(n2.wixMedia.videoV2) : void 0;
|
|
4519
4541
|
if (a2) return { kind: `wixVideo`, ...a2, sources: t2, altText: i2 };
|
|
4520
4542
|
let o2 = n2.embedMedia?.video?.url;
|
|
4521
4543
|
if (o2) {
|
|
4522
4544
|
let { thumbnail: e7 } = n2.embedMedia ?? {};
|
|
4523
|
-
return { kind: `embed`, videoUrl: o2, ...
|
|
4545
|
+
return { kind: `embed`, videoUrl: o2, ...Wu(o2), thumbnailUrl: e7?.url, thumbnailWidth: e7?.width, thumbnailHeight: e7?.height, altText: i2 };
|
|
4524
4546
|
}
|
|
4525
4547
|
};
|
|
4526
|
-
var
|
|
4527
|
-
let t2 =
|
|
4548
|
+
var Ku = (e6) => {
|
|
4549
|
+
let t2 = Iu(e6), n2 = e6?.media?.wixMedia?.videoV2;
|
|
4528
4550
|
if (t2 || !n2) return t2;
|
|
4529
|
-
let r2 =
|
|
4551
|
+
let r2 = Bu(n2), i2 = Fu(r2?.posterUrl?.slice(35), e6?.media?.altText ?? e6?.title);
|
|
4530
4552
|
return i2 && { ...i2, width: r2?.posterWidth ?? i2.width, height: r2?.posterHeight ?? i2.height };
|
|
4531
4553
|
};
|
|
4532
|
-
var
|
|
4533
|
-
var
|
|
4534
|
-
let n2 =
|
|
4554
|
+
var qu = (e6, t2) => e6 && t2 ? `${e6}/${encodeURIComponent(t2)}` : void 0;
|
|
4555
|
+
var Ju = (e6, t2) => {
|
|
4556
|
+
let n2 = qu(e6, t2);
|
|
4535
4557
|
return n2 ? { href: n2, target: `_self` } : void 0;
|
|
4536
4558
|
};
|
|
4537
|
-
var
|
|
4538
|
-
var
|
|
4559
|
+
var Yu = { href: `#`, target: `_self` };
|
|
4560
|
+
var Xu = (e6, t2) => {
|
|
4539
4561
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
4540
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink:
|
|
4562
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink: Ju(t2, i2 ?? ``), categoryItem: { label: a2, slug: i2 ?? `` } };
|
|
4541
4563
|
};
|
|
4542
|
-
var
|
|
4543
|
-
var
|
|
4564
|
+
var Zu = 2;
|
|
4565
|
+
var Qu = (e6) => Array.from({ length: Zu }, (t2, n2) => {
|
|
4544
4566
|
let r2 = e6.canvas.categoryNumbered(n2 + 1);
|
|
4545
|
-
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink:
|
|
4567
|
+
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink: Yu, categoryItem: { label: r2, slug: `` } };
|
|
4546
4568
|
});
|
|
4547
|
-
var
|
|
4569
|
+
var $u = (e6, t2) => {
|
|
4548
4570
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
4549
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink:
|
|
4571
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink: Ju(t2, i2 ?? ``), tagItem: { label: a2, slug: i2 ?? `` } };
|
|
4550
4572
|
};
|
|
4551
|
-
var
|
|
4552
|
-
var
|
|
4573
|
+
var ed = 3;
|
|
4574
|
+
var td = (e6) => Array.from({ length: ed }, (t2, n2) => {
|
|
4553
4575
|
let r2 = e6.canvas.tagNumbered(n2 + 1);
|
|
4554
|
-
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink:
|
|
4576
|
+
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink: Yu, tagItem: { label: r2, slug: `` } };
|
|
4555
4577
|
});
|
|
4556
|
-
var
|
|
4557
|
-
var
|
|
4558
|
-
var
|
|
4559
|
-
var
|
|
4560
|
-
var
|
|
4561
|
-
var
|
|
4562
|
-
var
|
|
4563
|
-
var
|
|
4564
|
-
var
|
|
4565
|
-
let { t: a2 } =
|
|
4578
|
+
var nd = 1;
|
|
4579
|
+
var rd = { views: 120, comments: 4, likes: 12 };
|
|
4580
|
+
var id = (e6) => ({ nodes: [{ type: `PARAGRAPH`, nodes: [{ type: `TEXT`, nodes: [], textData: { text: e6, decorations: [] } }] }] });
|
|
4581
|
+
var ad = (e6, t2, n2, r2) => $(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
|
|
4582
|
+
var od = (e6, t2, n2) => e6 ?? (n2 ? t2 : void 0);
|
|
4583
|
+
var sd = { nodes: [] };
|
|
4584
|
+
var cd = () => ({ title: $(``), excerpt: $(``), coverImage: void 0, coverMedia: void 0, richContent: sd, authorName: $(``), authorImage: void 0, timeToRead: $(``), publishedDate: $(``), viewCount: $(``), commentCount: $(``), likeCount: $(``), postCategories: [], itemCategoryLabel: $(``), postTags: [], hasCoverImage: false, hasExcerpt: false, hasTags: false, publishedDateValue: void 0, minutesToReadValue: void 0, viewCountValue: void 0, commentCountValue: void 0 });
|
|
4585
|
+
var ld = ({ post: e6, author: t2, metrics: n2, categories: r2, tags: i2, videoSources: a2 }, o2, s2, c2 = false, l2 = Date.now(), u2 = {}) => !e6 && !c2 ? cd() : { title: $(e6?.title ?? o2.canvas.postTitle()), excerpt: $(e6?.excerpt ?? o2.canvas.excerpt()), coverImage: Ku(e6), coverMedia: Gu(e6, a2), richContent: e6?.richContent ?? id(o2.canvas.content()), authorName: $(t2?.profile?.nickname ?? o2.canvas.authorName()), authorImage: Ou(t2, o2.canvas.authorPhotoAlt()), timeToRead: $(typeof e6?.minutesToRead == `number` && e6.minutesToRead > 0 ? o2.timeToRead(e6.minutesToRead) : c2 ? o2.timeToRead(nd) : ``), publishedDate: $(Tu(e6?.firstPublishedDate ?? new Date(l2), s2, l2)), viewCount: ad(n2?.views, rd.views, c2, o2.viewCount), commentCount: ad(n2?.comments, rd.comments, c2, o2.commentCount), likeCount: ad(n2?.likes, rd.likes, c2, o2.likeCount), postCategories: r2.length === 0 && c2 ? Qu(o2) : r2.map((e7) => Xu(e7, u2.category)), itemCategoryLabel: $(r2[0]?.label ?? (c2 ? o2.canvas.category() : ``)), postTags: i2.length === 0 && c2 ? td(o2) : i2.map((e7) => $u(e7, u2.tag)), hasCoverImage: !e6 || e6.media?.displayed !== false && Ku(e6) !== void 0, hasExcerpt: !e6 || !!e6.excerpt?.trim(), hasTags: !e6 || i2.length > 0, publishedDateValue: _u(e6?.firstPublishedDate) ?? (c2 ? `2026-05-12T12:00:00.000Z` : void 0), minutesToReadValue: vu(e6?.minutesToRead) ?? (c2 ? nd : void 0), viewCountValue: od(n2?.views, rd.views, c2), commentCountValue: od(n2?.comments, rd.comments, c2) };
|
|
4586
|
+
var ud = ({ postWithAuthor: e6, hasError: t2, monitoringClient: n2, isPostInPreview: r2, postPageBase: i2 }) => {
|
|
4587
|
+
let { t: a2 } = bo(), o2 = su(), s2 = u(() => uu(a2, o2), [a2, o2]), c2 = Hl(e6.fetchedAt), l2 = hu(), { isLiked: d2, likeCount: f2, isLikeCountLoaded: p2, viewCount: m2, commentCount: h2, toggleLike: g2, liveLikes: _2 } = au(e6.post?._id ?? void 0, e6.metrics?.likes ?? 0, r2, n2), v2 = Bl(tr), y2 = Bl(`tag`), b2 = u(() => kl(e6.post), [e6]), x2 = cu(), S2 = u(() => e6.post?.richContent && e6.paywall ? Qc(e6.post.richContent, e6.paywall, x2) : void 0, [e6, x2]);
|
|
4566
4588
|
return u(() => {
|
|
4567
|
-
let n3 =
|
|
4589
|
+
let n3 = ld(!e6.post && l2 && e6.demoPost ? { ...e6, post: e6.demoPost } : e6, s2, o2, l2, c2, { category: v2, tag: y2 }), a3 = r2 || !e6.post ? void 0 : ur(e6.post, i2), u2 = a3 ?? (l2 ? gu(i2) : void 0);
|
|
4568
4590
|
return { ...n3, ...S2 && { richContent: S2 }, relatedPostsSource: b2, commentingEnabled: e6.post?.commentingEnabled ?? void 0, viewCountValue: m2 ?? n3.viewCountValue, commentCountValue: h2 ?? n3.commentCountValue, itemLink: u2, postUrl: a3?.href, ...e6.post && (e6.metrics?.likes !== void 0 || p2) ? { likeCount: $(s2.likeCount(f2)) } : {}, isLiked: d2, likeCountValue: f2, isLikeCountLoaded: p2, toggleLike: g2, liveLikes: _2, clockValue: c2, isLoadingPost: false, hasError: t2, isEmpty: !e6.post && !l2 };
|
|
4569
4591
|
}, [e6, t2, b2, S2, s2, o2, c2, f2, d2, p2, m2, h2, g2, _2, l2, r2, i2, v2, y2]);
|
|
4570
4592
|
};
|
|
4571
|
-
var
|
|
4572
|
-
var
|
|
4573
|
-
var
|
|
4593
|
+
var dd = (e6) => ({ post: e6, hasError: false });
|
|
4594
|
+
var fd = () => ({ post: { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: Date.now() }, hasError: true });
|
|
4595
|
+
var pd = (e6) => {
|
|
4574
4596
|
throw e6;
|
|
4575
4597
|
};
|
|
4576
|
-
var
|
|
4598
|
+
var md = { ...cd(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
|
|
4577
4599
|
}, liveLikes: void 0, postUrl: void 0, itemLink: void 0, clockValue: 0, relatedPostsSource: { currentPostId: void 0, categoryIds: void 0, relatedPostIds: void 0 }, commentingEnabled: void 0, isLoadingPost: true, hasError: false, isEmpty: false };
|
|
4578
|
-
var
|
|
4579
|
-
function
|
|
4600
|
+
var hd = { ...md, isLoadingPost: false, hasError: true, isEmpty: true };
|
|
4601
|
+
function gd() {
|
|
4580
4602
|
return t();
|
|
4581
4603
|
}
|
|
4582
|
-
var
|
|
4583
|
-
var
|
|
4584
|
-
var
|
|
4585
|
-
let { post: a2, hasError: o2 } =
|
|
4586
|
-
return
|
|
4604
|
+
var _d = 2500;
|
|
4605
|
+
var vd = Promise.resolve(dd({ post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: 0 }));
|
|
4606
|
+
var yd = ({ children: t2, postId: n2, postLoadPromise: r2, monitoringClient: i2 }) => {
|
|
4607
|
+
let { post: a2, hasError: o2 } = Hn(r2), c2 = Zn(a2, s(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 = ud({ postWithAuthor: c2, hasError: o2, monitoringClient: i2, isPostInPreview: false, postPageBase: fr() });
|
|
4608
|
+
return hr(pr.postByIdProvider, o2 ? `error` : c2.post ? `data` : `empty`), h(e, { value: l2, children: t2 });
|
|
4587
4609
|
};
|
|
4588
|
-
function
|
|
4589
|
-
let i2 = zl(n2), a2 =
|
|
4610
|
+
function bd({ children: t2, postPicker: n2 }) {
|
|
4611
|
+
let i2 = zl(n2), a2 = Kn(), o2 = _r(), s2 = u(() => jl(Bn), []), { i18n: c2, locale: l2 } = Ko(es), d2 = Jn(() => i2 ? Wn(No({ key: `blog-builder:post-by-id:${i2}`, warmupData: o2, fetchData: () => {
|
|
4590
4612
|
let e6 = Dl(i2, a2);
|
|
4591
|
-
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6,
|
|
4592
|
-
} }),
|
|
4593
|
-
return h(
|
|
4613
|
+
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6, _d, `post-by-id`) : e6));
|
|
4614
|
+
} }), dd, a2 ? pd : fd) : vd, [i2, a2, o2, s2]);
|
|
4615
|
+
return h(xo, { i18n: c2, children: g(r, { fallback: h(e, { value: md, children: t2 }), children: [h(Go, { i18n: c2, locale: l2 }), h(Fl, { fallback: h(e, { value: hd, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: h(yd, { postId: i2, postLoadPromise: d2, monitoringClient: s2, children: t2 }, i2 ?? ``) })] }) });
|
|
4594
4616
|
}
|
|
4595
|
-
var
|
|
4617
|
+
var xd = Nn(`474ee948-702b-4c0f-970e-b5319eff6d8b`);
|
|
4596
4618
|
export {
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4619
|
+
bd as PostByIdProvider,
|
|
4620
|
+
bd as default,
|
|
4621
|
+
xd as injectAccessTokenGetter,
|
|
4622
|
+
gd as usePostByIdContext
|
|
4601
4623
|
};
|
|
4602
4624
|
//# sourceMappingURL=context-post-by-id.mjs.map
|