@intlify/core 12.0.0-alpha.13 → 12.0.0-alpha.14
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/dist/core.esm-browser.js +3 -4
- package/dist/core.esm-browser.prod.js +179 -179
- package/dist/core.global.js +3 -4
- package/dist/core.global.prod.js +288 -312
- package/dist/core.js +1 -1
- package/dist/core.node.js +1 -1
- package/dist/core.runtime.esm-browser.js +3 -4
- package/dist/core.runtime.esm-browser.prod.js +77 -77
- package/dist/core.runtime.global.js +3 -4
- package/dist/core.runtime.global.prod.js +240 -265
- package/dist/core.runtime.js +1 -1
- package/dist/core.runtime.node.js +1 -1
- package/package.json +3 -3
package/dist/core.global.prod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @intlify/core v12.0.0-alpha.
|
|
2
|
+
* @intlify/core v12.0.0-alpha.14
|
|
3
3
|
* (c) 2016-present kazuya kawaguchi and contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/ var IntlifyCore = (function(e) {
|
|
@@ -844,110 +844,107 @@
|
|
|
844
844
|
}
|
|
845
845
|
let Ue = [`b`, `body`];
|
|
846
846
|
function We(e) {
|
|
847
|
-
return
|
|
847
|
+
return U(e, Ue);
|
|
848
848
|
}
|
|
849
849
|
let Ge = [`c`, `cases`];
|
|
850
850
|
function Ke(e) {
|
|
851
|
-
return
|
|
851
|
+
return U(e, Ge, []);
|
|
852
852
|
}
|
|
853
853
|
let qe = [`s`, `static`];
|
|
854
854
|
function Je(e) {
|
|
855
|
-
return
|
|
855
|
+
return U(e, qe);
|
|
856
856
|
}
|
|
857
857
|
let Ye = [`i`, `items`];
|
|
858
858
|
function Xe(e) {
|
|
859
|
-
return
|
|
859
|
+
return U(e, Ye, []);
|
|
860
860
|
}
|
|
861
861
|
let Ze = [`t`, `type`];
|
|
862
862
|
function Qe(e) {
|
|
863
|
-
return
|
|
863
|
+
return U(e, Ze);
|
|
864
864
|
}
|
|
865
865
|
let $e = [`v`, `value`];
|
|
866
|
-
function
|
|
867
|
-
let n =
|
|
866
|
+
function et(e, t) {
|
|
867
|
+
let n = U(e, $e);
|
|
868
868
|
if (n != null) return n;
|
|
869
|
-
throw
|
|
869
|
+
throw W(t);
|
|
870
870
|
}
|
|
871
|
-
let
|
|
872
|
-
function
|
|
873
|
-
return
|
|
871
|
+
let tt = [`m`, `modifier`];
|
|
872
|
+
function nt(e) {
|
|
873
|
+
return U(e, tt);
|
|
874
874
|
}
|
|
875
|
-
let
|
|
876
|
-
function
|
|
877
|
-
let t =
|
|
875
|
+
let rt = [`k`, `key`];
|
|
876
|
+
function it(e) {
|
|
877
|
+
let t = U(e, rt);
|
|
878
878
|
if (t) return t;
|
|
879
|
-
throw
|
|
879
|
+
throw W(6);
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function U(e, t, n) {
|
|
882
882
|
for (let n = 0; n < t.length; n++) {
|
|
883
883
|
let r = t[n];
|
|
884
884
|
if (p(e, r) && e[r] != null) return e[r];
|
|
885
885
|
}
|
|
886
886
|
return n;
|
|
887
887
|
}
|
|
888
|
-
let
|
|
888
|
+
let at = [
|
|
889
889
|
...Ue,
|
|
890
890
|
...Ge,
|
|
891
891
|
...qe,
|
|
892
892
|
...Ye,
|
|
893
|
-
...
|
|
894
|
-
...
|
|
893
|
+
...rt,
|
|
894
|
+
...tt,
|
|
895
895
|
...$e,
|
|
896
896
|
...Ze
|
|
897
897
|
];
|
|
898
|
-
function
|
|
898
|
+
function W(e) {
|
|
899
899
|
return Error(`unhandled node type: ${e}`);
|
|
900
900
|
}
|
|
901
|
-
function
|
|
902
|
-
return (t) =>
|
|
901
|
+
function ot(e) {
|
|
902
|
+
return (t) => st(t, e);
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function st(e, t) {
|
|
905
905
|
let n = We(t);
|
|
906
|
-
if (n == null) throw
|
|
906
|
+
if (n == null) throw W(0);
|
|
907
907
|
if (Qe(n) === 1) {
|
|
908
908
|
let t = Ke(n);
|
|
909
|
-
return e.plural(t.reduce((t, n) => [...g(t) ? t : [t],
|
|
909
|
+
return e.plural(t.reduce((t, n) => [...g(t) ? t : [t], ct(e, n)], []));
|
|
910
910
|
}
|
|
911
|
-
return
|
|
911
|
+
return ct(e, n);
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function ct(e, t) {
|
|
914
914
|
let n = Je(t);
|
|
915
915
|
if (n != null) return e.type === `text` ? n : e.normalize([n]);
|
|
916
916
|
{
|
|
917
|
-
let n = Xe(t).reduce((t, n) => [...t,
|
|
917
|
+
let n = Xe(t).reduce((t, n) => [...t, lt(e, n)], []);
|
|
918
918
|
return e.normalize(n);
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function lt(e, t) {
|
|
922
922
|
let n = Qe(t);
|
|
923
923
|
switch (n) {
|
|
924
|
-
case 3:
|
|
925
|
-
case 9: return
|
|
924
|
+
case 3:
|
|
925
|
+
case 9: return et(t, n);
|
|
926
926
|
case 4: {
|
|
927
927
|
let r = t;
|
|
928
928
|
if (p(r, `k`) && r.k) return e.interpolate(e.named(r.k));
|
|
929
929
|
if (p(r, `key`) && r.key) return e.interpolate(e.named(r.key));
|
|
930
|
-
throw
|
|
930
|
+
throw W(n);
|
|
931
931
|
}
|
|
932
932
|
case 5: {
|
|
933
933
|
let r = t;
|
|
934
934
|
if (p(r, `i`) && a(r.i)) return e.interpolate(e.list(r.i));
|
|
935
935
|
if (p(r, `index`) && a(r.index)) return e.interpolate(e.list(r.index));
|
|
936
|
-
throw
|
|
936
|
+
throw W(n);
|
|
937
937
|
}
|
|
938
938
|
case 6: {
|
|
939
|
-
let n = t, r =
|
|
940
|
-
return e.linked(
|
|
939
|
+
let n = t, r = nt(n), i = it(n);
|
|
940
|
+
return e.linked(lt(e, i), r ? lt(e, r) : void 0, e.type);
|
|
941
941
|
}
|
|
942
|
-
case 7:
|
|
943
|
-
case 8: return
|
|
942
|
+
case 7:
|
|
943
|
+
case 8: return et(t, n);
|
|
944
944
|
default: throw Error(`unhandled node on format message part: ${n}`);
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
|
-
let
|
|
948
|
-
function ut() {
|
|
949
|
-
K = d();
|
|
950
|
-
}
|
|
947
|
+
let ut = (e) => e, G = d();
|
|
951
948
|
function dt(e, t = {}) {
|
|
952
949
|
let n = !1, r = t.onError || Ne;
|
|
953
950
|
t.onError = (e) => {
|
|
@@ -960,26 +957,7 @@
|
|
|
960
957
|
code: ``
|
|
961
958
|
};
|
|
962
959
|
}
|
|
963
|
-
|
|
964
|
-
if (v(e)) {
|
|
965
|
-
y(t.warnHtmlMessage) && t.warnHtmlMessage;
|
|
966
|
-
let n = (t.onCacheKey || lt)(e), r = K[n];
|
|
967
|
-
if (r) return r;
|
|
968
|
-
let { ast: i, detectError: a } = dt(e, {
|
|
969
|
-
...t,
|
|
970
|
-
location: !1,
|
|
971
|
-
mangle: !0,
|
|
972
|
-
optimize: !0
|
|
973
|
-
}), o = at(i);
|
|
974
|
-
return a ? o : K[n] = o;
|
|
975
|
-
}
|
|
976
|
-
{
|
|
977
|
-
if (!H(e)) return (() => e);
|
|
978
|
-
let t = e.cacheKey;
|
|
979
|
-
return t ? K[t] || (K[t] = at(e)) : at(e);
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
let q = {
|
|
960
|
+
let K = {
|
|
983
961
|
INVALID_ARGUMENT: 17,
|
|
984
962
|
INVALID_DATE_ARGUMENT: 18,
|
|
985
963
|
INVALID_ISO_DATE_ARGUMENT: 19,
|
|
@@ -987,56 +965,46 @@
|
|
|
987
965
|
NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 21,
|
|
988
966
|
NOT_SUPPORT_LOCALE_TYPE: 22
|
|
989
967
|
};
|
|
990
|
-
function
|
|
968
|
+
function q(e) {
|
|
991
969
|
return z(e, null, void 0);
|
|
992
970
|
}
|
|
993
|
-
|
|
994
|
-
function
|
|
995
|
-
return t.locale == null ?
|
|
971
|
+
K.INVALID_ARGUMENT, K.INVALID_DATE_ARGUMENT, K.INVALID_ISO_DATE_ARGUMENT, K.NOT_SUPPORT_LOCALE_PROMISE_VALUE, K.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION, K.NOT_SUPPORT_LOCALE_TYPE;
|
|
972
|
+
function ft(e, t) {
|
|
973
|
+
return t.locale == null ? mt(e.locale) : mt(t.locale);
|
|
996
974
|
}
|
|
997
|
-
let
|
|
998
|
-
function
|
|
975
|
+
let pt;
|
|
976
|
+
function mt(e) {
|
|
999
977
|
if (v(e)) return e;
|
|
1000
978
|
if (_(e)) {
|
|
1001
|
-
if (e.resolvedOnce &&
|
|
979
|
+
if (e.resolvedOnce && pt != null) return pt;
|
|
1002
980
|
if (e.constructor.name === `Function`) {
|
|
1003
981
|
let t = e();
|
|
1004
|
-
if (x(t)) throw
|
|
1005
|
-
return
|
|
982
|
+
if (x(t)) throw q(K.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
|
|
983
|
+
return pt = t;
|
|
1006
984
|
}
|
|
1007
|
-
throw
|
|
985
|
+
throw q(K.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
|
|
1008
986
|
}
|
|
1009
|
-
throw
|
|
987
|
+
throw q(K.NOT_SUPPORT_LOCALE_TYPE);
|
|
1010
988
|
}
|
|
1011
|
-
function
|
|
989
|
+
function ht(e, t, n) {
|
|
1012
990
|
return [.../* @__PURE__ */ new Set([n, ...g(t) ? t : b(t) ? Object.keys(t).filter((e) => e !== "default") : v(t) ? [t] : [n]])];
|
|
1013
991
|
}
|
|
1014
|
-
function
|
|
1015
|
-
let r = v(n) ? n : Z, i = e, a;
|
|
1016
|
-
b(t) ? (i.__localeChainObjectCache || (i.__localeChainObjectCache = /* @__PURE__ */ new WeakMap()), a = i.__localeChainObjectCache.get(t), a || (a = /* @__PURE__ */ new Map(), i.__localeChainObjectCache.set(t, a))) : (i.__localeChainCache || (i.__localeChainCache = /* @__PURE__ */ new Map()), a = i.__localeChainCache.get(t), a || (a = /* @__PURE__ */ new Map(), i.__localeChainCache.set(t, a)));
|
|
1017
|
-
let o = a.get(r);
|
|
1018
|
-
if (o) return o;
|
|
1019
|
-
let s = [], c = [n];
|
|
1020
|
-
for (; g(c);) c = vt(s, c, t);
|
|
1021
|
-
let l = g(t) || !w(t) ? t : t.default ? t.default : null;
|
|
1022
|
-
return c = v(l) ? [l] : l, g(c) && vt(s, c, !1), a.set(r, s), s;
|
|
1023
|
-
}
|
|
1024
|
-
function vt(e, t, n) {
|
|
992
|
+
function gt(e, t, n) {
|
|
1025
993
|
let r = !0;
|
|
1026
994
|
for (let i = 0; i < t.length && y(r); i++) {
|
|
1027
995
|
let a = t[i];
|
|
1028
|
-
v(a) && (r =
|
|
996
|
+
v(a) && (r = _t(e, t[i], n));
|
|
1029
997
|
}
|
|
1030
998
|
return r;
|
|
1031
999
|
}
|
|
1032
|
-
function
|
|
1000
|
+
function _t(e, t, n) {
|
|
1033
1001
|
let r, i = t.split(`-`);
|
|
1034
1002
|
do
|
|
1035
|
-
r =
|
|
1003
|
+
r = vt(e, i.join(`-`), n), i.splice(-1, 1);
|
|
1036
1004
|
while (i.length && r === !0);
|
|
1037
1005
|
return r;
|
|
1038
1006
|
}
|
|
1039
|
-
function
|
|
1007
|
+
function vt(e, t, n) {
|
|
1040
1008
|
let r = !1;
|
|
1041
1009
|
if (!e.includes(t) && (r = !0, t)) {
|
|
1042
1010
|
r = t[t.length - 1] !== `!`;
|
|
@@ -1045,53 +1013,53 @@
|
|
|
1045
1013
|
}
|
|
1046
1014
|
return r;
|
|
1047
1015
|
}
|
|
1048
|
-
let
|
|
1049
|
-
|
|
1016
|
+
let J = [];
|
|
1017
|
+
J[0] = {
|
|
1050
1018
|
w: [0],
|
|
1051
1019
|
i: [3, 0],
|
|
1052
1020
|
"[": [4],
|
|
1053
1021
|
o: [7]
|
|
1054
|
-
},
|
|
1022
|
+
}, J[1] = {
|
|
1055
1023
|
w: [1],
|
|
1056
1024
|
".": [2],
|
|
1057
1025
|
"[": [4],
|
|
1058
1026
|
o: [7]
|
|
1059
|
-
},
|
|
1027
|
+
}, J[2] = {
|
|
1060
1028
|
w: [2],
|
|
1061
1029
|
i: [3, 0],
|
|
1062
1030
|
0: [3, 0]
|
|
1063
|
-
},
|
|
1031
|
+
}, J[3] = {
|
|
1064
1032
|
i: [3, 0],
|
|
1065
1033
|
0: [3, 0],
|
|
1066
1034
|
w: [1, 1],
|
|
1067
1035
|
".": [2, 1],
|
|
1068
1036
|
"[": [4, 1],
|
|
1069
1037
|
o: [7, 1]
|
|
1070
|
-
},
|
|
1038
|
+
}, J[4] = {
|
|
1071
1039
|
"'": [5, 0],
|
|
1072
1040
|
"\"": [6, 0],
|
|
1073
1041
|
"[": [4, 2],
|
|
1074
1042
|
"]": [1, 3],
|
|
1075
1043
|
o: 8,
|
|
1076
1044
|
l: [4, 0]
|
|
1077
|
-
},
|
|
1045
|
+
}, J[5] = {
|
|
1078
1046
|
"'": [4, 0],
|
|
1079
1047
|
o: 8,
|
|
1080
1048
|
l: [5, 0]
|
|
1081
|
-
},
|
|
1049
|
+
}, J[6] = {
|
|
1082
1050
|
"\"": [4, 0],
|
|
1083
1051
|
o: 8,
|
|
1084
1052
|
l: [6, 0]
|
|
1085
1053
|
};
|
|
1086
|
-
let
|
|
1087
|
-
function
|
|
1088
|
-
return
|
|
1054
|
+
let yt = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
|
|
1055
|
+
function bt(e) {
|
|
1056
|
+
return yt.test(e);
|
|
1089
1057
|
}
|
|
1090
|
-
function
|
|
1058
|
+
function xt(e) {
|
|
1091
1059
|
let t = e.charCodeAt(0);
|
|
1092
1060
|
return t === e.charCodeAt(e.length - 1) && (t === 34 || t === 39) ? e.slice(1, -1) : e;
|
|
1093
1061
|
}
|
|
1094
|
-
function
|
|
1062
|
+
function St(e) {
|
|
1095
1063
|
if (e == null) return `o`;
|
|
1096
1064
|
switch (e.charCodeAt(0)) {
|
|
1097
1065
|
case 91:
|
|
@@ -1112,11 +1080,11 @@
|
|
|
1112
1080
|
}
|
|
1113
1081
|
return `i`;
|
|
1114
1082
|
}
|
|
1115
|
-
function
|
|
1083
|
+
function Ct(e) {
|
|
1116
1084
|
let t = e.trim();
|
|
1117
|
-
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 :
|
|
1085
|
+
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 : bt(t) ? xt(t) : `*` + t;
|
|
1118
1086
|
}
|
|
1119
|
-
function
|
|
1087
|
+
function wt(e) {
|
|
1120
1088
|
let t = [], n = -1, r = 0, i = 0, a, o, s, c, l, u, d, f = [];
|
|
1121
1089
|
f[0] = () => {
|
|
1122
1090
|
o === void 0 ? o = s : o += s;
|
|
@@ -1127,7 +1095,7 @@
|
|
|
1127
1095
|
}, f[3] = () => {
|
|
1128
1096
|
if (i > 0) i--, r = 4, f[0]();
|
|
1129
1097
|
else {
|
|
1130
|
-
if (i = 0, o === void 0 || (o =
|
|
1098
|
+
if (i = 0, o === void 0 || (o = Ct(o), o === !1)) return !1;
|
|
1131
1099
|
f[1]();
|
|
1132
1100
|
}
|
|
1133
1101
|
};
|
|
@@ -1136,29 +1104,15 @@
|
|
|
1136
1104
|
if (r === 5 && t === `'` || r === 6 && t === `"`) return n++, s = `\\` + t, f[0](), !0;
|
|
1137
1105
|
}
|
|
1138
1106
|
for (; r !== null;) if (n++, a = e[n], !(a === `\\` && p())) {
|
|
1139
|
-
if (c =
|
|
1107
|
+
if (c = St(a), d = J[r], l = d[c] || d.l || 8, l === 8 || (r = l[0], l[1] !== void 0 && (u = f[l[1]], u && (s = a, u() === !1)))) return;
|
|
1140
1108
|
if (r === 7) return t;
|
|
1141
1109
|
}
|
|
1142
1110
|
}
|
|
1143
|
-
let
|
|
1144
|
-
function
|
|
1111
|
+
let Tt = /* @__PURE__ */ new Map();
|
|
1112
|
+
function Et(e, t) {
|
|
1145
1113
|
return b(e) ? m(e, t) : null;
|
|
1146
1114
|
}
|
|
1147
|
-
|
|
1148
|
-
if (!b(e)) return null;
|
|
1149
|
-
let n = Dt.get(t);
|
|
1150
|
-
if (n || (n = Et(t), n && Dt.set(t, n)), !n) return null;
|
|
1151
|
-
let r = n.length, i = e, a = 0;
|
|
1152
|
-
for (; a < r;) {
|
|
1153
|
-
let e = n[a];
|
|
1154
|
-
if (it.includes(e) && H(i) || !b(i) || !p(i, e)) return null;
|
|
1155
|
-
let t = i[e];
|
|
1156
|
-
if (t === void 0 || _(i)) return null;
|
|
1157
|
-
i = t, a++;
|
|
1158
|
-
}
|
|
1159
|
-
return i;
|
|
1160
|
-
}
|
|
1161
|
-
let X = {
|
|
1115
|
+
let Y = {
|
|
1162
1116
|
NOT_FOUND_KEY: 1,
|
|
1163
1117
|
FALLBACK_TO_TRANSLATE: 2,
|
|
1164
1118
|
CANNOT_FORMAT_NUMBER: 3,
|
|
@@ -1171,95 +1125,35 @@
|
|
|
1171
1125
|
IGNORE_UNSAFE_LOCALE: 10,
|
|
1172
1126
|
FALLBACK_TO_DEFAULT_PLURAL_RULE: 11,
|
|
1173
1127
|
FALLBACK_FROM_INVALID_LOCALE: 12
|
|
1174
|
-
},
|
|
1175
|
-
[
|
|
1176
|
-
[
|
|
1177
|
-
[
|
|
1178
|
-
[
|
|
1179
|
-
[
|
|
1180
|
-
[
|
|
1181
|
-
[
|
|
1182
|
-
[
|
|
1183
|
-
[
|
|
1184
|
-
[
|
|
1185
|
-
[
|
|
1186
|
-
[
|
|
1187
|
-
}
|
|
1188
|
-
function
|
|
1189
|
-
return n(At[e], ...t);
|
|
1190
|
-
}
|
|
1191
|
-
let Mt = `12.0.0-alpha.13`, Z = `en-US`, Nt = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
|
|
1192
|
-
function Pt() {
|
|
1128
|
+
}, Dt = {
|
|
1129
|
+
[Y.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale {resource}.`,
|
|
1130
|
+
[Y.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
|
|
1131
|
+
[Y.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
|
|
1132
|
+
[Y.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
|
|
1133
|
+
[Y.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
|
|
1134
|
+
[Y.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
|
|
1135
|
+
[Y.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: `This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future.`,
|
|
1136
|
+
[Y.INVALID_NUMBER_ARGUMENT]: `Invalid argument for number formatting: expected a number but received '{value}'.`,
|
|
1137
|
+
[Y.INVALID_DATE_ARGUMENT]: `Invalid argument for datetime formatting: expected a Date, number, or ISO string but received '{value}'.`,
|
|
1138
|
+
[Y.IGNORE_UNSAFE_LOCALE]: `Ignore '{locale}' locale: it is a property name of Object.prototype`,
|
|
1139
|
+
[Y.FALLBACK_TO_DEFAULT_PLURAL_RULE]: `Fall back to the default plural rule for '{locale}' locale: Intl.PluralRules does not support it`,
|
|
1140
|
+
[Y.FALLBACK_FROM_INVALID_LOCALE]: `Fall back to '{target}' locale for {type} formatting with '{locale}' locale: it is not a BCP 47 language tag`
|
|
1141
|
+
}, Ot = `12.0.0-alpha.14`, X = `en-US`, kt = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
|
|
1142
|
+
function At() {
|
|
1193
1143
|
return {
|
|
1194
1144
|
upper: (e, t) => t === `text` && v(e) ? e.toUpperCase() : t === `vnode` && b(e) && `__v_isVNode` in e ? e.children.toUpperCase() : e,
|
|
1195
1145
|
lower: (e, t) => t === `text` && v(e) ? e.toLowerCase() : t === `vnode` && b(e) && `__v_isVNode` in e ? e.children.toLowerCase() : e,
|
|
1196
|
-
capitalize: (e, t) => t === `text` && v(e) ?
|
|
1146
|
+
capitalize: (e, t) => t === `text` && v(e) ? kt(e) : t === `vnode` && b(e) && `__v_isVNode` in e ? kt(e.children) : e
|
|
1197
1147
|
};
|
|
1198
1148
|
}
|
|
1199
|
-
let Ft;
|
|
1149
|
+
let jt, Mt, Nt, Pt = 0, Ft = (e) => ({ [e]: d() });
|
|
1200
1150
|
function It(e) {
|
|
1201
|
-
Ft = e;
|
|
1202
|
-
}
|
|
1203
|
-
let Lt;
|
|
1204
|
-
function Rt(e) {
|
|
1205
|
-
Lt = e;
|
|
1206
|
-
}
|
|
1207
|
-
let zt;
|
|
1208
|
-
function Bt(e) {
|
|
1209
|
-
zt = e;
|
|
1210
|
-
}
|
|
1211
|
-
let Vt = 0;
|
|
1212
|
-
function Ht(e = {}) {
|
|
1213
|
-
let t = _(e.onWarn) ? e.onWarn : D, n = v(e.version) ? e.version : Mt, r = v(e.locale) || _(e.locale) ? e.locale : Z, i = _(r) ? Z : r, a = Kt(e.fallbackLocale) ? e.fallbackLocale : i, o = w(e.messages) ? e.messages : Ut(i), s = w(e.datetimeFormats) ? e.datetimeFormats : Ut(i), c = w(e.numberFormats) ? e.numberFormats : Ut(i), u = l(d(), e.modifiers, Pt()), f = e.pluralRules || d(), p = _(e.missing) ? e.missing : null, m = !qt(e.missingWarn) || e.missingWarn, h = !qt(e.fallbackWarn) || e.fallbackWarn, g = !!e.fallbackFormat, x = !!e.unresolving, S = _(e.postTranslation) ? e.postTranslation : null, C = w(e.processor) ? e.processor : null, T = !y(e.warnHtmlMessage) || e.warnHtmlMessage, E = !!e.escapeParameter, O = _(e.messageCompiler) ? e.messageCompiler : Ft || null, ee = _(e.messageResolver) ? e.messageResolver : Lt || Ot, te = _(e.localeFallbacker) ? e.localeFallbacker : zt || gt, ne = b(e.fallbackContext) ? e.fallbackContext : void 0;
|
|
1214
|
-
Vt++;
|
|
1215
|
-
let k = {
|
|
1216
|
-
version: n,
|
|
1217
|
-
cid: Vt,
|
|
1218
|
-
locale: r,
|
|
1219
|
-
fallbackLocale: a,
|
|
1220
|
-
messages: o,
|
|
1221
|
-
modifiers: u,
|
|
1222
|
-
pluralRules: f,
|
|
1223
|
-
missing: p,
|
|
1224
|
-
missingWarn: m,
|
|
1225
|
-
fallbackWarn: h,
|
|
1226
|
-
fallbackFormat: g,
|
|
1227
|
-
unresolving: x,
|
|
1228
|
-
postTranslation: S,
|
|
1229
|
-
processor: C,
|
|
1230
|
-
warnHtmlMessage: T,
|
|
1231
|
-
escapeParameter: E,
|
|
1232
|
-
messageCompiler: O,
|
|
1233
|
-
messageResolver: ee,
|
|
1234
|
-
localeFallbacker: te,
|
|
1235
|
-
fallbackContext: ne,
|
|
1236
|
-
onWarn: t
|
|
1237
|
-
};
|
|
1238
|
-
return k.datetimeFormats = s, k.numberFormats = c, k.__datetimeFormatters = /* @__PURE__ */ new Map(), k.__numberFormatters = /* @__PURE__ */ new Map(), k;
|
|
1239
|
-
}
|
|
1240
|
-
let Ut = (e) => ({ [e]: d() });
|
|
1241
|
-
function Wt(e, t) {
|
|
1242
|
-
let n = m(e.messages, t);
|
|
1243
|
-
if (n == null) return;
|
|
1244
|
-
let r = d();
|
|
1245
|
-
return Ae(n, r), r;
|
|
1246
|
-
}
|
|
1247
|
-
function Gt(e, t, n) {
|
|
1248
|
-
h(t) || (e.messages[t] = n);
|
|
1249
|
-
}
|
|
1250
|
-
function Kt(e) {
|
|
1251
1151
|
return v(e) || g(e) || w(e) || e === !1;
|
|
1252
1152
|
}
|
|
1253
|
-
function
|
|
1153
|
+
function Lt(e) {
|
|
1254
1154
|
return y(e) || s(e);
|
|
1255
1155
|
}
|
|
1256
|
-
function
|
|
1257
|
-
return s(e) ? e.test(t) : e;
|
|
1258
|
-
}
|
|
1259
|
-
function Yt(e, t) {
|
|
1260
|
-
return s(e) ? e.test(t) : e;
|
|
1261
|
-
}
|
|
1262
|
-
function Xt(e, t, n, r, i) {
|
|
1156
|
+
function Rt(e, t, n, r, i) {
|
|
1263
1157
|
let { missing: a, onWarn: o } = e;
|
|
1264
1158
|
if (a !== null) {
|
|
1265
1159
|
let r = a(e, n, t, i);
|
|
@@ -1267,84 +1161,72 @@
|
|
|
1267
1161
|
}
|
|
1268
1162
|
return t;
|
|
1269
1163
|
}
|
|
1270
|
-
function
|
|
1164
|
+
function zt(e, t) {
|
|
1271
1165
|
let n = e;
|
|
1272
1166
|
b(t) ? n.__localeChainObjectCache?.delete(t) : n.__localeChainCache?.delete(t);
|
|
1273
1167
|
}
|
|
1274
|
-
function
|
|
1275
|
-
Zt(e, n), e.fallbackContext && Zt(e.fallbackContext, n);
|
|
1276
|
-
{
|
|
1277
|
-
let { __datetimeFormatters: t, __numberFormatters: n } = e;
|
|
1278
|
-
t.clear(), n.clear();
|
|
1279
|
-
}
|
|
1280
|
-
e.localeFallbacker(e, n, t);
|
|
1281
|
-
}
|
|
1282
|
-
function $t(e, t) {
|
|
1168
|
+
function Bt(e, t) {
|
|
1283
1169
|
return e !== t && e.split(`-`)[0] === t.split(`-`)[0];
|
|
1284
1170
|
}
|
|
1285
|
-
function
|
|
1171
|
+
function Vt(e, t) {
|
|
1286
1172
|
let n = t.indexOf(e);
|
|
1287
1173
|
if (n === -1) return !1;
|
|
1288
|
-
for (let r = n + 1; r < t.length; r++) if (
|
|
1174
|
+
for (let r = n + 1; r < t.length; r++) if (Bt(e, t[r])) return !0;
|
|
1289
1175
|
return !1;
|
|
1290
1176
|
}
|
|
1291
|
-
function
|
|
1177
|
+
function Ht(e, t, n, r, i, a, o) {
|
|
1292
1178
|
let { fallbackLocale: s, localeFallbacker: c, onWarn: l } = e, u = c(e, s, n);
|
|
1293
1179
|
for (let n = 0; n < u.length; n++) {
|
|
1294
1180
|
let a = u[n], s = m(m(r, a) || {}, t);
|
|
1295
1181
|
if (w(s) && v(a)) return a;
|
|
1296
|
-
|
|
1182
|
+
Rt(e, t, a, i, o);
|
|
1297
1183
|
}
|
|
1298
1184
|
return null;
|
|
1299
1185
|
}
|
|
1300
|
-
function
|
|
1186
|
+
function Ut(e) {
|
|
1301
1187
|
try {
|
|
1302
1188
|
return Intl.getCanonicalLocales(e), !0;
|
|
1303
1189
|
} catch {
|
|
1304
1190
|
return !1;
|
|
1305
1191
|
}
|
|
1306
1192
|
}
|
|
1307
|
-
function
|
|
1193
|
+
function Wt(e, t, n, r, i) {
|
|
1308
1194
|
try {
|
|
1309
1195
|
return new t(n, r);
|
|
1310
1196
|
} catch (i) {
|
|
1311
|
-
if (
|
|
1197
|
+
if (Ut(n)) throw i;
|
|
1312
1198
|
let { fallbackLocale: a, localeFallbacker: o, onWarn: s } = e;
|
|
1313
|
-
return new t(o(e, a, n).find(
|
|
1199
|
+
return new t(o(e, a, n).find(Ut) || `en-US`, r);
|
|
1314
1200
|
}
|
|
1315
1201
|
}
|
|
1316
|
-
function
|
|
1317
|
-
let u = y(r.missingWarn) ? r.missingWarn : e.missingWarn, d = y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p =
|
|
1202
|
+
function Gt(e, [t, n, r, i], a, o, s, c) {
|
|
1203
|
+
let u = y(r.missingWarn) ? r.missingWarn : e.missingWarn, d = y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p = ft(e, r);
|
|
1318
1204
|
if (!v(t) || t === ``) {
|
|
1319
|
-
let t =
|
|
1205
|
+
let t = Wt(e, a, p.replace(/!/g, ``), i, c);
|
|
1320
1206
|
return f ? t.formatToParts(n) : t.format(n);
|
|
1321
1207
|
}
|
|
1322
|
-
let m =
|
|
1208
|
+
let m = Ht(e, t, p, s, u, d, c);
|
|
1323
1209
|
if (!v(m)) return e.unresolving ? -1 : t;
|
|
1324
|
-
let h = s[m][t], g =
|
|
1325
|
-
return _ || (_ =
|
|
1210
|
+
let h = s[m][t], g = Kt(m, t, i), _ = o.get(g);
|
|
1211
|
+
return _ || (_ = Wt(e, a, m, l({}, h, i), c), o.set(g, _)), f ? _.formatToParts(n) : _.format(n);
|
|
1326
1212
|
}
|
|
1327
|
-
function
|
|
1213
|
+
function Kt(e, t, n) {
|
|
1328
1214
|
let r = `${e}__${t}`;
|
|
1329
1215
|
return w(n) && !c(n) && (r = `${r}__${JSON.stringify(n)}`), r;
|
|
1330
1216
|
}
|
|
1331
|
-
function
|
|
1217
|
+
function qt(e, t, n) {
|
|
1332
1218
|
for (let r in n) {
|
|
1333
1219
|
let n = `${t}__${r}`;
|
|
1334
1220
|
for (let t of e.keys()) (t === n || t.startsWith(`${n}__`)) && e.delete(t);
|
|
1335
1221
|
}
|
|
1336
1222
|
}
|
|
1337
|
-
function
|
|
1223
|
+
function Jt(e, t, n, r) {
|
|
1338
1224
|
let [, i, a, o] = e, s = n;
|
|
1339
1225
|
return v(i) ? t.key = i : w(i) && Object.keys(i).forEach((e) => {
|
|
1340
1226
|
r.includes(e) ? s[e] = i[e] : t[e] = i[e];
|
|
1341
1227
|
}), v(a) ? t.locale = a : w(a) && (s = a), w(o) && (s = o), s;
|
|
1342
1228
|
}
|
|
1343
|
-
|
|
1344
|
-
let { datetimeFormats: n, onWarn: r } = e, { __datetimeFormatters: i } = e;
|
|
1345
|
-
return !v(t[0]) && !o(t[0]) && !a(t[0]) ? `` : an(e, dn(...t), Intl.DateTimeFormat, i, n, `datetime format`);
|
|
1346
|
-
}
|
|
1347
|
-
let un = [
|
|
1229
|
+
let Yt = [
|
|
1348
1230
|
`localeMatcher`,
|
|
1349
1231
|
`weekday`,
|
|
1350
1232
|
`era`,
|
|
@@ -1366,24 +1248,24 @@
|
|
|
1366
1248
|
`hourCycle`,
|
|
1367
1249
|
`fractionalSecondDigits`
|
|
1368
1250
|
];
|
|
1369
|
-
function
|
|
1251
|
+
function Xt(...e) {
|
|
1370
1252
|
let [t] = e, n = d(), r = d(), i;
|
|
1371
1253
|
if (v(t)) {
|
|
1372
1254
|
let e = t.match(/^(\d{4}-\d{2}-\d{2})(?:(T|\s)(.+))?$/);
|
|
1373
|
-
if (!e) throw
|
|
1255
|
+
if (!e) throw q(K.INVALID_ISO_DATE_ARGUMENT);
|
|
1374
1256
|
let n = e[3] ? e[3].trim().startsWith(`T`) ? `${e[1].trim()}${e[3].trim()}` : `${e[1].trim()}T${e[3].trim()}` : e[1].trim();
|
|
1375
1257
|
i = new Date(n);
|
|
1376
1258
|
try {
|
|
1377
1259
|
i.toISOString();
|
|
1378
1260
|
} catch {
|
|
1379
|
-
throw
|
|
1261
|
+
throw q(K.INVALID_ISO_DATE_ARGUMENT);
|
|
1380
1262
|
}
|
|
1381
1263
|
} else if (o(t)) {
|
|
1382
|
-
if (isNaN(t.getTime())) throw
|
|
1264
|
+
if (isNaN(t.getTime())) throw q(K.INVALID_DATE_ARGUMENT);
|
|
1383
1265
|
i = t;
|
|
1384
1266
|
} else if (a(t)) i = t;
|
|
1385
|
-
else throw
|
|
1386
|
-
let s =
|
|
1267
|
+
else throw q(K.INVALID_ARGUMENT);
|
|
1268
|
+
let s = Jt(e, n, r, Yt);
|
|
1387
1269
|
return [
|
|
1388
1270
|
n.key || ``,
|
|
1389
1271
|
i,
|
|
@@ -1391,14 +1273,7 @@
|
|
|
1391
1273
|
s
|
|
1392
1274
|
];
|
|
1393
1275
|
}
|
|
1394
|
-
|
|
1395
|
-
sn(e.__datetimeFormatters, t, n);
|
|
1396
|
-
}
|
|
1397
|
-
function pn(e, ...t) {
|
|
1398
|
-
let { numberFormats: n, onWarn: r } = e, { __numberFormatters: i } = e;
|
|
1399
|
-
return a(t[0]) ? an(e, hn(...t), Intl.NumberFormat, i, n, `number format`) : ``;
|
|
1400
|
-
}
|
|
1401
|
-
let mn = [
|
|
1276
|
+
let Zt = [
|
|
1402
1277
|
`localeMatcher`,
|
|
1403
1278
|
`style`,
|
|
1404
1279
|
`currency`,
|
|
@@ -1420,10 +1295,10 @@
|
|
|
1420
1295
|
`roundingIncrement`,
|
|
1421
1296
|
`trailingZeroDisplay`
|
|
1422
1297
|
];
|
|
1423
|
-
function
|
|
1298
|
+
function Qt(...e) {
|
|
1424
1299
|
let [t] = e, n = d(), r = d();
|
|
1425
|
-
if (!a(t)) throw
|
|
1426
|
-
let i = t, o =
|
|
1300
|
+
if (!a(t)) throw q(K.INVALID_ARGUMENT);
|
|
1301
|
+
let i = t, o = Jt(e, n, r, Zt);
|
|
1427
1302
|
return [
|
|
1428
1303
|
n.key || ``,
|
|
1429
1304
|
i,
|
|
@@ -1431,14 +1306,11 @@
|
|
|
1431
1306
|
o
|
|
1432
1307
|
];
|
|
1433
1308
|
}
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
}
|
|
1437
|
-
let _n = (e) => e, vn = (e) => ``, yn = `text`, bn = (e) => e.length === 0 ? `` : E(e), xn = T;
|
|
1438
|
-
function Sn(e, t) {
|
|
1309
|
+
let $t = (e) => e, en = (e) => ``, tn = `text`, nn = (e) => e.length === 0 ? `` : E(e), rn = T;
|
|
1310
|
+
function Z(e, t) {
|
|
1439
1311
|
return e = Math.abs(e), t === 2 ? e === 1 ? 0 : 1 : Math.min(e, 2);
|
|
1440
1312
|
}
|
|
1441
|
-
let
|
|
1313
|
+
let an = [
|
|
1442
1314
|
`zero`,
|
|
1443
1315
|
`one`,
|
|
1444
1316
|
`two`,
|
|
@@ -1446,41 +1318,41 @@
|
|
|
1446
1318
|
`many`,
|
|
1447
1319
|
`other`
|
|
1448
1320
|
], Q = /* @__PURE__ */ new Map();
|
|
1449
|
-
function
|
|
1321
|
+
function on(e) {
|
|
1450
1322
|
try {
|
|
1451
1323
|
if (Intl.PluralRules.supportedLocalesOf(e).length === 0) return null;
|
|
1452
1324
|
let t = new Intl.PluralRules(e);
|
|
1453
1325
|
return {
|
|
1454
1326
|
rules: t,
|
|
1455
|
-
categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) =>
|
|
1327
|
+
categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) => an.indexOf(e) - an.indexOf(t))
|
|
1456
1328
|
};
|
|
1457
1329
|
} catch {
|
|
1458
1330
|
return null;
|
|
1459
1331
|
}
|
|
1460
1332
|
}
|
|
1461
|
-
function
|
|
1333
|
+
function sn(e) {
|
|
1462
1334
|
let t = Q.get(e);
|
|
1463
|
-
return t === void 0 && (t =
|
|
1335
|
+
return t === void 0 && (t = on(e), Q.size >= 1e3 && Q.delete(Q.keys().next().value), Q.set(e, t)), t;
|
|
1464
1336
|
}
|
|
1465
|
-
function
|
|
1337
|
+
function cn(e) {
|
|
1466
1338
|
return a(e.pluralIndex) ? e.pluralIndex : a(e.named?.count) ? e.named.count : a(e.named?.n) ? e.named.n : -1;
|
|
1467
1339
|
}
|
|
1468
|
-
function
|
|
1469
|
-
let t = e.locale, n =
|
|
1340
|
+
function ln(e = {}) {
|
|
1341
|
+
let t = e.locale, n = cn(e), r;
|
|
1470
1342
|
r = v(t) && e.pluralRules && _(m(e.pluralRules, t)) ? e.pluralRules[t] : v(t) && typeof Intl < `u` && Intl.PluralRules !== void 0 ? (e, n) => {
|
|
1471
|
-
let r =
|
|
1472
|
-
if (r === null || n > r.categories.length) return
|
|
1343
|
+
let r = sn(t);
|
|
1344
|
+
if (r === null || n > r.categories.length) return Z(e, n);
|
|
1473
1345
|
let { rules: i, categories: a } = r, o = i.select(Math.abs(e)), s = a.indexOf(o);
|
|
1474
1346
|
return Math.min(s === -1 ? n - 1 : s, n - 1);
|
|
1475
|
-
} :
|
|
1476
|
-
let i = r ===
|
|
1347
|
+
} : Z;
|
|
1348
|
+
let i = r === Z ? void 0 : Z, o = (e) => e[r(n, e.length, i)], s = e.list || [], c = (e) => s[e], u = e.named || d(), f = a(e.pluralIndex), p = (t) => {
|
|
1477
1349
|
let n = h(t) ? m(u, t) : u[t];
|
|
1478
1350
|
return f && n == null && (t === `count` || t === `n`) ? e.pluralIndex : n;
|
|
1479
1351
|
};
|
|
1480
1352
|
function y(t, n) {
|
|
1481
|
-
return (_(e.messages) ? e.messages(t, !!n) : b(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) :
|
|
1353
|
+
return (_(e.messages) ? e.messages(t, !!n) : b(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) : en);
|
|
1482
1354
|
}
|
|
1483
|
-
let x = (t) => e.modifiers ? m(e.modifiers, t) :
|
|
1355
|
+
let x = (t) => e.modifiers ? m(e.modifiers, t) : $t, S = _(e.processor?.normalize) ? e.processor.normalize : nn, C = _(e.processor?.interpolate) ? e.processor.interpolate : rn, w = {
|
|
1484
1356
|
list: c,
|
|
1485
1357
|
named: p,
|
|
1486
1358
|
plural: o,
|
|
@@ -1493,7 +1365,7 @@
|
|
|
1493
1365
|
return _(l) ? l(c, i) : c;
|
|
1494
1366
|
},
|
|
1495
1367
|
message: y,
|
|
1496
|
-
type: v(e.processor?.type) ? e.processor.type :
|
|
1368
|
+
type: v(e.processor?.type) ? e.processor.type : tn,
|
|
1497
1369
|
interpolate: C,
|
|
1498
1370
|
normalize: S,
|
|
1499
1371
|
values: l(d(), s, u, f ? {
|
|
@@ -1503,28 +1375,8 @@
|
|
|
1503
1375
|
};
|
|
1504
1376
|
return w;
|
|
1505
1377
|
}
|
|
1506
|
-
let
|
|
1507
|
-
function
|
|
1508
|
-
let [n, r] = In(...t), i = pt(e, r), a = y(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
|
|
1509
|
-
a && jn(r);
|
|
1510
|
-
let o = !!r.resolvedMessage, [s, c, l] = o ? [
|
|
1511
|
-
n,
|
|
1512
|
-
i,
|
|
1513
|
-
m(e.messages, i) || d()
|
|
1514
|
-
] : Pn(e, n, i, e.fallbackLocale, y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, y(r.missingWarn) ? r.missingWarn : e.missingWarn), u = n;
|
|
1515
|
-
if (!o && !kn(s)) {
|
|
1516
|
-
let t = v(r.default) ? r.default : y(r.default) || e.fallbackFormat ? e.messageCompiler ? n : () => n : null;
|
|
1517
|
-
(e.fallbackFormat || t != null && (v(t) || _(t))) && (s = t, u = s);
|
|
1518
|
-
}
|
|
1519
|
-
if (!o && (!kn(s) || !v(c))) return e.unresolving ? -1 : n;
|
|
1520
|
-
let f = !1, p = $(s) ? s : Fn(e, n, c, s, u, () => {
|
|
1521
|
-
f = !0;
|
|
1522
|
-
});
|
|
1523
|
-
if (f) return s;
|
|
1524
|
-
let h = p(Dn(Rn(e, c, l, r, a))), g = e.postTranslation ? e.postTranslation(h, n) : h;
|
|
1525
|
-
return a && v(g) && (g = Oe(g)), g;
|
|
1526
|
-
}
|
|
1527
|
-
function jn(e) {
|
|
1378
|
+
let un = () => ``, $ = (e) => _(e), dn = (e) => v(e) || H(e) || $(e);
|
|
1379
|
+
function fn(e) {
|
|
1528
1380
|
if (g(e.list) && (e.list = e.list.map((e) => v(e) ? O(e) : e)), b(e.named)) {
|
|
1529
1381
|
let t = e.named, n = d();
|
|
1530
1382
|
for (let e of Object.keys(t)) {
|
|
@@ -1534,16 +1386,16 @@
|
|
|
1534
1386
|
e.named = n;
|
|
1535
1387
|
}
|
|
1536
1388
|
}
|
|
1537
|
-
function
|
|
1389
|
+
function pn(e) {
|
|
1538
1390
|
return v(e) ? e : O(T(e));
|
|
1539
1391
|
}
|
|
1540
|
-
function
|
|
1541
|
-
return !t || _(e?.interpolate) ? e ?? void 0 : l({}, e, { interpolate:
|
|
1392
|
+
function mn(e, t) {
|
|
1393
|
+
return !t || _(e?.interpolate) ? e ?? void 0 : l({}, e, { interpolate: pn });
|
|
1542
1394
|
}
|
|
1543
|
-
function
|
|
1395
|
+
function hn(e, t, n, r, i, a) {
|
|
1544
1396
|
let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e, u = l(e, r, n), f = d(), p, h = null;
|
|
1545
|
-
for (let n = 0; n < u.length && (p = u[n], f = m(o, p) || d(), (h = c(f, t)) === null && (h = m(f, t)), !
|
|
1546
|
-
let n =
|
|
1397
|
+
for (let n = 0; n < u.length && (p = u[n], f = m(o, p) || d(), (h = c(f, t)) === null && (h = m(f, t)), !dn(h)); n++) if (!Vt(p, u)) {
|
|
1398
|
+
let n = Rt(e, t, p, a, `translate`);
|
|
1547
1399
|
n !== t && (h = n);
|
|
1548
1400
|
}
|
|
1549
1401
|
return [
|
|
@@ -1552,7 +1404,7 @@
|
|
|
1552
1404
|
f
|
|
1553
1405
|
];
|
|
1554
1406
|
}
|
|
1555
|
-
function
|
|
1407
|
+
function gn(e, t, n, r, i, a) {
|
|
1556
1408
|
if ($(r)) {
|
|
1557
1409
|
let e = r;
|
|
1558
1410
|
return e.locale = e.locale || n, e.key = e.key || t, e;
|
|
@@ -1561,16 +1413,16 @@
|
|
|
1561
1413
|
let e = (() => r);
|
|
1562
1414
|
return e.locale = n, e.key = t, e;
|
|
1563
1415
|
}
|
|
1564
|
-
let o = e.messageCompiler(r,
|
|
1416
|
+
let o = e.messageCompiler(r, vn(e, n, i, r, e.warnHtmlMessage, a));
|
|
1565
1417
|
return o.locale = n, o.key = t, o.source = r, o;
|
|
1566
1418
|
}
|
|
1567
|
-
function
|
|
1419
|
+
function _n(...e) {
|
|
1568
1420
|
let [t, n, r] = e;
|
|
1569
|
-
if (!v(t) && !a(t) && !$(t) && !H(t)) throw
|
|
1421
|
+
if (!v(t) && !a(t) && !$(t) && !H(t)) throw q(K.INVALID_ARGUMENT);
|
|
1570
1422
|
let i = a(t) ? String(t) : ($(t), t), o = d();
|
|
1571
1423
|
return a(n) ? o.plural = n : v(n) ? o.default = n : w(n) && !c(n) ? o.named = n : g(n) && (o.list = n), a(r) ? o.plural = r : v(r) ? o.default = r : w(r) && l(o, r), [i, o];
|
|
1572
1424
|
}
|
|
1573
|
-
function
|
|
1425
|
+
function vn(e, t, n, i, a, o) {
|
|
1574
1426
|
return {
|
|
1575
1427
|
locale: t,
|
|
1576
1428
|
key: n,
|
|
@@ -1581,7 +1433,7 @@
|
|
|
1581
1433
|
onCacheKey: (e) => r(t, n, e)
|
|
1582
1434
|
};
|
|
1583
1435
|
}
|
|
1584
|
-
function
|
|
1436
|
+
function yn(e, t, n, r, i) {
|
|
1585
1437
|
let { modifiers: o, pluralRules: s, messageResolver: c, fallbackLocale: l, fallbackWarn: u, missingWarn: d, fallbackContext: f } = e;
|
|
1586
1438
|
return {
|
|
1587
1439
|
locale: t,
|
|
@@ -1590,22 +1442,146 @@
|
|
|
1590
1442
|
messages: (r, i) => {
|
|
1591
1443
|
let a = c(n, r);
|
|
1592
1444
|
if (a == null && (f || i)) {
|
|
1593
|
-
let [n, , i] =
|
|
1445
|
+
let [n, , i] = hn(f || e, r, t, l, u, d);
|
|
1594
1446
|
a = n ?? c(i, r);
|
|
1595
1447
|
}
|
|
1596
1448
|
if (v(a) || H(a)) {
|
|
1597
|
-
let n = !1, i =
|
|
1449
|
+
let n = !1, i = gn(e, r, t, a, r, () => {
|
|
1598
1450
|
n = !0;
|
|
1599
1451
|
});
|
|
1600
|
-
return n ?
|
|
1452
|
+
return n ? un : i;
|
|
1601
1453
|
}
|
|
1602
|
-
return $(a) ? a :
|
|
1454
|
+
return $(a) ? a : un;
|
|
1603
1455
|
},
|
|
1604
|
-
processor:
|
|
1456
|
+
processor: mn(e.processor, i),
|
|
1605
1457
|
list: r.list ?? void 0,
|
|
1606
1458
|
named: r.named ?? void 0,
|
|
1607
1459
|
pluralIndex: a(r.plural) ? r.plural : void 0
|
|
1608
1460
|
};
|
|
1609
1461
|
}
|
|
1610
|
-
return e.AST_NODE_PROPS_KEYS =
|
|
1462
|
+
return e.AST_NODE_PROPS_KEYS = at, e.CORE_ERROR_CODES_EXTEND_POINT = 23, e.CORE_WARN_CODES_EXTEND_POINT = 13, e.CoreWarnCodes = Y, e.DATETIME_FORMAT_OPTIONS_KEYS = Yt, e.DEFAULT_LOCALE = X, e.DEFAULT_MESSAGE_DATA_TYPE = tn, e.MISSING_RESOLVE_VALUE = ``, e.NOT_RESOLVED = -1, e.NUMBER_FORMAT_OPTIONS_KEYS = Zt, e.VERSION = Ot, e.clearCompileCache = function() {
|
|
1463
|
+
G = d();
|
|
1464
|
+
}, e.clearDateTimeFormat = function(e, t, n) {
|
|
1465
|
+
qt(e.__datetimeFormatters, t, n);
|
|
1466
|
+
}, e.clearNumberFormat = function(e, t, n) {
|
|
1467
|
+
qt(e.__numberFormatters, t, n);
|
|
1468
|
+
}, e.compile = function(e, t) {
|
|
1469
|
+
if (v(e)) {
|
|
1470
|
+
y(t.warnHtmlMessage) && t.warnHtmlMessage;
|
|
1471
|
+
let n = (t.onCacheKey || ut)(e), r = G[n];
|
|
1472
|
+
if (r) return r;
|
|
1473
|
+
let { ast: i, detectError: a } = dt(e, {
|
|
1474
|
+
...t,
|
|
1475
|
+
location: !1,
|
|
1476
|
+
mangle: !0,
|
|
1477
|
+
optimize: !0
|
|
1478
|
+
}), o = ot(i);
|
|
1479
|
+
return a ? o : G[n] = o;
|
|
1480
|
+
}
|
|
1481
|
+
{
|
|
1482
|
+
if (!H(e)) return (() => e);
|
|
1483
|
+
let t = e.cacheKey;
|
|
1484
|
+
return t ? G[t] || (G[t] = ot(e)) : ot(e);
|
|
1485
|
+
}
|
|
1486
|
+
}, e.createCompileError = z, e.createCoreContext = function(e = {}) {
|
|
1487
|
+
let t = _(e.onWarn) ? e.onWarn : D, n = v(e.version) ? e.version : Ot, r = v(e.locale) || _(e.locale) ? e.locale : X, i = _(r) ? X : r, a = It(e.fallbackLocale) ? e.fallbackLocale : i, o = w(e.messages) ? e.messages : Ft(i), s = w(e.datetimeFormats) ? e.datetimeFormats : Ft(i), c = w(e.numberFormats) ? e.numberFormats : Ft(i), u = l(d(), e.modifiers, At()), f = e.pluralRules || d(), p = _(e.missing) ? e.missing : null, m = !Lt(e.missingWarn) || e.missingWarn, h = !Lt(e.fallbackWarn) || e.fallbackWarn, g = !!e.fallbackFormat, x = !!e.unresolving, S = _(e.postTranslation) ? e.postTranslation : null, C = w(e.processor) ? e.processor : null, T = !y(e.warnHtmlMessage) || e.warnHtmlMessage, E = !!e.escapeParameter, O = _(e.messageCompiler) ? e.messageCompiler : jt || null, ee = _(e.messageResolver) ? e.messageResolver : Mt || Et, te = _(e.localeFallbacker) ? e.localeFallbacker : Nt || ht, ne = b(e.fallbackContext) ? e.fallbackContext : void 0;
|
|
1488
|
+
Pt++;
|
|
1489
|
+
let k = {
|
|
1490
|
+
version: n,
|
|
1491
|
+
cid: Pt,
|
|
1492
|
+
locale: r,
|
|
1493
|
+
fallbackLocale: a,
|
|
1494
|
+
messages: o,
|
|
1495
|
+
modifiers: u,
|
|
1496
|
+
pluralRules: f,
|
|
1497
|
+
missing: p,
|
|
1498
|
+
missingWarn: m,
|
|
1499
|
+
fallbackWarn: h,
|
|
1500
|
+
fallbackFormat: g,
|
|
1501
|
+
unresolving: x,
|
|
1502
|
+
postTranslation: S,
|
|
1503
|
+
processor: C,
|
|
1504
|
+
warnHtmlMessage: T,
|
|
1505
|
+
escapeParameter: E,
|
|
1506
|
+
messageCompiler: O,
|
|
1507
|
+
messageResolver: ee,
|
|
1508
|
+
localeFallbacker: te,
|
|
1509
|
+
fallbackContext: ne,
|
|
1510
|
+
onWarn: t
|
|
1511
|
+
};
|
|
1512
|
+
return k.datetimeFormats = s, k.numberFormats = c, k.__datetimeFormatters = /* @__PURE__ */ new Map(), k.__numberFormatters = /* @__PURE__ */ new Map(), k;
|
|
1513
|
+
}, e.createCoreError = q, e.createMessageContext = ln, e.datetime = function(e, ...t) {
|
|
1514
|
+
let { datetimeFormats: n, onWarn: r } = e, { __datetimeFormatters: i } = e;
|
|
1515
|
+
return !v(t[0]) && !o(t[0]) && !a(t[0]) ? `` : Gt(e, Xt(...t), Intl.DateTimeFormat, i, n, `datetime format`);
|
|
1516
|
+
}, e.fallbackWithLocaleChain = function(e, t, n) {
|
|
1517
|
+
let r = v(n) ? n : X, i = e, a;
|
|
1518
|
+
b(t) ? (i.__localeChainObjectCache || (i.__localeChainObjectCache = /* @__PURE__ */ new WeakMap()), a = i.__localeChainObjectCache.get(t), a || (a = /* @__PURE__ */ new Map(), i.__localeChainObjectCache.set(t, a))) : (i.__localeChainCache || (i.__localeChainCache = /* @__PURE__ */ new Map()), a = i.__localeChainCache.get(t), a || (a = /* @__PURE__ */ new Map(), i.__localeChainCache.set(t, a)));
|
|
1519
|
+
let o = a.get(r);
|
|
1520
|
+
if (o) return o;
|
|
1521
|
+
let s = [], c = [n];
|
|
1522
|
+
for (; g(c);) c = gt(s, c, t);
|
|
1523
|
+
let l = g(t) || !w(t) ? t : t.default ? t.default : null;
|
|
1524
|
+
return c = v(l) ? [l] : l, g(c) && gt(s, c, !1), a.set(r, s), s;
|
|
1525
|
+
}, e.fallbackWithSimple = ht, e.getLocale = ft, e.getLocaleMessage = function(e, t) {
|
|
1526
|
+
let n = m(e.messages, t);
|
|
1527
|
+
if (n == null) return;
|
|
1528
|
+
let r = d();
|
|
1529
|
+
return Ae(n, r), r;
|
|
1530
|
+
}, e.getWarnMessage = function(e, ...t) {
|
|
1531
|
+
return n(Dt[e], ...t);
|
|
1532
|
+
}, e.handleMissing = Rt, e.isAlmostSameLocale = Bt, e.isFallbackLocale = It, e.isImplicitFallback = Vt, e.isMessageAST = H, e.isMessageFormat = dn, e.isMessageFunction = $, e.isTranslateFallbackWarn = function(e, t) {
|
|
1533
|
+
return s(e) ? e.test(t) : e;
|
|
1534
|
+
}, e.isTranslateMissingWarn = function(e, t) {
|
|
1535
|
+
return s(e) ? e.test(t) : e;
|
|
1536
|
+
}, e.isWarnOption = Lt, e.number = function(e, ...t) {
|
|
1537
|
+
let { numberFormats: n, onWarn: r } = e, { __numberFormatters: i } = e;
|
|
1538
|
+
return a(t[0]) ? Gt(e, Qt(...t), Intl.NumberFormat, i, n, `number format`) : ``;
|
|
1539
|
+
}, e.parse = wt, e.parseDateTimeArgs = Xt, e.parseNumberArgs = Qt, e.parseTranslateArgs = _n, e.registerLocaleFallbacker = function(e) {
|
|
1540
|
+
Nt = e;
|
|
1541
|
+
}, e.registerMessageCompiler = function(e) {
|
|
1542
|
+
jt = e;
|
|
1543
|
+
}, e.registerMessageResolver = function(e) {
|
|
1544
|
+
Mt = e;
|
|
1545
|
+
}, e.resolveLocale = mt, e.resolveValue = function(e, t) {
|
|
1546
|
+
if (!b(e)) return null;
|
|
1547
|
+
let n = Tt.get(t);
|
|
1548
|
+
if (n || (n = wt(t), n && Tt.set(t, n)), !n) return null;
|
|
1549
|
+
let r = n.length, i = e, a = 0;
|
|
1550
|
+
for (; a < r;) {
|
|
1551
|
+
let e = n[a];
|
|
1552
|
+
if (at.includes(e) && H(i) || !b(i)) return null;
|
|
1553
|
+
let t = m(i, e);
|
|
1554
|
+
if (t === void 0 || _(i)) return null;
|
|
1555
|
+
i = t, a++;
|
|
1556
|
+
}
|
|
1557
|
+
return i;
|
|
1558
|
+
}, e.resolveWithKeyValue = Et, e.setLocaleMessage = function(e, t, n) {
|
|
1559
|
+
h(t) || (e.messages[t] = n);
|
|
1560
|
+
}, e.translate = function(e, ...t) {
|
|
1561
|
+
let [n, r] = _n(...t), i = ft(e, r), a = y(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
|
|
1562
|
+
a && fn(r);
|
|
1563
|
+
let o = !!r.resolvedMessage, [s, c, l] = o ? [
|
|
1564
|
+
n,
|
|
1565
|
+
i,
|
|
1566
|
+
m(e.messages, i) || d()
|
|
1567
|
+
] : hn(e, n, i, e.fallbackLocale, y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, y(r.missingWarn) ? r.missingWarn : e.missingWarn), u = n;
|
|
1568
|
+
if (!o && !dn(s)) {
|
|
1569
|
+
let t = v(r.default) ? r.default : y(r.default) || e.fallbackFormat ? e.messageCompiler ? n : () => n : null;
|
|
1570
|
+
(e.fallbackFormat || t != null && (v(t) || _(t))) && (s = t, u = s);
|
|
1571
|
+
}
|
|
1572
|
+
if (!o && (!dn(s) || !v(c))) return e.unresolving ? -1 : n;
|
|
1573
|
+
let f = !1, p = $(s) ? s : gn(e, n, c, s, u, () => {
|
|
1574
|
+
f = !0;
|
|
1575
|
+
});
|
|
1576
|
+
if (f) return s;
|
|
1577
|
+
let h = p(ln(yn(e, c, l, r, a))), g = e.postTranslation ? e.postTranslation(h, n) : h;
|
|
1578
|
+
return a && v(g) && (g = Oe(g)), g;
|
|
1579
|
+
}, e.updateFallbackLocale = function(e, t, n) {
|
|
1580
|
+
zt(e, n), e.fallbackContext && zt(e.fallbackContext, n);
|
|
1581
|
+
{
|
|
1582
|
+
let { __datetimeFormatters: t, __numberFormatters: n } = e;
|
|
1583
|
+
t.clear(), n.clear();
|
|
1584
|
+
}
|
|
1585
|
+
e.localeFallbacker(e, n, t);
|
|
1586
|
+
}, e;
|
|
1611
1587
|
})({});
|