LocalCDN-Firefox-Chrome-Brave/resources/vue-i18n/9.0.0/vue-i18n.min.jsm

1 line
21 KiB
JavaScript

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var shared=require("@intlify/shared"),coreBase=require("@intlify/core-base"),vue=require("vue");const VERSION="9.0.0";function initDev(){shared.getGlobalThis().__INTLIFY__=!0}const warnMessages={6:"Fall back to {type} '{key}' with root locale.",7:"Not supported 'preserve'.",8:"Not supported 'formatter'.",9:"Not supported 'preserveDirectiveContent'.",10:"Not supported 'getChoiceIndex'.",11:"Component name legacy compatible: '{name}' -> 'i18n'",12:"Not found parent scope. use the global scope."};function getWarnMessage(e,...a){return shared.format(warnMessages[e],...a)}function createI18nError(e,...a){return coreBase.createCompileError(e,null,{messages:errorMessages,args:a})}const errorMessages={14:"Unexpected return type in composer",15:"Invalid argument",16:"Must be called at the top of a `setup` function",17:"Need to install with `app.use` function",22:"Unexpected error",18:"Not available in legacy mode",19:"Required in value: {0}",20:"Invalid value",21:"Cannot setup vue-devtools plugin"},TransrateVNodeSymbol=shared.makeSymbol("__transrateVNode"),DatetimePartsSymbol=shared.makeSymbol("__datetimeParts"),NumberPartsSymbol=shared.makeSymbol("__numberParts"),EnableEmitter=shared.makeSymbol("__enableEmitter"),DisableEmitter=shared.makeSymbol("__disableEmitter"),SetPluralRulesSymbol=shared.makeSymbol("__setPluralRules");let composerID=0;function defineCoreMissingHandler(e){return(a,t,r,s)=>e(t,r,vue.getCurrentInstance()||void 0,s)}function getLocaleMessages(e,a){const{messages:t,__i18n:r}=a,s=shared.isPlainObject(t)?t:shared.isArray(r)?{}:{[e]:{}};return shared.isArray(r)&&r.forEach(({locale:e,resource:a})=>{e?(s[e]=s[e]||{},deepCopy(a,s[e])):deepCopy(a,s)}),s}const hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(e,a){return hasOwnProperty.call(e,a)}const isNotObjectOrIsArray=e=>!shared.isObject(e)||shared.isArray(e);function deepCopy(e,a){if(isNotObjectOrIsArray(e)||isNotObjectOrIsArray(a))throw createI18nError(20);for(const t in e)hasOwn(e,t)&&(isNotObjectOrIsArray(e[t])||isNotObjectOrIsArray(a[t])?a[t]=e[t]:deepCopy(e[t],a[t]))}function createComposer(e={}){const{__root:a}=e,t=void 0===a;let r=!shared.isBoolean(e.inheritLocale)||e.inheritLocale;const s=vue.ref(a&&r?a.locale.value:shared.isString(e.locale)?e.locale:"en-US"),n=vue.ref(a&&r?a.fallbackLocale.value:shared.isString(e.fallbackLocale)||shared.isArray(e.fallbackLocale)||shared.isPlainObject(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:s.value),o=vue.ref(getLocaleMessages(s.value,e)),l=vue.ref(shared.isPlainObject(e.datetimeFormats)?e.datetimeFormats:{[s.value]:{}}),i=vue.ref(shared.isPlainObject(e.numberFormats)?e.numberFormats:{[s.value]:{}});let c=a?a.missingWarn:!shared.isBoolean(e.missingWarn)&&!shared.isRegExp(e.missingWarn)||e.missingWarn,m=a?a.fallbackWarn:!shared.isBoolean(e.fallbackWarn)&&!shared.isRegExp(e.fallbackWarn)||e.fallbackWarn,u=a?a.fallbackRoot:!shared.isBoolean(e.fallbackRoot)||e.fallbackRoot,g=!!e.fallbackFormat,d=shared.isFunction(e.missing)?e.missing:null,b=shared.isFunction(e.missing)?defineCoreMissingHandler(e.missing):null,p=shared.isFunction(e.postTranslation)?e.postTranslation:null,f=!shared.isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,h=!!e.escapeParameter;const _=a?a.modifiers:shared.isPlainObject(e.modifiers)?e.modifiers:{};let v,y=e.pluralRules||a&&a.pluralRules;function F(){return coreBase.createCoreContext({locale:s.value,fallbackLocale:n.value,messages:o.value,datetimeFormats:l.value,numberFormats:i.value,modifiers:_,pluralRules:y,missing:null===b?void 0:b,missingWarn:c,fallbackWarn:m,fallbackFormat:g,unresolving:!0,postTranslation:null===p?void 0:p,warnHtmlMessage:f,escapeParameter:h,__datetimeFormatters:shared.isPlainObject(v)?v.__datetimeFormatters:void 0,__numberFormatters:shared.isPlainObject(v)?v.__numberFormatters:void 0,__emitter:shared.isPlainObject(v)?v.__emitter:void 0})}v=F(),coreBase.updateFallbackLocale(v,s.value,n.value);const k=vue.computed({get:()=>s.value,set:e=>{s.value=e,v.locale=s.value}}),M=vue.computed({get:()=>n.value,set:e=>{n.value=e,v.fallbackLocale=n.value,coreBase.updateFallbackLocale(v,s.value,e)}}),I=vue.computed(()=>o.value),S=vue.computed(()=>l.value),O=vue.computed(()=>i.value);function E(e,t,r,s,n,o){const l=F(),i=e(l);if(shared.isNumber(i)&&i===coreBase.NOT_REOSLVED){const e=t();if(a){u||shared.warn(getWarnMessage(6,{key:e,type:r}));{const{__emitter:a}=l;a&&a.emit("fallback",{type:r,key:e,to:"global",groupId:`${r}:${e}`})}}return a&&u?s(a):n(e)}if(o(i))return i;throw createI18nError(14)}const T={normalize:function(e){return e.map(e=>shared.isString(e)?vue.createVNode(vue.Text,null,e,0):e)},interpolate:e=>e,type:"vnode"};function L(e){return o.value[e]||{}}composerID++,a&&(vue.watch(a.locale,e=>{r&&(s.value=e,v.locale=e,coreBase.updateFallbackLocale(v,s.value,n.value))}),vue.watch(a.fallbackLocale,e=>{r&&(n.value=e,v.fallbackLocale=e,coreBase.updateFallbackLocale(v,s.value,n.value))}));const P={id:composerID,locale:k,fallbackLocale:M,get inheritLocale(){return r},set inheritLocale(e){r=e,e&&a&&(s.value=a.locale.value,n.value=a.fallbackLocale.value,coreBase.updateFallbackLocale(v,s.value,n.value))},get availableLocales(){return Object.keys(o.value).sort()},messages:I,datetimeFormats:S,numberFormats:O,get modifiers(){return _},get pluralRules(){return y||{}},get isGlobal(){return t},get missingWarn(){return c},set missingWarn(e){c=e,v.missingWarn=c},get fallbackWarn(){return m},set fallbackWarn(e){m=e,v.fallbackWarn=m},get fallbackRoot(){return u},set fallbackRoot(e){u=e},get fallbackFormat(){return g},set fallbackFormat(e){g=e,v.fallbackFormat=g},get warnHtmlMessage(){return f},set warnHtmlMessage(e){f=e,v.warnHtmlMessage=e},get escapeParameter(){return h},set escapeParameter(e){h=e,v.escapeParameter=e},t:function(...e){return E(a=>coreBase.translate(a,...e),()=>coreBase.parseTranslateArgs(...e)[0],"translate",a=>a.t(...e),e=>e,e=>shared.isString(e))},d:function(...e){return E(a=>coreBase.datetime(a,...e),()=>coreBase.parseDateTimeArgs(...e)[0],"datetime format",a=>a.d(...e),()=>coreBase.MISSING_RESOLVE_VALUE,e=>shared.isString(e))},n:function(...e){return E(a=>coreBase.number(a,...e),()=>coreBase.parseNumberArgs(...e)[0],"number format",a=>a.n(...e),()=>coreBase.MISSING_RESOLVE_VALUE,e=>shared.isString(e))},te:function(e,a){const t=L(shared.isString(a)?a:s.value);return null!==coreBase.resolveValue(t,e)},tm:function(e){const t=o.value[s.value]||{},r=coreBase.resolveValue(t,e);return null!=r?r:a&&a.tm(e)||{}},getLocaleMessage:L,setLocaleMessage:function(e,a){o.value[e]=a,v.messages=o.value},mergeLocaleMessage:function(e,a){o.value[e]=o.value[e]||{},deepCopy(a,o.value[e]),v.messages=o.value},getDateTimeFormat:function(e){return l.value[e]||{}},setDateTimeFormat:function(e,a){l.value[e]=a,v.datetimeFormats=l.value,coreBase.clearDateTimeFormat(v,e,a)},mergeDateTimeFormat:function(e,a){l.value[e]=Object.assign(l.value[e]||{},a),v.datetimeFormats=l.value,coreBase.clearDateTimeFormat(v,e,a)},getNumberFormat:function(e){return i.value[e]||{}},setNumberFormat:function(e,a){i.value[e]=a,v.numberFormats=i.value,coreBase.clearNumberFormat(v,e,a)},mergeNumberFormat:function(e,a){i.value[e]=Object.assign(i.value[e]||{},a),v.numberFormats=i.value,coreBase.clearNumberFormat(v,e,a)},getPostTranslationHandler:function(){return shared.isFunction(p)?p:null},setPostTranslationHandler:function(e){p=e,v.postTranslation=e},getMissingHandler:function(){return d},setMissingHandler:function(e){null!==e&&(b=defineCoreMissingHandler(e)),d=e,v.missing=b},[TransrateVNodeSymbol]:function(...e){return E(a=>{let t;const r=a;try{r.processor=T,t=coreBase.translate(r,...e)}finally{r.processor=null}return t},()=>coreBase.parseTranslateArgs(...e)[0],"translate",a=>a[TransrateVNodeSymbol](...e),e=>[vue.createVNode(vue.Text,null,e,0)],e=>shared.isArray(e))},[NumberPartsSymbol]:function(...e){return E(a=>coreBase.number(a,...e),()=>coreBase.parseNumberArgs(...e)[0],"number format",a=>a[NumberPartsSymbol](...e),()=>[],e=>shared.isString(e)||shared.isArray(e))},[DatetimePartsSymbol]:function(...e){return E(a=>coreBase.datetime(a,...e),()=>coreBase.parseDateTimeArgs(...e)[0],"datetime format",a=>a[DatetimePartsSymbol](...e),()=>[],e=>shared.isString(e)||shared.isArray(e))},[SetPluralRulesSymbol]:function(e){y=e,v.pluralRules=y}};return P[EnableEmitter]=(e=>{v.__emitter=e}),P[DisableEmitter]=(()=>{v.__emitter=void 0}),P}function convertComposerOptions(e){const a=shared.isString(e.locale)?e.locale:"en-US",t=shared.isString(e.fallbackLocale)||shared.isArray(e.fallbackLocale)||shared.isPlainObject(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:a,r=shared.isFunction(e.missing)?e.missing:void 0,s=!shared.isBoolean(e.silentTranslationWarn)&&!shared.isRegExp(e.silentTranslationWarn)||!e.silentTranslationWarn,n=!shared.isBoolean(e.silentFallbackWarn)&&!shared.isRegExp(e.silentFallbackWarn)||!e.silentFallbackWarn,o=!shared.isBoolean(e.fallbackRoot)||e.fallbackRoot,l=!!e.formatFallbackMessages,i=shared.isPlainObject(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,m=shared.isFunction(e.postTranslation)?e.postTranslation:void 0,u=!shared.isString(e.warnHtmlInMessage)||"off"!==e.warnHtmlInMessage,g=!!e.escapeParameterHtml,d=!shared.isBoolean(e.sync)||e.sync;e.formatter&&shared.warn(getWarnMessage(8)),e.preserveDirectiveContent&&shared.warn(getWarnMessage(9));let b=e.messages;if(shared.isPlainObject(e.sharedMessages)){const a=e.sharedMessages;b=Object.keys(a).reduce((e,t)=>{const r=e[t]||(e[t]={});return Object.assign(r,a[t]),e},b||{})}const{__i18n:p,__root:f}=e;return{locale:a,fallbackLocale:t,messages:b,datetimeFormats:e.datetimeFormats,numberFormats:e.numberFormats,missing:r,missingWarn:s,fallbackWarn:n,fallbackRoot:o,fallbackFormat:l,modifiers:i,pluralRules:c,postTranslation:m,warnHtmlMessage:u,escapeParameter:g,inheritLocale:d,__i18n:p,__root:f}}function createVueI18n(e={}){const a=createComposer(convertComposerOptions(e)),t={id:a.id,get locale(){return a.locale.value},set locale(e){a.locale.value=e},get fallbackLocale(){return a.fallbackLocale.value},set fallbackLocale(e){a.fallbackLocale.value=e},get messages(){return a.messages.value},get datetimeFormats(){return a.datetimeFormats.value},get numberFormats(){return a.numberFormats.value},get availableLocales(){return a.availableLocales},get formatter(){return shared.warn(getWarnMessage(8)),{interpolate:()=>[]}},set formatter(e){shared.warn(getWarnMessage(8))},get missing(){return a.getMissingHandler()},set missing(e){a.setMissingHandler(e)},get silentTranslationWarn(){return shared.isBoolean(a.missingWarn)?!a.missingWarn:a.missingWarn},set silentTranslationWarn(e){a.missingWarn=shared.isBoolean(e)?!e:e},get silentFallbackWarn(){return shared.isBoolean(a.fallbackWarn)?!a.fallbackWarn:a.fallbackWarn},set silentFallbackWarn(e){a.fallbackWarn=shared.isBoolean(e)?!e:e},get modifiers(){return a.modifiers},get formatFallbackMessages(){return a.fallbackFormat},set formatFallbackMessages(e){a.fallbackFormat=e},get postTranslation(){return a.getPostTranslationHandler()},set postTranslation(e){a.setPostTranslationHandler(e)},get sync(){return a.inheritLocale},set sync(e){a.inheritLocale=e},get warnHtmlInMessage(){return a.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(e){a.warnHtmlMessage="off"!==e},get escapeParameterHtml(){return a.escapeParameter},set escapeParameterHtml(e){a.escapeParameter=e},get preserveDirectiveContent(){return shared.warn(getWarnMessage(9)),!0},set preserveDirectiveContent(e){shared.warn(getWarnMessage(9))},get pluralizationRules(){return a.pluralRules||{}},__composer:a,t(...e){const[t,r,s]=e,n={};let o=null,l=null;if(!shared.isString(t))throw createI18nError(15);const i=t;return shared.isString(r)?n.locale=r:shared.isArray(r)?o=r:shared.isPlainObject(r)&&(l=r),shared.isArray(s)?o=s:shared.isPlainObject(s)&&(l=s),a.t(i,o||l||{},n)},tc(...e){const[t,r,s]=e,n={plural:1};let o=null,l=null;if(!shared.isString(t))throw createI18nError(15);const i=t;return shared.isString(r)?n.locale=r:shared.isNumber(r)?n.plural=r:shared.isArray(r)?o=r:shared.isPlainObject(r)&&(l=r),shared.isString(s)?n.locale=s:shared.isArray(s)?o=s:shared.isPlainObject(s)&&(l=s),a.t(i,o||l||{},n)},te:(e,t)=>a.te(e,t),tm:e=>a.tm(e),getLocaleMessage:e=>a.getLocaleMessage(e),setLocaleMessage(e,t){a.setLocaleMessage(e,t)},mergeLocaleMessage(e,t){a.mergeLocaleMessage(e,t)},d:(...e)=>a.d(...e),getDateTimeFormat:e=>a.getDateTimeFormat(e),setDateTimeFormat(e,t){a.setDateTimeFormat(e,t)},mergeDateTimeFormat(e,t){a.mergeDateTimeFormat(e,t)},n:(...e)=>a.n(...e),getNumberFormat:e=>a.getNumberFormat(e),setNumberFormat(e,t){a.setNumberFormat(e,t)},mergeNumberFormat(e,t){a.mergeNumberFormat(e,t)},getChoiceIndex:(e,a)=>(shared.warn(getWarnMessage(10)),-1),__onComponentInstanceCreated(a){const{componentInstanceCreatedListener:r}=e;r&&r(a,t)},__enableEmitter:e=>{const t=a;t[EnableEmitter]&&t[EnableEmitter](e)},__disableEmitter:()=>{const e=a;e[DisableEmitter]&&e[DisableEmitter]()}};return t}const baseFormatProps={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>"parent"===e||"global"===e,default:"parent"}},Translation={name:"i18n-t",props:{...baseFormatProps,keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>shared.isNumber(e)||!isNaN(e)}},setup(e,a){const{slots:t,attrs:r}=a,s=useI18n({useScope:e.scope}),n=Object.keys(t).filter(e=>"_"!==e);return()=>{const t={};e.locale&&(t.locale=e.locale),void 0!==e.plural&&(t.plural=shared.isString(e.plural)?+e.plural:e.plural);const o=getInterpolateArg(a,n),l=s[TransrateVNodeSymbol](e.keypath,o,t);return shared.isString(e.tag)?vue.h(e.tag,{...r},l):shared.isObject(e.tag)?vue.h(e.tag,{...r},l):vue.h(vue.Fragment,{...r},l)}}};function getInterpolateArg({slots:e},a){return 1===a.length&&"default"===a[0]?e.default?e.default():[]:a.reduce((a,t)=>{const r=e[t];return r&&(a[t]=r()),a},{})}function renderFormatter(e,a,t,r){const{slots:s,attrs:n}=a;return()=>{const a={part:!0};let o={};e.locale&&(a.locale=e.locale),shared.isString(e.format)?a.key=e.format:shared.isObject(e.format)&&(shared.isString(e.format.key)&&(a.key=e.format.key),o=Object.keys(e.format).reduce((a,r)=>t.includes(r)?Object.assign({},a,{[r]:e.format[r]}):a,{}));const l=r(...[e.value,a,o]);let i=[a.key];return shared.isArray(l)?i=l.map((e,a)=>{const t=s[e.type];return t?t({[e.type]:e.value,index:a,parts:l}):[e.value]}):shared.isString(l)&&(i=[l]),shared.isString(e.tag)?vue.h(e.tag,{...n},i):shared.isObject(e.tag)?vue.h(e.tag,{...n},i):vue.h(vue.Fragment,{...n},i)}}const NUMBER_FORMAT_KEYS=["localeMatcher","style","unit","unitDisplay","currency","currencyDisplay","useGrouping","numberingSystem","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","notation","formatMatcher"],NumberFormat={name:"i18n-n",props:{...baseFormatProps,value:{type:Number,required:!0},format:{type:[String,Object]}},setup(e,a){const t=useI18n({useScope:"parent"});return renderFormatter(e,a,NUMBER_FORMAT_KEYS,(...e)=>t[NumberPartsSymbol](...e))}},DATETIME_FORMAT_KEYS=["dateStyle","timeStyle","fractionalSecondDigits","calendar","dayPeriod","numberingSystem","localeMatcher","timeZone","hour12","hourCycle","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"],DatetimeFormat={name:"i18n-d",props:{...baseFormatProps,value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},setup(e,a){const t=useI18n({useScope:"parent"});return renderFormatter(e,a,DATETIME_FORMAT_KEYS,(...e)=>t[DatetimePartsSymbol](...e))}};function getComposer(e,a){const t=e;if("composition"===e.mode)return t.__getInstance(a)||e.global;{const r=t.__getInstance(a);return null!=r?r.__composer:e.global.__composer}}function vTDirective(e){const a=(a,{instance:t,value:r,modifiers:s})=>{if(!t||!t.$)throw createI18nError(22);const n=getComposer(e,t.$);s.preserve&&shared.warn(getWarnMessage(7));const o=parseValue(r);a.textContent=n.t(...makeParams(o))};return{beforeMount:a,beforeUpdate:a}}function parseValue(e){if(shared.isString(e))return{path:e};if(shared.isPlainObject(e)){if(!("path"in e))throw createI18nError(19,"path");return e}throw createI18nError(20)}function makeParams(e){const{path:a,locale:t,args:r,choice:s,plural:n}=e,o={},l=r||{};return shared.isString(t)&&(o.locale=t),shared.isNumber(s)&&(o.plural=s),shared.isNumber(n)&&(o.plural=n),[a,l,o]}function apply(e,a,...t){const r=shared.isPlainObject(t[0])?t[0]:{},s=!!r.useI18nComponentName,n=!shared.isBoolean(r.globalInstall)||r.globalInstall;n&&s&&shared.warn(getWarnMessage(11,{name:Translation.name})),n&&(e.component(s?"i18n":Translation.name,Translation),e.component(NumberFormat.name,NumberFormat),e.component(DatetimeFormat.name,DatetimeFormat)),e.directive("t",vTDirective(a))}function defineMixin(e,a,t){return{beforeCreate(){const r=vue.getCurrentInstance();if(!r)throw createI18nError(22);const s=this.$options;if(s.i18n){const t=s.i18n;s.__i18n&&(t.__i18n=s.__i18n),t.__root=a,this===this.$root?this.$i18n=mergeToRoot(e,t):this.$i18n=createVueI18n(t)}else s.__i18n?this===this.$root?this.$i18n=mergeToRoot(e,s):this.$i18n=createVueI18n({__i18n:s.__i18n,__root:a}):this.$i18n=e;e.__onComponentInstanceCreated(this.$i18n),t.__setInstance(r,this.$i18n),this.$t=((...e)=>this.$i18n.t(...e)),this.$tc=((...e)=>this.$i18n.tc(...e)),this.$te=((e,a)=>this.$i18n.te(e,a)),this.$d=((...e)=>this.$i18n.d(...e)),this.$n=((...e)=>this.$i18n.n(...e)),this.$tm=(e=>this.$i18n.tm(e))},mounted(){},beforeUnmount(){const e=vue.getCurrentInstance();if(!e)throw createI18nError(22);delete this.$t,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,t.__deleteInstance(e),delete this.$i18n}}}function mergeToRoot(e,a){e.locale=a.locale||e.locale,e.fallbackLocale=a.fallbackLocale||e.fallbackLocale,e.missing=a.missing||e.missing,e.silentTranslationWarn=a.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=a.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=a.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=a.postTranslation||e.postTranslation,e.warnHtmlInMessage=a.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=a.escapeParameterHtml||e.escapeParameterHtml,e.sync=a.sync||e.sync,e.__composer[SetPluralRulesSymbol](a.pluralizationRules||e.pluralizationRules);const t=getLocaleMessages(e.locale,{messages:a.messages,__i18n:a.__i18n});return Object.keys(t).forEach(a=>e.mergeLocaleMessage(a,t[a])),a.datetimeFormats&&Object.keys(a.datetimeFormats).forEach(t=>e.mergeDateTimeFormat(t,a.datetimeFormats[t])),a.numberFormats&&Object.keys(a.numberFormats).forEach(t=>e.mergeNumberFormat(t,a.numberFormats[t])),e}function createI18n(e={}){const a=!shared.isBoolean(e.legacy)||e.legacy,t=!!e.globalInjection,r=new Map,s=a?createVueI18n(e):createComposer(e),n=shared.makeSymbol("vue-i18n"),o={get mode(){return a?"legacy":"composition"},async install(e,...r){e.__VUE_I18N_SYMBOL__=n,e.provide(e.__VUE_I18N_SYMBOL__,o),!a&&t&&injectGlobalFields(e,o.global),apply(e,o,...r),a&&e.mixin(defineMixin(s,s.__composer,o))},get global(){return s},__instances:r,__getInstance:e=>r.get(e)||null,__setInstance(e,a){r.set(e,a)},__deleteInstance(e){r.delete(e)}};return o}function useI18n(e={}){const a=vue.getCurrentInstance();if(null==a)throw createI18nError(16);if(!a.appContext.app.__VUE_I18N_SYMBOL__)throw createI18nError(17);const t=vue.inject(a.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw createI18nError(22);const r="composition"===t.mode?t.global:t.global.__composer,s=shared.isEmptyObject(e)?"__i18n"in a.type?"local":"global":e.useScope?e.useScope:"local";if("global"===s){let t=shared.isObject(e.messages)?e.messages:{};"__i18nGlobal"in a.type&&(t=getLocaleMessages(r.locale.value,{messages:t,__i18n:a.type.__i18nGlobal}));const s=Object.keys(t);if(s.length&&s.forEach(e=>{r.mergeLocaleMessage(e,t[e])}),shared.isObject(e.datetimeFormats)){const a=Object.keys(e.datetimeFormats);a.length&&a.forEach(a=>{r.mergeDateTimeFormat(a,e.datetimeFormats[a])})}if(shared.isObject(e.numberFormats)){const a=Object.keys(e.numberFormats);a.length&&a.forEach(a=>{r.mergeNumberFormat(a,e.numberFormats[a])})}return r}if("parent"===s){let e=getComposer$1(t,a);return null==e&&(shared.warn(getWarnMessage(12)),e=r),e}if("legacy"===t.mode)throw createI18nError(18);const n=t;let o=n.__getInstance(a);if(null==o){const t=a.type,s={...e};t.__i18n&&(s.__i18n=t.__i18n),r&&(s.__root=r),o=createComposer(s),setupLifeCycle(n,a),n.__setInstance(a,o)}return o}function getComposer$1(e,a){let t=null;const r=a.root;let s=a.parent;for(;null!=s;){const a=e;if("composition"===e.mode)t=a.__getInstance(s);else{const e=a.__getInstance(s);null!=e&&(t=e.__composer)}if(null!=t)break;if(r===s)break;s=s.parent}return t}function setupLifeCycle(e,a,t){vue.onMounted(()=>{},a),vue.onUnmounted(()=>{e.__deleteInstance(a)},a)}const globalExportProps=["locale","fallbackLocale","availableLocales"],globalExportMethods=["t","d","n","tm"];function injectGlobalFields(e,a){const t=Object.create(null);globalExportProps.forEach(e=>{const r=Object.getOwnPropertyDescriptor(a,e);if(!r)throw createI18nError(22);const s=vue.isRef(r.value)?{get:()=>r.value.value,set(e){r.value.value=e}}:{get:()=>r.get&&r.get()};Object.defineProperty(t,e,s)}),e.config.globalProperties.$i18n=t,globalExportMethods.forEach(t=>{const r=Object.getOwnPropertyDescriptor(a,t);if(!r)throw createI18nError(22);Object.defineProperty(e.config.globalProperties,`$${t}`,r)})}coreBase.registerMessageCompiler(coreBase.compileToFunction),initDev(),exports.DatetimeFormat=DatetimeFormat,exports.NumberFormat=NumberFormat,exports.Translation=Translation,exports.VERSION="9.0.0",exports.createI18n=createI18n,exports.useI18n=useI18n,exports.vTDirective=vTDirective;