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

1 line
22 KiB
JavaScript
Raw Normal View History

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var shared=require("@intlify/shared"),coreBase=require("@intlify/core-base"),vue=require("vue");const VERSION="9.1.6",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"},DEVTOOLS_META="__INTLIFY_META__",TransrateVNodeSymbol=shared.makeSymbol("__transrateVNode"),DatetimePartsSymbol=shared.makeSymbol("__datetimeParts"),NumberPartsSymbol=shared.makeSymbol("__numberParts"),EnableEmitter=shared.makeSymbol("__enableEmitter"),DisableEmitter=shared.makeSymbol("__disableEmitter"),SetPluralRulesSymbol=shared.makeSymbol("__setPluralRules");shared.makeSymbol("__intlifyMeta");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]:{}};if(shared.isArray(r)&&r.forEach(({locale:e,resource:a})=>{e?(s[e]=s[e]||{},deepCopy(a,s[e])):deepCopy(a,s)}),a.flatJson)for(const e in s)shared.hasOwn(s,e)&&coreBase.handleFlatJson(s[e]);return s}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)shared.hasOwn(e,t)&&(isNotObjectOrIsArray(e[t])||isNotObjectOrIsArray(a[t])?a[t]=e[t]:deepCopy(e[t],a[t]))}const getMetaInfo=()=>{const e=vue.getCurrentInstance();return e&&e.type[DEVTOOLS_META]?{[DEVTOOLS_META]:e.type[DEVTOOLS_META]}:null};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,u=a?a.fallbackWarn:!shared.isBoolean(e.fallbackWarn)&&!shared.isRegExp(e.fallbackWarn)||e.fallbackWarn,m=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,h=!shared.isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,f=!!e.escapeParameter;const _=a?a.modifiers:shared.isPlainObject(e.modifiers)?e.modifiers:{};let v,y=e.pluralRules||a&&a.pluralRules;v=coreBase.createCoreContext({version:VERSION,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:u,fallbackFormat:g,unresolving:!0,postTranslation:null===p?void 0:p,warnHtmlMessage:h,escapeParameter:f,__datetimeFormatters:shared.isPlainObject(v)?v.__datetimeFormatters:void 0,__numberFormatters:shared.isPlainObject(v)?v.__numberFormatters:void 0,__v_emitter:shared.isPlainObject(v)?v.__v_emitter:void 0,__meta:{framework:"vue"}}),core