@kong-ui-public/i18n 2.4.3 → 2.4.4-pr.2347.a3249204c.0
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/i18n.es.js +51 -51
- package/dist/i18n.umd.js +1 -1
- package/package.json +1 -1
package/dist/i18n.es.js
CHANGED
|
@@ -51,19 +51,19 @@ function je(e, t, r, n) {
|
|
|
51
51
|
var a = ke(n) ? n : r(n), i = t.get(a);
|
|
52
52
|
return typeof i > "u" && (i = e.call(this, n), t.set(a, i)), i;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function de(e, t, r) {
|
|
55
55
|
var n = Array.prototype.slice.call(arguments, 3), a = r(n), i = t.get(a);
|
|
56
56
|
return typeof i > "u" && (i = e.apply(this, n), t.set(a, i)), i;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Ee(e, t, r, n, a) {
|
|
59
59
|
return r.bind(t, e, n, a);
|
|
60
60
|
}
|
|
61
61
|
function Xe(e, t) {
|
|
62
|
-
var r = e.length === 1 ? je :
|
|
63
|
-
return
|
|
62
|
+
var r = e.length === 1 ? je : de;
|
|
63
|
+
return Ee(e, this, r, t.cache.create(), t.serializer);
|
|
64
64
|
}
|
|
65
65
|
function We(e, t) {
|
|
66
|
-
return
|
|
66
|
+
return Ee(e, this, de, t.cache.create(), t.serializer);
|
|
67
67
|
}
|
|
68
68
|
var Ze = function() {
|
|
69
69
|
return JSON.stringify(arguments);
|
|
@@ -1944,7 +1944,7 @@ var se = ut ? (
|
|
|
1944
1944
|
return a < 55296 || a > 56319 || r + 1 === n || (i = t.charCodeAt(r + 1)) < 56320 || i > 57343 ? a : (a - 55296 << 10) + (i - 56320) + 65536;
|
|
1945
1945
|
}
|
|
1946
1946
|
}
|
|
1947
|
-
),
|
|
1947
|
+
), dt = mt ? (
|
|
1948
1948
|
// Native
|
|
1949
1949
|
function(t) {
|
|
1950
1950
|
return t.trimStart();
|
|
@@ -1954,7 +1954,7 @@ var se = ut ? (
|
|
|
1954
1954
|
function(t) {
|
|
1955
1955
|
return t.replace(ot, "");
|
|
1956
1956
|
}
|
|
1957
|
-
),
|
|
1957
|
+
), Et = ct ? (
|
|
1958
1958
|
// Native
|
|
1959
1959
|
function(t) {
|
|
1960
1960
|
return t.trimEnd();
|
|
@@ -2185,7 +2185,7 @@ var bt = (
|
|
|
2185
2185
|
var h = this.clonePosition(), m = this.parseSimpleArgStyleIfPossible();
|
|
2186
2186
|
if (m.err)
|
|
2187
2187
|
return m;
|
|
2188
|
-
var c =
|
|
2188
|
+
var c = Et(m.val);
|
|
2189
2189
|
if (c.length === 0)
|
|
2190
2190
|
return this.error(g.EXPECT_ARGUMENT_STYLE, v(this.clonePosition(), this.clonePosition()));
|
|
2191
2191
|
var b = v(h, this.clonePosition());
|
|
@@ -2194,28 +2194,28 @@ var bt = (
|
|
|
2194
2194
|
var x = this.tryParseArgumentClose(a);
|
|
2195
2195
|
if (x.err)
|
|
2196
2196
|
return x;
|
|
2197
|
-
var
|
|
2197
|
+
var d = v(a, this.clonePosition());
|
|
2198
2198
|
if (l && se(l == null ? void 0 : l.style, "::", 0)) {
|
|
2199
|
-
var p =
|
|
2199
|
+
var p = dt(l.style.slice(2));
|
|
2200
2200
|
if (s === "number") {
|
|
2201
2201
|
var m = this.parseNumberSkeletonFromString(p, l.styleLocation);
|
|
2202
2202
|
return m.err ? m : {
|
|
2203
|
-
val: { type: y.number, value: n, location:
|
|
2203
|
+
val: { type: y.number, value: n, location: d, style: m.val },
|
|
2204
2204
|
err: null
|
|
2205
2205
|
};
|
|
2206
2206
|
} else {
|
|
2207
2207
|
if (p.length === 0)
|
|
2208
|
-
return this.error(g.EXPECT_DATE_TIME_SKELETON,
|
|
2209
|
-
var
|
|
2210
|
-
this.locale && (
|
|
2208
|
+
return this.error(g.EXPECT_DATE_TIME_SKELETON, d);
|
|
2209
|
+
var E = p;
|
|
2210
|
+
this.locale && (E = at(p, this.locale));
|
|
2211
2211
|
var c = {
|
|
2212
2212
|
type: D.dateTime,
|
|
2213
|
-
pattern:
|
|
2213
|
+
pattern: E,
|
|
2214
2214
|
location: l.styleLocation,
|
|
2215
|
-
parsedOptions: this.shouldParseSkeletons ? Ye(
|
|
2215
|
+
parsedOptions: this.shouldParseSkeletons ? Ye(E) : {}
|
|
2216
2216
|
}, T = s === "date" ? y.date : y.time;
|
|
2217
2217
|
return {
|
|
2218
|
-
val: { type: T, value: n, location:
|
|
2218
|
+
val: { type: T, value: n, location: d, style: c },
|
|
2219
2219
|
err: null
|
|
2220
2220
|
};
|
|
2221
2221
|
}
|
|
@@ -2224,7 +2224,7 @@ var bt = (
|
|
|
2224
2224
|
val: {
|
|
2225
2225
|
type: s === "number" ? y.number : s === "date" ? y.date : y.time,
|
|
2226
2226
|
value: n,
|
|
2227
|
-
location:
|
|
2227
|
+
location: d,
|
|
2228
2228
|
style: (i = l == null ? void 0 : l.style) !== null && i !== void 0 ? i : null
|
|
2229
2229
|
},
|
|
2230
2230
|
err: null
|
|
@@ -2351,9 +2351,9 @@ var bt = (
|
|
|
2351
2351
|
var x = this.parseMessage(t + 1, r, n);
|
|
2352
2352
|
if (x.err)
|
|
2353
2353
|
return x;
|
|
2354
|
-
var
|
|
2355
|
-
if (
|
|
2356
|
-
return
|
|
2354
|
+
var d = this.tryParseArgumentClose(b);
|
|
2355
|
+
if (d.err)
|
|
2356
|
+
return d;
|
|
2357
2357
|
s.push([
|
|
2358
2358
|
l,
|
|
2359
2359
|
{
|
|
@@ -2588,10 +2588,10 @@ function k(e, t, r, n, a, i, o) {
|
|
|
2588
2588
|
continue;
|
|
2589
2589
|
}
|
|
2590
2590
|
if (He(h)) {
|
|
2591
|
-
var x = h.children,
|
|
2591
|
+
var x = h.children, d = h.value, p = a[d];
|
|
2592
2592
|
if (!At(p))
|
|
2593
|
-
throw new Ht(
|
|
2594
|
-
var
|
|
2593
|
+
throw new Ht(d, "function", o);
|
|
2594
|
+
var E = k(x, t, r, n, a, i), T = p(E.map(function(R) {
|
|
2595
2595
|
return R.value;
|
|
2596
2596
|
}));
|
|
2597
2597
|
Array.isArray(T) || (T = [T]), s.push.apply(s, T.map(function(R) {
|
|
@@ -3050,44 +3050,44 @@ function ce(e, t) {
|
|
|
3050
3050
|
var ge = function(e, t, r, n, a) {
|
|
3051
3051
|
var i = e.locale, o = e.formats, s = e.messages, u = e.defaultLocale, l = e.defaultFormats, h = e.fallbackOnEmptyString, m = e.onError, c = e.timeZone, b = e.defaultRichTextElements;
|
|
3052
3052
|
r === void 0 && (r = { id: "" });
|
|
3053
|
-
var x = r.id,
|
|
3053
|
+
var x = r.id, d = r.defaultMessage;
|
|
3054
3054
|
Ft(!!x, "[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");
|
|
3055
|
-
var p = String(x),
|
|
3055
|
+
var p = String(x), E = (
|
|
3056
3056
|
// In case messages is Object.create(null)
|
|
3057
3057
|
// e.g import('foo.json') from webpack)
|
|
3058
3058
|
// See https://github.com/formatjs/formatjs/issues/1914
|
|
3059
3059
|
s && Object.prototype.hasOwnProperty.call(s, p) && s[p]
|
|
3060
3060
|
);
|
|
3061
|
-
if (Array.isArray(
|
|
3062
|
-
return
|
|
3063
|
-
if (!n &&
|
|
3064
|
-
return
|
|
3065
|
-
if (n = f(f({}, b), n || {}), o = ce(o, c), l = ce(l, c), !
|
|
3066
|
-
if (h === !1 &&
|
|
3067
|
-
return
|
|
3068
|
-
if ((!
|
|
3061
|
+
if (Array.isArray(E) && E.length === 1 && E[0].type === y.literal)
|
|
3062
|
+
return E[0].value;
|
|
3063
|
+
if (!n && E && typeof E == "string" && !b)
|
|
3064
|
+
return E.replace(/'\{(.*?)\}'/gi, "{$1}");
|
|
3065
|
+
if (n = f(f({}, b), n || {}), o = ce(o, c), l = ce(l, c), !E) {
|
|
3066
|
+
if (h === !1 && E === "")
|
|
3067
|
+
return E;
|
|
3068
|
+
if ((!d || i && i.toLowerCase() !== u.toLowerCase()) && m(new Ot(r, i)), d)
|
|
3069
3069
|
try {
|
|
3070
|
-
var T = t.getMessageFormat(
|
|
3070
|
+
var T = t.getMessageFormat(d, u, l, a);
|
|
3071
3071
|
return T.format(n);
|
|
3072
3072
|
} catch (S) {
|
|
3073
|
-
return m(new Z('Error formatting default message for: "'.concat(p, '", rendering default message verbatim'), i, r, S)), typeof
|
|
3073
|
+
return m(new Z('Error formatting default message for: "'.concat(p, '", rendering default message verbatim'), i, r, S)), typeof d == "string" ? d : p;
|
|
3074
3074
|
}
|
|
3075
3075
|
return p;
|
|
3076
3076
|
}
|
|
3077
3077
|
try {
|
|
3078
|
-
var T = t.getMessageFormat(
|
|
3078
|
+
var T = t.getMessageFormat(E, i, o, f({ formatters: t }, a || {}));
|
|
3079
3079
|
return T.format(n);
|
|
3080
3080
|
} catch (S) {
|
|
3081
|
-
m(new Z('Error formatting message: "'.concat(p, '", using ').concat(
|
|
3081
|
+
m(new Z('Error formatting message: "'.concat(p, '", using ').concat(d ? "default message" : "id", " as fallback."), i, r, S));
|
|
3082
3082
|
}
|
|
3083
|
-
if (
|
|
3083
|
+
if (d)
|
|
3084
3084
|
try {
|
|
3085
|
-
var T = t.getMessageFormat(
|
|
3085
|
+
var T = t.getMessageFormat(d, u, l, a);
|
|
3086
3086
|
return T.format(n);
|
|
3087
3087
|
} catch (S) {
|
|
3088
3088
|
m(new Z('Error formatting the default message for: "'.concat(p, '", rendering message verbatim'), i, r, S));
|
|
3089
3089
|
}
|
|
3090
|
-
return typeof
|
|
3090
|
+
return typeof E == "string" ? E : typeof d == "string" ? d : p;
|
|
3091
3091
|
}, Ce = [
|
|
3092
3092
|
"formatMatcher",
|
|
3093
3093
|
"timeZone",
|
|
@@ -3353,8 +3353,8 @@ function ur(e, t) {
|
|
|
3353
3353
|
const r = t.delimiter || ".", n = t.maxDepth, a = t.transformKey || sr, i = {};
|
|
3354
3354
|
function o(s, u, l) {
|
|
3355
3355
|
l = l || 1, Object.keys(s).forEach(function(h) {
|
|
3356
|
-
const m = s[h], c = t.safe && Array.isArray(m), b = Object.prototype.toString.call(m), x = or(m),
|
|
3357
|
-
if (!c && !x &&
|
|
3356
|
+
const m = s[h], c = t.safe && Array.isArray(m), b = Object.prototype.toString.call(m), x = or(m), d = b === "[object Object]" || b === "[object Array]", p = u ? u + r + a(h) : a(h);
|
|
3357
|
+
if (!c && !x && d && Object.keys(m).length && (!t.maxDepth || l < n))
|
|
3358
3358
|
return o(m, p, l + 1);
|
|
3359
3359
|
i[p] = m;
|
|
3360
3360
|
});
|
|
@@ -3370,7 +3370,7 @@ const ve = {
|
|
|
3370
3370
|
hour: "numeric",
|
|
3371
3371
|
minute: "numeric"
|
|
3372
3372
|
}, mr = (e, t, r = !1) => {
|
|
3373
|
-
var
|
|
3373
|
+
var d;
|
|
3374
3374
|
const n = typeof r == "boolean", a = ir(
|
|
3375
3375
|
{
|
|
3376
3376
|
...n ? null : r,
|
|
@@ -3382,29 +3382,29 @@ const ve = {
|
|
|
3382
3382
|
formats: {
|
|
3383
3383
|
...n ? null : r.formats,
|
|
3384
3384
|
date: {
|
|
3385
|
-
...n ? null : (
|
|
3385
|
+
...n ? null : (d = r.formats) == null ? void 0 : d.date,
|
|
3386
3386
|
datetime: ve
|
|
3387
3387
|
}
|
|
3388
3388
|
}
|
|
3389
3389
|
},
|
|
3390
3390
|
hr
|
|
3391
3391
|
), { $t: i, ...o } = a, s = o, u = (p) => p.toString().length === 13 ? Math.floor(p / 1e3) : p, l = (p) => {
|
|
3392
|
-
const
|
|
3392
|
+
const E = "Invalid Date";
|
|
3393
3393
|
if (!p)
|
|
3394
|
-
return
|
|
3394
|
+
return E;
|
|
3395
3395
|
try {
|
|
3396
|
-
const T = new Date(u(p) * 1e3);
|
|
3396
|
+
const T = new Date(u(Math.round(p)) * 1e3);
|
|
3397
3397
|
return s.formatDate(T, ve);
|
|
3398
3398
|
} catch {
|
|
3399
|
-
return
|
|
3399
|
+
return E;
|
|
3400
3400
|
}
|
|
3401
3401
|
}, x = {
|
|
3402
3402
|
formatUnixTimeStamp: l,
|
|
3403
3403
|
formatIsoDate: (p) => {
|
|
3404
|
-
const
|
|
3404
|
+
const E = Date.parse(p) / 1e3, T = Math.floor(E);
|
|
3405
3405
|
return l(T);
|
|
3406
3406
|
},
|
|
3407
|
-
t: (p,
|
|
3407
|
+
t: (p, E, T) => s.formatMessage({ id: p }, E, T),
|
|
3408
3408
|
te: (p) => !!s.messages[p],
|
|
3409
3409
|
tm: (p) => s.messages[p] || [],
|
|
3410
3410
|
...s,
|
package/dist/i18n.umd.js
CHANGED
|
@@ -19,4 +19,4 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
|
19
19
|
Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
20
20
|
`,L.MISSING_INTL_API));try{return Kt(e,t,a).format(r,n)}catch(o){e.onError(new B("Error formatting relative time.",e.locale,o))}return String(r)}var tr=["style","currency","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem","trailingZeroDisplay","roundingPriority","roundingIncrement","roundingMode"];function we(e,t,r){var n=e.locale,a=e.formats,i=e.onError;r===void 0&&(r={});var o=r.format,s=o&&ne(a,"number",o,i)||{},u=M(r,tr,s);return t(n,u)}function rr(e,t,r,n){n===void 0&&(n={});try{return we(e,t,n).format(r)}catch(a){e.onError(new B("Error formatting number.",e.locale,a))}return String(r)}function nr(e,t,r,n){n===void 0&&(n={});try{return we(e,t,n).formatToParts(r)}catch(a){e.onError(new B("Error formatting number.",e.locale,a))}return[]}function ar(e){var t=e?e[Object.keys(e)[0]]:void 0;return typeof t=="string"}function ir(e){e.onWarn&&e.defaultRichTextElements&&ar(e.messages||{})&&e.onWarn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
|
|
21
21
|
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
|
|
22
|
-
For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function or(e,t){var r=Ft(t),n=f(f({},wt),e),a=n.locale,i=n.defaultLocale,o=n.onError;return a?!Intl.NumberFormat.supportedLocalesOf(a).length&&o?o(new _e('Missing locale data for locale: "'.concat(a,'" in Intl.NumberFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(a).length&&o&&o(new _e('Missing locale data for locale: "'.concat(a,'" in Intl.DateTimeFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(o&&o(new Ot('"locale" was not configured, using "'.concat(i,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),n.locale=n.defaultLocale||"en"),ir(n),f(f({},n),{formatters:r,formatNumber:rr.bind(null,n,r.getNumberFormat),formatNumberToParts:nr.bind(null,n,r.getNumberFormat),formatRelativeTime:er.bind(null,n,r.getRelativeTimeFormat),formatDate:Ut.bind(null,n,r.getDateTimeFormat),formatDateToParts:jt.bind(null,n,r.getDateTimeFormat),formatTime:Vt.bind(null,n,r.getDateTimeFormat),formatDateTimeRange:kt.bind(null,n,r.getDateTimeFormat),formatTimeToParts:Xt.bind(null,n,r.getDateTimeFormat),formatPlural:Yt.bind(null,n,r.getPluralRules),formatMessage:Oe.bind(null,n,r),$t:Oe.bind(null,n,r),formatList:Jt.bind(null,n,r.getListFormat),formatListToParts:De.bind(null,n,r.getListFormat),formatDisplayName:Zt.bind(null,n,r.getDisplayNames)})}function sr(e){return e&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function ur(e){return e}function hr(e,t){t=t||{};const r=t.delimiter||".",n=t.maxDepth,a=t.transformKey||ur,i={};function o(s,u,l){l=l||1,Object.keys(s).forEach(function(h){const m=s[h],c=t.safe&&Array.isArray(m),y=Object.prototype.toString.call(m),x=sr(m),d=y==="[object Object]"||y==="[object Array]",v=u?u+r+a(h):a(h);if(!c&&!x&&d&&Object.keys(m).length&&(!t.maxDepth||l<n))return o(m,v,l+1);i[v]=m})}return o(e),i}const lr=Pe();let Fe;const Ge={year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"},fr=(e,t,r=!1)=>{var d;const n=typeof r=="boolean",a=or({...n?null:r,locale:e,messages:hr(t,{safe:!0}),formats:{...n?null:r.formats,date:{...n?null:(d=r.formats)==null?void 0:d.date,datetime:Ge}}},lr),{$t:i,...o}=a,s=o,u=v=>v.toString().length===13?Math.floor(v/1e3):v,l=v=>{const E="Invalid Date";if(!v)return E;try{const T=new Date(u(v)*1e3);return s.formatDate(T,Ge)}catch{return E}},x={formatUnixTimeStamp:l,formatIsoDate:v=>{const E=Date.parse(v)/1e3,T=Math.floor(E);return l(T)},t:(v,E,T)=>s.formatMessage({id:v},E,T),te:v=>!!s.messages[v],tm:v=>s.messages[v]||[],...s,source:t};return(typeof r=="boolean"&&r===!0||typeof r!="boolean"&&r.isGlobal===!0)&&(Fe=x),x};function mr(){return Fe}const Ue=(e=null)=>w.defineComponent({name:"I18nT",props:{i18n:{type:Object,default:null},keypath:{type:String,required:!0},tag:{type:String,default:"span"}},setup(t,{slots:r}){const n=a=>{if(!a)return[];const i=/(\{[^}]+\})/g;return a.split(i).filter(Boolean)};return()=>{var s;const a=Object.keys(r).filter(u=>u!=="_"),i=((s=(e||t.i18n).messages[t.keypath])==null?void 0:s.toString())||"";let o=n(i);return o=o.filter(u=>u!==""),o.forEach((u,l)=>{if(!u.startsWith("{")&&!u.endsWith("}"))return;const h=u.replace(/[\{\}]/g,"");h==="0"&&r.default?o[l]=r.default():a.includes(h)&&r[h]&&(o[l]=r[h]())}),w.h(t.tag,t,o)}}}),cr={install(e,t){const{i18n:r}=t;e.component("I18nT",Ue(r))}};P.Translation=cr,P.createI18n=fr,P.i18nTComponent=Ue,P.useI18n=mr,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
|
|
22
|
+
For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function or(e,t){var r=Ft(t),n=f(f({},wt),e),a=n.locale,i=n.defaultLocale,o=n.onError;return a?!Intl.NumberFormat.supportedLocalesOf(a).length&&o?o(new _e('Missing locale data for locale: "'.concat(a,'" in Intl.NumberFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(a).length&&o&&o(new _e('Missing locale data for locale: "'.concat(a,'" in Intl.DateTimeFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(o&&o(new Ot('"locale" was not configured, using "'.concat(i,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),n.locale=n.defaultLocale||"en"),ir(n),f(f({},n),{formatters:r,formatNumber:rr.bind(null,n,r.getNumberFormat),formatNumberToParts:nr.bind(null,n,r.getNumberFormat),formatRelativeTime:er.bind(null,n,r.getRelativeTimeFormat),formatDate:Ut.bind(null,n,r.getDateTimeFormat),formatDateToParts:jt.bind(null,n,r.getDateTimeFormat),formatTime:Vt.bind(null,n,r.getDateTimeFormat),formatDateTimeRange:kt.bind(null,n,r.getDateTimeFormat),formatTimeToParts:Xt.bind(null,n,r.getDateTimeFormat),formatPlural:Yt.bind(null,n,r.getPluralRules),formatMessage:Oe.bind(null,n,r),$t:Oe.bind(null,n,r),formatList:Jt.bind(null,n,r.getListFormat),formatListToParts:De.bind(null,n,r.getListFormat),formatDisplayName:Zt.bind(null,n,r.getDisplayNames)})}function sr(e){return e&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function ur(e){return e}function hr(e,t){t=t||{};const r=t.delimiter||".",n=t.maxDepth,a=t.transformKey||ur,i={};function o(s,u,l){l=l||1,Object.keys(s).forEach(function(h){const m=s[h],c=t.safe&&Array.isArray(m),y=Object.prototype.toString.call(m),x=sr(m),d=y==="[object Object]"||y==="[object Array]",v=u?u+r+a(h):a(h);if(!c&&!x&&d&&Object.keys(m).length&&(!t.maxDepth||l<n))return o(m,v,l+1);i[v]=m})}return o(e),i}const lr=Pe();let Fe;const Ge={year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"},fr=(e,t,r=!1)=>{var d;const n=typeof r=="boolean",a=or({...n?null:r,locale:e,messages:hr(t,{safe:!0}),formats:{...n?null:r.formats,date:{...n?null:(d=r.formats)==null?void 0:d.date,datetime:Ge}}},lr),{$t:i,...o}=a,s=o,u=v=>v.toString().length===13?Math.floor(v/1e3):v,l=v=>{const E="Invalid Date";if(!v)return E;try{const T=new Date(u(Math.round(v))*1e3);return s.formatDate(T,Ge)}catch{return E}},x={formatUnixTimeStamp:l,formatIsoDate:v=>{const E=Date.parse(v)/1e3,T=Math.floor(E);return l(T)},t:(v,E,T)=>s.formatMessage({id:v},E,T),te:v=>!!s.messages[v],tm:v=>s.messages[v]||[],...s,source:t};return(typeof r=="boolean"&&r===!0||typeof r!="boolean"&&r.isGlobal===!0)&&(Fe=x),x};function mr(){return Fe}const Ue=(e=null)=>w.defineComponent({name:"I18nT",props:{i18n:{type:Object,default:null},keypath:{type:String,required:!0},tag:{type:String,default:"span"}},setup(t,{slots:r}){const n=a=>{if(!a)return[];const i=/(\{[^}]+\})/g;return a.split(i).filter(Boolean)};return()=>{var s;const a=Object.keys(r).filter(u=>u!=="_"),i=((s=(e||t.i18n).messages[t.keypath])==null?void 0:s.toString())||"";let o=n(i);return o=o.filter(u=>u!==""),o.forEach((u,l)=>{if(!u.startsWith("{")&&!u.endsWith("}"))return;const h=u.replace(/[\{\}]/g,"");h==="0"&&r.default?o[l]=r.default():a.includes(h)&&r[h]&&(o[l]=r[h]())}),w.h(t.tag,t,o)}}}),cr={install(e,t){const{i18n:r}=t;e.component("I18nT",Ue(r))}};P.Translation=cr,P.createI18n=fr,P.i18nTComponent=Ue,P.useI18n=mr,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
|