@roudanio/awesome-comment 0.10.8 → 0.10.10

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.
@@ -1,984 +0,0 @@
1
- import { i as L, m as M, a as h, b as d, D as Ve, c as y, d as Z, e as U, u as H, f as ee, g as ht, h as P, j as N, k as q, l as te, n as kt, o as p, p as de, q as Ee, r as G, s as Q, A as Ot, t as Nt, v as yt, N as pt, w as xe, x as Pt, y as Ie, C as Mt, z as Fe, B as Le, M as Te, E as Re, F as ve, G as he, H as ke, I as St, J as Dt, K as Ct, L as At, O as Wt, P as Ut, Q as j, R as Vt, S as xt, T as $t } from "./vendor-misc-CwXjvmXA.js";
2
- import { e as wt, r as Ht, s as Yt, c as Y, w as ne, a as jt, d as ie, h as $e, g as Gt, F as we, i as Bt, o as Xt, b as Jt, f as zt, T as Kt } from "./vendor-vue-BTtW1k2s.js";
3
- const qt = "11.2.8";
4
- function Qt() {
5
- typeof __VUE_I18N_FULL_INSTALL__ != "boolean" && (j().__VUE_I18N_FULL_INSTALL__ = !0), typeof __VUE_I18N_LEGACY_API__ != "boolean" && (j().__VUE_I18N_LEGACY_API__ = !0), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (j().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1), typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (j().__INTLIFY_PROD_DEVTOOLS__ = !1);
6
- }
7
- const R = {
8
- // composer module errors
9
- UNEXPECTED_RETURN_TYPE: Mt,
10
- // 24
11
- // legacy module errors
12
- INVALID_ARGUMENT: 25,
13
- // i18n module errors
14
- MUST_BE_CALL_SETUP_TOP: 26,
15
- NOT_INSTALLED: 27,
16
- // directive module errors
17
- REQUIRED_VALUE: 28,
18
- INVALID_VALUE: 29,
19
- NOT_INSTALLED_WITH_PROVIDE: 31,
20
- // unexpected error
21
- UNEXPECTED_ERROR: 32
22
- };
23
- function k(e, ...t) {
24
- return ht(e, null, void 0);
25
- }
26
- const re = /* @__PURE__ */ M("__translateVNode"), se = /* @__PURE__ */ M("__datetimeParts"), le = /* @__PURE__ */ M("__numberParts"), He = M("__setPluralRules"), Ye = /* @__PURE__ */ M("__injectWithOption"), oe = /* @__PURE__ */ M("__dispose");
27
- function B(e) {
28
- if (!p(e) || Q(e))
29
- return e;
30
- for (const t in e)
31
- if (te(e, t))
32
- if (!t.includes("."))
33
- p(e[t]) && B(e[t]);
34
- else {
35
- const c = t.split("."), l = c.length - 1;
36
- let a = e, r = !1;
37
- for (let s = 0; s < l; s++) {
38
- if (c[s] === "__proto__")
39
- throw new Error(`unsafe key: ${c[s]}`);
40
- if (c[s] in a || (a[c[s]] = N()), !p(a[c[s]])) {
41
- r = !0;
42
- break;
43
- }
44
- a = a[c[s]];
45
- }
46
- if (r || (Q(a) ? Ot.includes(c[l]) || delete e[t] : (a[c[l]] = e[t], delete e[t])), !Q(a)) {
47
- const s = a[c[l]];
48
- p(s) && B(s);
49
- }
50
- }
51
- return e;
52
- }
53
- function ue(e, t) {
54
- const { messages: c, __i18n: l, messageResolver: a, flatJson: r } = t, s = h(c) ? c : y(l) ? N() : { [e]: N() };
55
- if (y(l) && l.forEach((i) => {
56
- if ("locale" in i && "resource" in i) {
57
- const { locale: u, resource: m } = i;
58
- u ? (s[u] = s[u] || N(), q(m, s[u])) : q(m, s);
59
- } else
60
- d(i) && q(JSON.parse(i), s);
61
- }), a == null && r)
62
- for (const i in s)
63
- te(s, i) && B(s[i]);
64
- return s;
65
- }
66
- function je(e) {
67
- return e.type;
68
- }
69
- function Ge(e, t, c) {
70
- let l = p(t.messages) ? t.messages : N();
71
- "__i18nGlobal" in c && (l = ue(e.locale.value, {
72
- messages: l,
73
- __i18n: c.__i18nGlobal
74
- }));
75
- const a = Object.keys(l);
76
- a.length && a.forEach((r) => {
77
- e.mergeLocaleMessage(r, l[r]);
78
- });
79
- {
80
- if (p(t.datetimeFormats)) {
81
- const r = Object.keys(t.datetimeFormats);
82
- r.length && r.forEach((s) => {
83
- e.mergeDateTimeFormat(s, t.datetimeFormats[s]);
84
- });
85
- }
86
- if (p(t.numberFormats)) {
87
- const r = Object.keys(t.numberFormats);
88
- r.length && r.forEach((s) => {
89
- e.mergeNumberFormat(s, t.numberFormats[s]);
90
- });
91
- }
92
- }
93
- }
94
- function Oe(e) {
95
- return zt(Kt, null, e, 0);
96
- }
97
- function X() {
98
- return Gt();
99
- }
100
- const Ne = "__INTLIFY_META__", ye = () => [], Zt = () => !1;
101
- let pe = 0;
102
- function Pe(e) {
103
- return ((t, c, l, a) => e(c, l, X() || void 0, a));
104
- }
105
- const ea = /* @__NO_SIDE_EFFECTS__ */ () => {
106
- const e = X();
107
- let t = null;
108
- return e && (t = je(e)[Ne]) ? { [Ne]: t } : null;
109
- };
110
- function _e(e = {}) {
111
- const { __root: t, __injectWithOption: c } = e, l = t === void 0, a = e.flatJson, r = ee ? Ht : Yt;
112
- let s = L(e.inheritLocale) ? e.inheritLocale : !0;
113
- const i = r(
114
- // prettier-ignore
115
- t && s ? t.locale.value : d(e.locale) ? e.locale : Ve
116
- ), u = r(
117
- // prettier-ignore
118
- t && s ? t.fallbackLocale.value : d(e.fallbackLocale) || y(e.fallbackLocale) || h(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : i.value
119
- ), m = r(ue(i.value, e)), b = r(h(e.datetimeFormats) ? e.datetimeFormats : { [i.value]: {} }), f = r(h(e.numberFormats) ? e.numberFormats : { [i.value]: {} });
120
- let E = t ? t.missingWarn : L(e.missingWarn) || Z(e.missingWarn) ? e.missingWarn : !0, T = t ? t.fallbackWarn : L(e.fallbackWarn) || Z(e.fallbackWarn) ? e.fallbackWarn : !0, O = t ? t.fallbackRoot : L(e.fallbackRoot) ? e.fallbackRoot : !0, v = !!e.fallbackFormat, J = U(e.missing) ? e.missing : null, A = U(e.missing) ? Pe(e.missing) : null, S = U(e.postTranslation) ? e.postTranslation : null, V = t ? t.warnHtmlMessage : L(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, x = !!e.escapeParameter;
121
- const $ = t ? t.modifiers : h(e.modifiers) ? e.modifiers : {};
122
- let w = e.pluralRules || t && t.pluralRules, _;
123
- _ = (() => {
124
- l && Ie(null);
125
- const n = {
126
- version: qt,
127
- locale: i.value,
128
- fallbackLocale: u.value,
129
- messages: m.value,
130
- modifiers: $,
131
- pluralRules: w,
132
- missing: A === null ? void 0 : A,
133
- missingWarn: E,
134
- fallbackWarn: T,
135
- fallbackFormat: v,
136
- unresolving: !0,
137
- postTranslation: S === null ? void 0 : S,
138
- warnHtmlMessage: V,
139
- escapeParameter: x,
140
- messageResolver: e.messageResolver,
141
- messageCompiler: e.messageCompiler,
142
- __meta: { framework: "vue" }
143
- };
144
- n.datetimeFormats = b.value, n.numberFormats = f.value, n.__datetimeFormatters = h(_) ? _.__datetimeFormatters : void 0, n.__numberFormatters = h(_) ? _.__numberFormatters : void 0;
145
- const o = kt(n);
146
- return l && Ie(o), o;
147
- })(), H(_, i.value, u.value);
148
- function ae() {
149
- return [
150
- i.value,
151
- u.value,
152
- m.value,
153
- b.value,
154
- f.value
155
- ];
156
- }
157
- const Je = Y({
158
- get: () => i.value,
159
- set: (n) => {
160
- _.locale = n, i.value = n;
161
- }
162
- }), ze = Y({
163
- get: () => u.value,
164
- set: (n) => {
165
- _.fallbackLocale = n, u.value = n, H(_, i.value, n);
166
- }
167
- }), Ke = Y(() => m.value), qe = /* @__PURE__ */ Y(() => b.value), Qe = /* @__PURE__ */ Y(() => f.value);
168
- function Ze() {
169
- return U(S) ? S : null;
170
- }
171
- function et(n) {
172
- S = n, _.postTranslation = n;
173
- }
174
- function tt() {
175
- return J;
176
- }
177
- function at(n) {
178
- n !== null && (A = Pe(n)), J = n, _.missing = A;
179
- }
180
- const D = (n, o, g, I, C, K) => {
181
- ae();
182
- let W;
183
- try {
184
- __INTLIFY_PROD_DEVTOOLS__ && Nt(/* @__PURE__ */ ea()), l || (_.fallbackContext = t ? yt() : void 0), W = n(_);
185
- } finally {
186
- __INTLIFY_PROD_DEVTOOLS__, l || (_.fallbackContext = void 0);
187
- }
188
- if (g !== "translate exists" && // for not `te` (e.g `t`)
189
- G(W) && W === pt || g === "translate exists" && !W) {
190
- const [vt, Ra] = o();
191
- return t && O ? I(t) : C(vt);
192
- } else {
193
- if (K(W))
194
- return W;
195
- throw k(R.UNEXPECTED_RETURN_TYPE);
196
- }
197
- };
198
- function ge(...n) {
199
- return D((o) => Reflect.apply(Le, null, [o, ...n]), () => Fe(...n), "translate", (o) => Reflect.apply(o.t, o, [...n]), (o) => o, (o) => d(o));
200
- }
201
- function nt(...n) {
202
- const [o, g, I] = n;
203
- if (I && !p(I))
204
- throw k(R.INVALID_ARGUMENT);
205
- return ge(o, g, P({ resolvedMessage: !0 }, I || {}));
206
- }
207
- function rt(...n) {
208
- return D((o) => Reflect.apply(ve, null, [o, ...n]), () => Re(...n), "datetime format", (o) => Reflect.apply(o.d, o, [...n]), () => Te, (o) => d(o) || y(o));
209
- }
210
- function st(...n) {
211
- return D((o) => Reflect.apply(ke, null, [o, ...n]), () => he(...n), "number format", (o) => Reflect.apply(o.n, o, [...n]), () => Te, (o) => d(o) || y(o));
212
- }
213
- function lt(n) {
214
- return n.map((o) => d(o) || G(o) || L(o) ? Oe(String(o)) : o);
215
- }
216
- const ot = {
217
- normalize: lt,
218
- interpolate: (n) => n,
219
- type: "vnode"
220
- };
221
- function ct(...n) {
222
- return D((o) => {
223
- let g;
224
- const I = o;
225
- try {
226
- I.processor = ot, g = Reflect.apply(Le, null, [I, ...n]);
227
- } finally {
228
- I.processor = null;
229
- }
230
- return g;
231
- }, () => Fe(...n), "translate", (o) => o[re](...n), (o) => [Oe(o)], (o) => y(o));
232
- }
233
- function it(...n) {
234
- return D((o) => Reflect.apply(ke, null, [o, ...n]), () => he(...n), "number format", (o) => o[le](...n), ye, (o) => d(o) || y(o));
235
- }
236
- function ut(...n) {
237
- return D((o) => Reflect.apply(ve, null, [o, ...n]), () => Re(...n), "datetime format", (o) => o[se](...n), ye, (o) => d(o) || y(o));
238
- }
239
- function _t(n) {
240
- w = n, _.pluralRules = w;
241
- }
242
- function mt(n, o) {
243
- return D(() => {
244
- if (!n)
245
- return !1;
246
- const g = d(o) ? o : i.value, I = be(g), C = _.messageResolver(I, n);
247
- return Q(C) || St(C) || d(C);
248
- }, () => [n], "translate exists", (g) => Reflect.apply(g.te, g, [n, o]), Zt, (g) => L(g));
249
- }
250
- function ft(n) {
251
- let o = null;
252
- const g = xe(_, u.value, i.value);
253
- for (let I = 0; I < g.length; I++) {
254
- const C = m.value[g[I]] || {}, K = _.messageResolver(C, n);
255
- if (K != null) {
256
- o = K;
257
- break;
258
- }
259
- }
260
- return o;
261
- }
262
- function gt(n) {
263
- const o = ft(n);
264
- return o ?? (t ? t.tm(n) || {} : {});
265
- }
266
- function be(n) {
267
- return m.value[n] || {};
268
- }
269
- function bt(n, o) {
270
- if (a) {
271
- const g = { [n]: o };
272
- for (const I in g)
273
- te(g, I) && B(g[I]);
274
- o = g[n];
275
- }
276
- m.value[n] = o, _.messages = m.value;
277
- }
278
- function dt(n, o) {
279
- m.value[n] = m.value[n] || {};
280
- const g = { [n]: o };
281
- if (a)
282
- for (const I in g)
283
- te(g, I) && B(g[I]);
284
- o = g[n], q(o, m.value[n]), _.messages = m.value;
285
- }
286
- function Et(n) {
287
- return b.value[n] || {};
288
- }
289
- function It(n, o) {
290
- b.value[n] = o, _.datetimeFormats = b.value, de(_, n, o);
291
- }
292
- function Ft(n, o) {
293
- b.value[n] = P(b.value[n] || {}, o), _.datetimeFormats = b.value, de(_, n, o);
294
- }
295
- function Lt(n) {
296
- return f.value[n] || {};
297
- }
298
- function Tt(n, o) {
299
- f.value[n] = o, _.numberFormats = f.value, Ee(_, n, o);
300
- }
301
- function Rt(n, o) {
302
- f.value[n] = P(f.value[n] || {}, o), _.numberFormats = f.value, Ee(_, n, o);
303
- }
304
- pe++, t && ee && (ne(t.locale, (n) => {
305
- s && (i.value = n, _.locale = n, H(_, i.value, u.value));
306
- }), ne(t.fallbackLocale, (n) => {
307
- s && (u.value = n, _.fallbackLocale = n, H(_, i.value, u.value));
308
- }));
309
- const F = {
310
- id: pe,
311
- locale: Je,
312
- fallbackLocale: ze,
313
- get inheritLocale() {
314
- return s;
315
- },
316
- set inheritLocale(n) {
317
- s = n, n && t && (i.value = t.locale.value, u.value = t.fallbackLocale.value, H(_, i.value, u.value));
318
- },
319
- get availableLocales() {
320
- return Object.keys(m.value).sort();
321
- },
322
- messages: Ke,
323
- get modifiers() {
324
- return $;
325
- },
326
- get pluralRules() {
327
- return w || {};
328
- },
329
- get isGlobal() {
330
- return l;
331
- },
332
- get missingWarn() {
333
- return E;
334
- },
335
- set missingWarn(n) {
336
- E = n, _.missingWarn = E;
337
- },
338
- get fallbackWarn() {
339
- return T;
340
- },
341
- set fallbackWarn(n) {
342
- T = n, _.fallbackWarn = T;
343
- },
344
- get fallbackRoot() {
345
- return O;
346
- },
347
- set fallbackRoot(n) {
348
- O = n;
349
- },
350
- get fallbackFormat() {
351
- return v;
352
- },
353
- set fallbackFormat(n) {
354
- v = n, _.fallbackFormat = v;
355
- },
356
- get warnHtmlMessage() {
357
- return V;
358
- },
359
- set warnHtmlMessage(n) {
360
- V = n, _.warnHtmlMessage = n;
361
- },
362
- get escapeParameter() {
363
- return x;
364
- },
365
- set escapeParameter(n) {
366
- x = n, _.escapeParameter = n;
367
- },
368
- t: ge,
369
- getLocaleMessage: be,
370
- setLocaleMessage: bt,
371
- mergeLocaleMessage: dt,
372
- getPostTranslationHandler: Ze,
373
- setPostTranslationHandler: et,
374
- getMissingHandler: tt,
375
- setMissingHandler: at,
376
- [He]: _t
377
- };
378
- return F.datetimeFormats = qe, F.numberFormats = Qe, F.rt = nt, F.te = mt, F.tm = gt, F.d = rt, F.n = st, F.getDateTimeFormat = Et, F.setDateTimeFormat = It, F.mergeDateTimeFormat = Ft, F.getNumberFormat = Lt, F.setNumberFormat = Tt, F.mergeNumberFormat = Rt, F[Ye] = c, F[re] = ct, F[se] = ut, F[le] = it, F;
379
- }
380
- function ta(e) {
381
- const t = d(e.locale) ? e.locale : Ve, c = d(e.fallbackLocale) || y(e.fallbackLocale) || h(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : t, l = U(e.missing) ? e.missing : void 0, a = L(e.silentTranslationWarn) || Z(e.silentTranslationWarn) ? !e.silentTranslationWarn : !0, r = L(e.silentFallbackWarn) || Z(e.silentFallbackWarn) ? !e.silentFallbackWarn : !0, s = L(e.fallbackRoot) ? e.fallbackRoot : !0, i = !!e.formatFallbackMessages, u = h(e.modifiers) ? e.modifiers : {}, m = e.pluralizationRules, b = U(e.postTranslation) ? e.postTranslation : void 0, f = d(e.warnHtmlInMessage) ? e.warnHtmlInMessage !== "off" : !0, E = !!e.escapeParameterHtml, T = L(e.sync) ? e.sync : !0;
382
- let O = e.messages;
383
- if (h(e.sharedMessages)) {
384
- const $ = e.sharedMessages;
385
- O = Object.keys($).reduce((_, z) => {
386
- const ae = _[z] || (_[z] = {});
387
- return P(ae, $[z]), _;
388
- }, O || {});
389
- }
390
- const { __i18n: v, __root: J, __injectWithOption: A } = e, S = e.datetimeFormats, V = e.numberFormats, x = e.flatJson;
391
- return {
392
- locale: t,
393
- fallbackLocale: c,
394
- messages: O,
395
- flatJson: x,
396
- datetimeFormats: S,
397
- numberFormats: V,
398
- missing: l,
399
- missingWarn: a,
400
- fallbackWarn: r,
401
- fallbackRoot: s,
402
- fallbackFormat: i,
403
- modifiers: u,
404
- pluralRules: m,
405
- postTranslation: b,
406
- warnHtmlMessage: f,
407
- escapeParameter: E,
408
- messageResolver: e.messageResolver,
409
- inheritLocale: T,
410
- __i18n: v,
411
- __root: J,
412
- __injectWithOption: A
413
- };
414
- }
415
- function ce(e = {}) {
416
- const t = _e(ta(e)), { __extender: c } = e, l = {
417
- // id
418
- id: t.id,
419
- // locale
420
- get locale() {
421
- return t.locale.value;
422
- },
423
- set locale(a) {
424
- t.locale.value = a;
425
- },
426
- // fallbackLocale
427
- get fallbackLocale() {
428
- return t.fallbackLocale.value;
429
- },
430
- set fallbackLocale(a) {
431
- t.fallbackLocale.value = a;
432
- },
433
- // messages
434
- get messages() {
435
- return t.messages.value;
436
- },
437
- // datetimeFormats
438
- get datetimeFormats() {
439
- return t.datetimeFormats.value;
440
- },
441
- // numberFormats
442
- get numberFormats() {
443
- return t.numberFormats.value;
444
- },
445
- // availableLocales
446
- get availableLocales() {
447
- return t.availableLocales;
448
- },
449
- // missing
450
- get missing() {
451
- return t.getMissingHandler();
452
- },
453
- set missing(a) {
454
- t.setMissingHandler(a);
455
- },
456
- // silentTranslationWarn
457
- get silentTranslationWarn() {
458
- return L(t.missingWarn) ? !t.missingWarn : t.missingWarn;
459
- },
460
- set silentTranslationWarn(a) {
461
- t.missingWarn = L(a) ? !a : a;
462
- },
463
- // silentFallbackWarn
464
- get silentFallbackWarn() {
465
- return L(t.fallbackWarn) ? !t.fallbackWarn : t.fallbackWarn;
466
- },
467
- set silentFallbackWarn(a) {
468
- t.fallbackWarn = L(a) ? !a : a;
469
- },
470
- // modifiers
471
- get modifiers() {
472
- return t.modifiers;
473
- },
474
- // formatFallbackMessages
475
- get formatFallbackMessages() {
476
- return t.fallbackFormat;
477
- },
478
- set formatFallbackMessages(a) {
479
- t.fallbackFormat = a;
480
- },
481
- // postTranslation
482
- get postTranslation() {
483
- return t.getPostTranslationHandler();
484
- },
485
- set postTranslation(a) {
486
- t.setPostTranslationHandler(a);
487
- },
488
- // sync
489
- get sync() {
490
- return t.inheritLocale;
491
- },
492
- set sync(a) {
493
- t.inheritLocale = a;
494
- },
495
- // warnInHtmlMessage
496
- get warnHtmlInMessage() {
497
- return t.warnHtmlMessage ? "warn" : "off";
498
- },
499
- set warnHtmlInMessage(a) {
500
- t.warnHtmlMessage = a !== "off";
501
- },
502
- // escapeParameterHtml
503
- get escapeParameterHtml() {
504
- return t.escapeParameter;
505
- },
506
- set escapeParameterHtml(a) {
507
- t.escapeParameter = a;
508
- },
509
- // pluralizationRules
510
- get pluralizationRules() {
511
- return t.pluralRules || {};
512
- },
513
- // for internal
514
- __composer: t,
515
- // t
516
- t(...a) {
517
- return Reflect.apply(t.t, t, [...a]);
518
- },
519
- // rt
520
- rt(...a) {
521
- return Reflect.apply(t.rt, t, [...a]);
522
- },
523
- // te
524
- te(a, r) {
525
- return t.te(a, r);
526
- },
527
- // tm
528
- tm(a) {
529
- return t.tm(a);
530
- },
531
- // getLocaleMessage
532
- getLocaleMessage(a) {
533
- return t.getLocaleMessage(a);
534
- },
535
- // setLocaleMessage
536
- setLocaleMessage(a, r) {
537
- t.setLocaleMessage(a, r);
538
- },
539
- // mergeLocaleMessage
540
- mergeLocaleMessage(a, r) {
541
- t.mergeLocaleMessage(a, r);
542
- },
543
- // d
544
- d(...a) {
545
- return Reflect.apply(t.d, t, [...a]);
546
- },
547
- // getDateTimeFormat
548
- getDateTimeFormat(a) {
549
- return t.getDateTimeFormat(a);
550
- },
551
- // setDateTimeFormat
552
- setDateTimeFormat(a, r) {
553
- t.setDateTimeFormat(a, r);
554
- },
555
- // mergeDateTimeFormat
556
- mergeDateTimeFormat(a, r) {
557
- t.mergeDateTimeFormat(a, r);
558
- },
559
- // n
560
- n(...a) {
561
- return Reflect.apply(t.n, t, [...a]);
562
- },
563
- // getNumberFormat
564
- getNumberFormat(a) {
565
- return t.getNumberFormat(a);
566
- },
567
- // setNumberFormat
568
- setNumberFormat(a, r) {
569
- t.setNumberFormat(a, r);
570
- },
571
- // mergeNumberFormat
572
- mergeNumberFormat(a, r) {
573
- t.mergeNumberFormat(a, r);
574
- }
575
- };
576
- return l.__extender = c, l;
577
- }
578
- function aa(e, t, c) {
579
- return {
580
- beforeCreate() {
581
- const l = X();
582
- if (!l)
583
- throw k(R.UNEXPECTED_ERROR);
584
- const a = this.$options;
585
- if (a.i18n) {
586
- const r = a.i18n;
587
- if (a.__i18n && (r.__i18n = a.__i18n), r.__root = t, this === this.$root)
588
- this.$i18n = Me(e, r);
589
- else {
590
- r.__injectWithOption = !0, r.__extender = c.__vueI18nExtend, this.$i18n = ce(r);
591
- const s = this.$i18n;
592
- s.__extender && (s.__disposer = s.__extender(this.$i18n));
593
- }
594
- } else if (a.__i18n)
595
- if (this === this.$root)
596
- this.$i18n = Me(e, a);
597
- else {
598
- this.$i18n = ce({
599
- __i18n: a.__i18n,
600
- __injectWithOption: !0,
601
- __extender: c.__vueI18nExtend,
602
- __root: t
603
- });
604
- const r = this.$i18n;
605
- r.__extender && (r.__disposer = r.__extender(this.$i18n));
606
- }
607
- else
608
- this.$i18n = e;
609
- a.__i18nGlobal && Ge(t, a, a), this.$t = (...r) => this.$i18n.t(...r), this.$rt = (...r) => this.$i18n.rt(...r), this.$te = (r, s) => this.$i18n.te(r, s), this.$d = (...r) => this.$i18n.d(...r), this.$n = (...r) => this.$i18n.n(...r), this.$tm = (r) => this.$i18n.tm(r), c.__setInstance(l, this.$i18n);
610
- },
611
- mounted() {
612
- },
613
- unmounted() {
614
- const l = X();
615
- if (!l)
616
- throw k(R.UNEXPECTED_ERROR);
617
- const a = this.$i18n;
618
- delete this.$t, delete this.$rt, delete this.$te, delete this.$d, delete this.$n, delete this.$tm, a.__disposer && (a.__disposer(), delete a.__disposer, delete a.__extender), c.__deleteInstance(l), delete this.$i18n;
619
- }
620
- };
621
- }
622
- function Me(e, t) {
623
- e.locale = t.locale || e.locale, e.fallbackLocale = t.fallbackLocale || e.fallbackLocale, e.missing = t.missing || e.missing, e.silentTranslationWarn = t.silentTranslationWarn || e.silentFallbackWarn, e.silentFallbackWarn = t.silentFallbackWarn || e.silentFallbackWarn, e.formatFallbackMessages = t.formatFallbackMessages || e.formatFallbackMessages, e.postTranslation = t.postTranslation || e.postTranslation, e.warnHtmlInMessage = t.warnHtmlInMessage || e.warnHtmlInMessage, e.escapeParameterHtml = t.escapeParameterHtml || e.escapeParameterHtml, e.sync = t.sync || e.sync, e.__composer[He](t.pluralizationRules || e.pluralizationRules);
624
- const c = ue(e.locale, {
625
- messages: t.messages,
626
- __i18n: t.__i18n
627
- });
628
- return Object.keys(c).forEach((l) => e.mergeLocaleMessage(l, c[l])), t.datetimeFormats && Object.keys(t.datetimeFormats).forEach((l) => e.mergeDateTimeFormat(l, t.datetimeFormats[l])), t.numberFormats && Object.keys(t.numberFormats).forEach((l) => e.mergeNumberFormat(l, t.numberFormats[l])), e;
629
- }
630
- const me = {
631
- tag: {
632
- type: [String, Object]
633
- },
634
- locale: {
635
- type: String
636
- },
637
- scope: {
638
- type: String,
639
- // NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
640
- validator: (e) => e === "parent" || e === "global",
641
- default: "parent"
642
- /* ComponentI18nScope */
643
- },
644
- i18n: {
645
- type: Object
646
- }
647
- };
648
- function na({ slots: e }, t) {
649
- return t.length === 1 && t[0] === "default" ? (e.default ? e.default() : []).reduce((l, a) => [
650
- ...l,
651
- // prettier-ignore
652
- ...a.type === we ? a.children : [a]
653
- ], []) : t.reduce((c, l) => {
654
- const a = e[l];
655
- return a && (c[l] = a()), c;
656
- }, N());
657
- }
658
- function Be() {
659
- return we;
660
- }
661
- const ra = /* @__PURE__ */ ie({
662
- /* eslint-disable */
663
- name: "i18n-t",
664
- props: P({
665
- keypath: {
666
- type: String,
667
- required: !0
668
- },
669
- plural: {
670
- type: [Number, String],
671
- validator: (e) => G(e) || !isNaN(e)
672
- }
673
- }, me),
674
- /* eslint-enable */
675
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
676
- setup(e, t) {
677
- const { slots: c, attrs: l } = t, a = e.i18n || fe({
678
- useScope: e.scope,
679
- __useComponent: !0
680
- });
681
- return () => {
682
- const r = Object.keys(c).filter((f) => f[0] !== "_"), s = N();
683
- e.locale && (s.locale = e.locale), e.plural !== void 0 && (s.plural = d(e.plural) ? +e.plural : e.plural);
684
- const i = na(t, r), u = a[re](e.keypath, i, s), m = P(N(), l), b = d(e.tag) || p(e.tag) ? e.tag : Be();
685
- return $e(b, m, u);
686
- };
687
- }
688
- }), Se = ra;
689
- function sa(e) {
690
- return y(e) && !d(e[0]);
691
- }
692
- function Xe(e, t, c, l) {
693
- const { slots: a, attrs: r } = t;
694
- return () => {
695
- const s = { part: !0 };
696
- let i = N();
697
- e.locale && (s.locale = e.locale), d(e.format) ? s.key = e.format : p(e.format) && (d(e.format.key) && (s.key = e.format.key), i = Object.keys(e.format).reduce((E, T) => c.includes(T) ? P(N(), E, { [T]: e.format[T] }) : E, N()));
698
- const u = l(e.value, s, i);
699
- let m = [s.key];
700
- y(u) ? m = u.map((E, T) => {
701
- const O = a[E.type], v = O ? O({ [E.type]: E.value, index: T, parts: u }) : [E.value];
702
- return sa(v) && (v[0].key = `${E.type}-${T}`), v;
703
- }) : d(u) && (m = [u]);
704
- const b = P(N(), r), f = d(e.tag) || p(e.tag) ? e.tag : Be();
705
- return $e(f, b, m);
706
- };
707
- }
708
- const la = /* @__PURE__ */ ie({
709
- /* eslint-disable */
710
- name: "i18n-n",
711
- props: P({
712
- value: {
713
- type: Number,
714
- required: !0
715
- },
716
- format: {
717
- type: [String, Object]
718
- }
719
- }, me),
720
- /* eslint-enable */
721
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
722
- setup(e, t) {
723
- const c = e.i18n || fe({
724
- useScope: e.scope,
725
- __useComponent: !0
726
- });
727
- return Xe(e, t, Dt, (...l) => (
728
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
729
- c[le](...l)
730
- ));
731
- }
732
- }), De = la;
733
- function oa(e, t) {
734
- const c = e;
735
- if (e.mode === "composition")
736
- return c.__getInstance(t) || e.global;
737
- {
738
- const l = c.__getInstance(t);
739
- return l != null ? l.__composer : e.global.__composer;
740
- }
741
- }
742
- function ca(e) {
743
- const t = (s) => {
744
- const { instance: i, value: u } = s;
745
- if (!i || !i.$)
746
- throw k(R.UNEXPECTED_ERROR);
747
- const m = oa(e, i.$), b = Ce(u);
748
- return [
749
- Reflect.apply(m.t, m, [...Ae(b)]),
750
- m
751
- ];
752
- };
753
- return {
754
- created: (s, i) => {
755
- const [u, m] = t(i);
756
- ee && e.global === m && (s.__i18nWatcher = ne(m.locale, () => {
757
- i.instance && i.instance.$forceUpdate();
758
- })), s.__composer = m, s.textContent = u;
759
- },
760
- unmounted: (s) => {
761
- ee && s.__i18nWatcher && (s.__i18nWatcher(), s.__i18nWatcher = void 0, delete s.__i18nWatcher), s.__composer && (s.__composer = void 0, delete s.__composer);
762
- },
763
- beforeUpdate: (s, { value: i }) => {
764
- if (s.__composer) {
765
- const u = s.__composer, m = Ce(i);
766
- s.textContent = Reflect.apply(u.t, u, [
767
- ...Ae(m)
768
- ]);
769
- }
770
- },
771
- getSSRProps: (s) => {
772
- const [i] = t(s);
773
- return { textContent: i };
774
- }
775
- };
776
- }
777
- function Ce(e) {
778
- if (d(e))
779
- return { path: e };
780
- if (h(e)) {
781
- if (!("path" in e))
782
- throw k(R.REQUIRED_VALUE, "path");
783
- return e;
784
- } else
785
- throw k(R.INVALID_VALUE);
786
- }
787
- function Ae(e) {
788
- const { path: t, locale: c, args: l, choice: a, plural: r } = e, s = {}, i = l || {};
789
- return d(c) && (s.locale = c), G(a) && (s.plural = a), G(r) && (s.plural = r), [t, i, s];
790
- }
791
- function ia(e, t, ...c) {
792
- const l = h(c[0]) ? c[0] : {};
793
- (!L(l.globalInstall) || l.globalInstall) && ([Se.name, "I18nT"].forEach((r) => e.component(r, Se)), [De.name, "I18nN"].forEach((r) => e.component(r, De)), [Ue.name, "I18nD"].forEach((r) => e.component(r, Ue))), e.directive("t", ca(t));
794
- }
795
- const ua = /* @__PURE__ */ M("global-vue-i18n");
796
- function ka(e = {}) {
797
- const t = __VUE_I18N_LEGACY_API__ && L(e.legacy) ? e.legacy : __VUE_I18N_LEGACY_API__, c = L(e.globalInjection) ? e.globalInjection : !0, l = /* @__PURE__ */ new Map(), [a, r] = _a(e, t), s = /* @__PURE__ */ M("");
798
- function i(f) {
799
- return l.get(f) || null;
800
- }
801
- function u(f, E) {
802
- l.set(f, E);
803
- }
804
- function m(f) {
805
- l.delete(f);
806
- }
807
- const b = {
808
- // mode
809
- get mode() {
810
- return __VUE_I18N_LEGACY_API__ && t ? "legacy" : "composition";
811
- },
812
- // install plugin
813
- async install(f, ...E) {
814
- if (f.__VUE_I18N_SYMBOL__ = s, f.provide(f.__VUE_I18N_SYMBOL__, b), h(E[0])) {
815
- const v = E[0];
816
- b.__composerExtend = v.__composerExtend, b.__vueI18nExtend = v.__vueI18nExtend;
817
- }
818
- let T = null;
819
- !t && c && (T = Fa(f, b.global)), __VUE_I18N_FULL_INSTALL__ && ia(f, b, ...E), __VUE_I18N_LEGACY_API__ && t && f.mixin(aa(r, r.__composer, b));
820
- const O = f.unmount;
821
- f.unmount = () => {
822
- T && T(), b.dispose(), O();
823
- };
824
- },
825
- // global accessor
826
- get global() {
827
- return r;
828
- },
829
- dispose() {
830
- a.stop();
831
- },
832
- // @internal
833
- __instances: l,
834
- // @internal
835
- __getInstance: i,
836
- // @internal
837
- __setInstance: u,
838
- // @internal
839
- __deleteInstance: m
840
- };
841
- return b;
842
- }
843
- function fe(e = {}) {
844
- const t = X();
845
- if (t == null)
846
- throw k(R.MUST_BE_CALL_SETUP_TOP);
847
- if (!t.isCE && t.appContext.app != null && !t.appContext.app.__VUE_I18N_SYMBOL__)
848
- throw k(R.NOT_INSTALLED);
849
- const c = ma(t), l = ga(c), a = je(t), r = fa(e, a);
850
- if (r === "global")
851
- return Ge(l, e, a), l;
852
- if (r === "parent") {
853
- let u = ba(c, t, e.__useComponent);
854
- return u == null && (u = l), u;
855
- }
856
- const s = c;
857
- let i = s.__getInstance(t);
858
- if (i == null) {
859
- const u = P({}, e);
860
- "__i18n" in a && (u.__i18n = a.__i18n), l && (u.__root = l), i = _e(u), s.__composerExtend && (i[oe] = s.__composerExtend(i)), Ea(s, t, i), s.__setInstance(t, i);
861
- }
862
- return i;
863
- }
864
- function _a(e, t) {
865
- const c = wt(), l = __VUE_I18N_LEGACY_API__ && t ? c.run(() => ce(e)) : c.run(() => _e(e));
866
- if (l == null)
867
- throw k(R.UNEXPECTED_ERROR);
868
- return [c, l];
869
- }
870
- function ma(e) {
871
- const t = Bt(e.isCE ? ua : e.appContext.app.__VUE_I18N_SYMBOL__);
872
- if (!t)
873
- throw k(e.isCE ? R.NOT_INSTALLED_WITH_PROVIDE : R.UNEXPECTED_ERROR);
874
- return t;
875
- }
876
- function fa(e, t) {
877
- return Pt(e) ? "__i18n" in t ? "local" : "global" : e.useScope ? e.useScope : "local";
878
- }
879
- function ga(e) {
880
- return e.mode === "composition" ? e.global : e.global.__composer;
881
- }
882
- function ba(e, t, c = !1) {
883
- let l = null;
884
- const a = t.root;
885
- let r = da(t, c);
886
- for (; r != null; ) {
887
- const s = e;
888
- if (e.mode === "composition")
889
- l = s.__getInstance(r);
890
- else if (__VUE_I18N_LEGACY_API__) {
891
- const i = s.__getInstance(r);
892
- i != null && (l = i.__composer, c && l && !l[Ye] && (l = null));
893
- }
894
- if (l != null || a === r)
895
- break;
896
- r = r.parent;
897
- }
898
- return l;
899
- }
900
- function da(e, t = !1) {
901
- return e == null ? null : t && e.vnode.ctx || e.parent;
902
- }
903
- function Ea(e, t, c) {
904
- Xt(() => {
905
- }, t), Jt(() => {
906
- const l = c;
907
- e.__deleteInstance(t);
908
- const a = l[oe];
909
- a && (a(), delete l[oe]);
910
- }, t);
911
- }
912
- const Ia = [
913
- "locale",
914
- "fallbackLocale",
915
- "availableLocales"
916
- ], We = ["t", "rt", "d", "n", "tm", "te"];
917
- function Fa(e, t) {
918
- const c = /* @__PURE__ */ Object.create(null);
919
- return Ia.forEach((a) => {
920
- const r = Object.getOwnPropertyDescriptor(t, a);
921
- if (!r)
922
- throw k(R.UNEXPECTED_ERROR);
923
- const s = jt(r.value) ? {
924
- get() {
925
- return r.value.value;
926
- },
927
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
928
- set(i) {
929
- r.value.value = i;
930
- }
931
- } : {
932
- get() {
933
- return r.get && r.get();
934
- }
935
- };
936
- Object.defineProperty(c, a, s);
937
- }), e.config.globalProperties.$i18n = c, We.forEach((a) => {
938
- const r = Object.getOwnPropertyDescriptor(t, a);
939
- if (!r || !r.value)
940
- throw k(R.UNEXPECTED_ERROR);
941
- Object.defineProperty(e.config.globalProperties, `$${a}`, r);
942
- }), () => {
943
- delete e.config.globalProperties.$i18n, We.forEach((a) => {
944
- delete e.config.globalProperties[`$${a}`];
945
- });
946
- };
947
- }
948
- const La = /* @__PURE__ */ ie({
949
- /* eslint-disable */
950
- name: "i18n-d",
951
- props: P({
952
- value: {
953
- type: [Number, Date],
954
- required: !0
955
- },
956
- format: {
957
- type: [String, Object]
958
- }
959
- }, me),
960
- /* eslint-enable */
961
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
962
- setup(e, t) {
963
- const c = e.i18n || fe({
964
- useScope: e.scope,
965
- __useComponent: !0
966
- });
967
- return Xe(e, t, Ct, (...l) => (
968
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
969
- c[se](...l)
970
- ));
971
- }
972
- }), Ue = La;
973
- Qt();
974
- At(xt);
975
- Wt($t);
976
- Ut(xe);
977
- if (__INTLIFY_PROD_DEVTOOLS__) {
978
- const e = j();
979
- e.__INTLIFY__ = !0, Vt(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
980
- }
981
- export {
982
- ka as c,
983
- fe as u
984
- };