vue-i18n.min.js 19.4 KB
/*!
 * vue-i18n v8.9.0 
 * (c) 2019 kazuya kawaguchi
 * Released under the MIT License.
 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueI18n=e()}(this,function(){"use strict";function t(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}function e(t){return null!==t&&"object"==typeof t}function n(t){return L.call(t)===O}function r(t){return null===t||void 0===t}function i(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=null,i=null;return 1===t.length?e(t[0])||Array.isArray(t[0])?i=t[0]:"string"==typeof t[0]&&(r=t[0]):2===t.length&&("string"==typeof t[0]&&(r=t[0]),(e(t[1])||Array.isArray(t[1]))&&(i=t[1])),{locale:r,params:i}}function a(t){return JSON.parse(JSON.stringify(t))}function o(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function s(t,e){return C.call(t,e)}function l(t){for(var n=arguments,r=Object(t),i=1;i<arguments.length;i++){var a=n[i];if(void 0!==a&&null!==a){var o=void 0;for(o in a)s(a,o)&&(e(a[o])?r[o]=l(r[o],a[o]):r[o]=a[o])}}return r}function c(t,n){if(t===n)return!0;var r=e(t),i=e(n);if(!r||!i)return!r&&!i&&String(t)===String(n);try{var a=Array.isArray(t),o=Array.isArray(n);if(a&&o)return t.length===n.length&&t.every(function(t,e){return c(t,n[e])});if(a||o)return!1;var s=Object.keys(t),l=Object.keys(n);return s.length===l.length&&s.every(function(e){return c(t[e],n[e])})}catch(t){return!1}}function u(t){t.prototype.hasOwnProperty("$i18n")||Object.defineProperty(t.prototype,"$i18n",{get:function(){return this._i18n}}),t.prototype.$t=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[t,r.locale,r._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];var i=this.$i18n;return i._tc.apply(i,[t,i.locale,i._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}}function f(t,e,n){m(t,n)&&v(t,e,n)}function h(t,e,n,r){if(m(t,n)){var i=n.context.$i18n;_(t,n)&&c(e.value,e.oldValue)&&c(t._localeMessage,i.getLocaleMessage(i.locale))||v(t,e,n)}}function p(e,n,r,i){if(!r.context)return void t("Vue instance does not exists in VNode context");var a=r.context.$i18n||{};n.modifiers.preserve||a.preserveDirectiveContent||(e.textContent=""),e._vt=void 0,delete e._vt,e._locale=void 0,delete e._locale,e._localeMessage=void 0,delete e._localeMessage}function m(e,n){var r=n.context;return r?!!r.$i18n||(t("VueI18n instance does not exists in Vue instance"),!1):(t("Vue instance does not exists in VNode context"),!1)}function _(t,e){var n=e.context;return t._locale===n.$i18n.locale}function v(e,n,r){var i,a,o=n.value,s=g(o),l=s.path,c=s.locale,u=s.args,f=s.choice;if(!l&&!c&&!u)return void t("value type not supported");if(!l)return void t("`path` is required in v-t directive");var h=r.context;e._vt=e.textContent=f?(i=h.$i18n).tc.apply(i,[l,f].concat(y(c,u))):(a=h.$i18n).t.apply(a,[l].concat(y(c,u))),e._locale=h.$i18n.locale,e._localeMessage=h.$i18n.getLocaleMessage(h.$i18n.locale)}function g(t){var e,r,i,a;return"string"==typeof t?e=t:n(t)&&(e=t.path,r=t.locale,i=t.args,a=t.choice),{path:e,locale:r,args:i,choice:a}}function y(t,e){var r=[];return t&&r.push(t),e&&(Array.isArray(e)||n(e))&&r.push(e),r}function d(t){d.installed=!0,T=t;T.version&&Number(T.version.split(".")[0]);u(T),T.mixin(W),T.directive("t",{bind:f,update:h,unbind:p}),T.component(M.name,M),T.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}function b(t){for(var e=[],n=0,r="";n<t.length;){var i=t[n++];if("{"===i){r&&e.push({type:"text",value:r}),r="";var a="";for(i=t[n++];void 0!==i&&"}"!==i;)a+=i,i=t[n++];var o="}"===i,s=A.test(a)?"list":o&&N.test(a)?"named":"unknown";e.push({value:a,type:s})}else"%"===i?"{"!==t[n]&&(r+=i):r+=i}return r&&e.push({type:"text",value:r}),e}function $(t,n){var r=[],i=0,a=Array.isArray(n)?"list":e(n)?"named":"unknown";if("unknown"===a)return r;for(;i<t.length;){var o=t[i];switch(o.type){case"text":r.push(o.value);break;case"list":r.push(n[parseInt(o.value,10)]);break;case"named":"named"===a&&r.push(n[o.value])}i++}return r}function F(t){return B.test(t)}function k(t){var e=t.charCodeAt(0);return e!==t.charCodeAt(t.length-1)||34!==e&&39!==e?t:t.slice(1,-1)}function w(t){if(void 0===t||null===t)return"eof";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return"ident"}function D(t){var e=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(F(e)?k(e):"*"+e)}function x(t){var e,n,r,i,a,o,s,l=[],c=-1,u=z,f=0,h=[];for(h[R]=function(){void 0!==n&&(l.push(n),n=void 0)},h[I]=function(){void 0===n?n=r:n+=r},h[V]=function(){h[I](),f++},h[S]=function(){if(f>0)f--,u=P,h[I]();else{if(f=0,!1===(n=D(n)))return!1;h[R]()}};null!==u;)if(c++,"\\"!==(e=t[c])||!function(){var e=t[c+1];if(u===E&&"'"===e||u===U&&'"'===e)return c++,r="\\"+e,h[I](),!0}()){if(i=w(e),s=G[u],(a=s[i]||s.else||q)===q)return;if(u=a[0],(o=h[a[1]])&&(r=a[2],r=void 0===r?e:r,!1===o()))return;if(u===J)return l}}var T,L=Object.prototype.toString,O="[object Object]",C=Object.prototype.hasOwnProperty,W={beforeCreate:function(){var t=this.$options;if(t.i18n=t.i18n||(t.__i18n?{}:null),t.i18n){if(t.i18n instanceof et){if(t.__i18n)try{var e={};t.__i18n.forEach(function(t){e=l(e,JSON.parse(t))}),Object.keys(e).forEach(function(n){t.i18n.mergeLocaleMessage(n,e[n])})}catch(t){}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData(),this._i18n.subscribeDataChanging(this),this._subscribing=!0}else if(n(t.i18n)){if(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof et&&(t.i18n.root=this.$root,t.i18n.formatter=this.$root.$i18n.formatter,t.i18n.fallbackLocale=this.$root.$i18n.fallbackLocale,t.i18n.silentTranslationWarn=this.$root.$i18n.silentTranslationWarn,t.i18n.silentFallbackWarn=this.$root.$i18n.silentFallbackWarn,t.i18n.pluralizationRules=this.$root.$i18n.pluralizationRules,t.i18n.preserveDirectiveContent=this.$root.$i18n.preserveDirectiveContent),t.__i18n)try{var r={};t.__i18n.forEach(function(t){r=l(r,JSON.parse(t))}),t.i18n.messages=r}catch(t){}this._i18n=new et(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),this._i18n.subscribeDataChanging(this),this._subscribing=!0,(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale())}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof et?(this._i18n=this.$root.$i18n,this._i18n.subscribeDataChanging(this),this._subscribing=!0):t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof et&&(this._i18n=t.parent.$i18n,this._i18n.subscribeDataChanging(this),this._subscribing=!0)},beforeDestroy:function(){if(this._i18n){var t=this;this.$nextTick(function(){t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher),t._i18n=null})}}},M={name:"i18n",functional:!0,props:{tag:{type:String,default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(t,e){var n=e.props,r=e.data,i=e.children,a=e.parent,o=a.$i18n;if(i=(i||[]).filter(function(t){return t.tag||(t.text=t.text.trim())}),!o)return i;var s=n.path,l=n.locale,c={},u=n.places||{},f=(Array.isArray(u)?u.length:Object.keys(u).length,i.every(function(t){if(t.data&&t.data.attrs){var e=t.data.attrs.place;return void 0!==e&&""!==e}}));return Array.isArray(u)?u.forEach(function(t,e){c[e]=t}):Object.keys(u).forEach(function(t){c[t]=u[t]}),i.forEach(function(t,e){var n=f?""+t.data.attrs.place:""+e;c[n]=t}),t(n.tag,r,o.i(s,l,c))}},j=function(){this._caches=Object.create(null)};j.prototype.interpolate=function(t,e){if(!e)return[t];var n=this._caches[t];return n||(n=b(t),this._caches[t]=n),$(n,e)};var A=/^(?:\d)+/,N=/^(?:\w)+/,I=0,R=1,V=2,S=3,z=0,P=4,E=5,U=6,J=7,q=8,G=[];G[z]={ws:[z],ident:[3,I],"[":[P],eof:[J]},G[1]={ws:[1],".":[2],"[":[P],eof:[J]},G[2]={ws:[2],ident:[3,I],0:[3,I],number:[3,I]},G[3]={ident:[3,I],0:[3,I],number:[3,I],ws:[1,R],".":[2,R],"[":[P,R],eof:[J,R]},G[P]={"'":[E,I],'"':[U,I],"[":[P,V],"]":[1,S],eof:q,else:[P,I]},G[E]={"'":[P,I],eof:q,else:[E,I]},G[U]={'"':[P,I],eof:q,else:[U,I]};var B=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/,H=function(){this._cache=Object.create(null)};H.prototype.parsePath=function(t){var e=this._cache[t];return e||(e=x(t))&&(this._cache[t]=e),e||[]},H.prototype.getPathValue=function(t,n){if(!e(t))return null;var r=this.parsePath(n);if(0===r.length)return null;for(var i=r.length,a=t,o=0;o<i;){var s=a[r[o]];if(void 0===s)return null;a=s,o++}return a};var K=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher"],Q=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|.]+|\([\w\-_|.]+\)))/g,X=/^@(?:\.([a-z]+))?:/,Y=/[()]/g,Z={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()}},tt=new j,et=function(t){var e=this;void 0===t&&(t={}),!T&&"undefined"!=typeof window&&window.Vue&&d(window.Vue);var n=t.locale||"en-US",i=t.fallbackLocale||"en-US",a=t.messages||{},o=t.dateTimeFormats||{},s=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||tt,this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&!!t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new H,this._dataListeners=[],this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._exist=function(t,n){return!(!t||!n)&&(!r(e._path.getPathValue(t,n))||!!t[n])},this._initVM({locale:n,fallbackLocale:i,messages:a,dateTimeFormats:o,numberFormats:s})},nt={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0}};et.prototype._initVM=function(t){var e=T.config.silent;T.config.silent=!0,this._vm=new T({data:t}),T.config.silent=e},et.prototype.destroyVM=function(){this._vm.$destroy()},et.prototype.subscribeDataChanging=function(t){this._dataListeners.push(t)},et.prototype.unsubscribeDataChanging=function(t){o(this._dataListeners,t)},et.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",function(){for(var e=t._dataListeners.length;e--;)T.nextTick(function(){t._dataListeners[e]&&t._dataListeners[e].$forceUpdate()})},{deep:!0})},et.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",function(e){t.$set(t,"locale",e),t.$forceUpdate()},{immediate:!0})},nt.vm.get=function(){return this._vm},nt.messages.get=function(){return a(this._getMessages())},nt.dateTimeFormats.get=function(){return a(this._getDateTimeFormats())},nt.numberFormats.get=function(){return a(this._getNumberFormats())},nt.availableLocales.get=function(){return Object.keys(this.messages).sort()},nt.locale.get=function(){return this._vm.locale},nt.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},nt.fallbackLocale.get=function(){return this._vm.fallbackLocale},nt.fallbackLocale.set=function(t){this._vm.$set(this._vm,"fallbackLocale",t)},nt.missing.get=function(){return this._missing},nt.missing.set=function(t){this._missing=t},nt.formatter.get=function(){return this._formatter},nt.formatter.set=function(t){this._formatter=t},nt.silentTranslationWarn.get=function(){return this._silentTranslationWarn},nt.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},nt.silentFallbackWarn.get=function(){return this._silentFallbackWarn},nt.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},nt.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},nt.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},et.prototype._getMessages=function(){return this._vm.messages},et.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},et.prototype._getNumberFormats=function(){return this._vm.numberFormats},et.prototype._warnDefault=function(t,e,n,i,a){if(!r(n))return n;if(this._missing){var o=this._missing.apply(null,[t,e,i,a]);if("string"==typeof o)return o}return e},et.prototype._isFallbackRoot=function(t){return!t&&!r(this._root)&&this._fallbackRoot},et.prototype._isSilentFallback=function(t){return this._silentFallbackWarn&&(this._isFallbackRoot()||t!==this.fallbackLocale)},et.prototype._interpolate=function(t,e,i,a,o,s,l){if(!e)return null;var c=this._path.getPathValue(e,i);if(Array.isArray(c)||n(c))return c;var u;if(r(c)){if(!n(e))return null;if("string"!=typeof(u=e[i]))return null}else{if("string"!=typeof c)return null;u=c}return(u.indexOf("@:")>=0||u.indexOf("@.")>=0)&&(u=this._link(t,e,u,a,"raw",s,l)),this._render(u,o,s,i)},et.prototype._link=function(t,e,n,r,i,a,o){var s=this,l=n,c=l.match(Q);for(var u in c)if(c.hasOwnProperty(u)){var f=c[u],h=f.match(X),p=h[0],m=h[1],_=f.replace(p,"").replace(Y,"");if(o.includes(_))return l;o.push(_);var v=s._interpolate(t,e,_,r,"raw"===i?"string":i,"raw"===i?void 0:a,o);if(s._isFallbackRoot(v)){if(!s._root)throw Error("unexpected error");var g=s._root.$i18n;v=g._translate(g._getMessages(),g.locale,g.fallbackLocale,_,r,i,a)}v=s._warnDefault(t,_,v,r,Array.isArray(a)?a:[a]),Z.hasOwnProperty(m)&&(v=Z[m](v)),o.pop(),l=v?l.replace(f,v):l}return l},et.prototype._render=function(t,e,n,r){var i=this._formatter.interpolate(t,n,r);return i||(i=tt.interpolate(t,n,r)),"string"===e?i.join(""):i},et.prototype._translate=function(t,e,n,i,a,o,s){var l=this._interpolate(e,t[e],i,a,o,s,[i]);return r(l)?(l=this._interpolate(n,t[n],i,a,o,s,[i]),r(l)?null:l):l},et.prototype._t=function(t,e,n,r){for(var a,o=[],s=arguments.length-4;s-- >0;)o[s]=arguments[s+4];if(!t)return"";var l=i.apply(void 0,o),c=l.locale||e,u=this._translate(n,c,this.fallbackLocale,t,r,"string",l.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(a=this._root).$t.apply(a,[t].concat(o))}return this._warnDefault(c,t,u,r,o)},et.prototype.t=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},et.prototype._i=function(t,e,n,r,i){var a=this._translate(n,e,this.fallbackLocale,t,r,"raw",i);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,i)}return this._warnDefault(e,t,a,r,[i])},et.prototype.i=function(t,e,n){return t?("string"!=typeof e&&(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},et.prototype._tc=function(t,e,n,r,a){for(var o,s=[],l=arguments.length-5;l-- >0;)s[l]=arguments[l+5];if(!t)return"";void 0===a&&(a=1);var c={count:a,n:a},u=i.apply(void 0,s);return u.params=Object.assign(c,u.params),s=null===u.locale?[u.params]:[u.locale,u.params],this.fetchChoice((o=this)._t.apply(o,[t,e,n,r].concat(s)),a)},et.prototype.fetchChoice=function(t,e){if(!t&&"string"!=typeof t)return null;var n=t.split("|");return e=this.getChoiceIndex(e,n.length),n[e]?n[e].trim():t},et.prototype.getChoiceIndex=function(t,e){return this.locale in this.pluralizationRules?this.pluralizationRules[this.locale].apply(this,[t,e]):function(t,e){return t=Math.abs(t),2===e?t?t>1?1:0:1:t?Math.min(t,2):0}(t,e)},et.prototype.tc=function(t,e){for(var n,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(r))},et.prototype._te=function(t,e,n){for(var r=[],a=arguments.length-3;a-- >0;)r[a]=arguments[a+3];var o=i.apply(void 0,r).locale||e;return this._exist(n[o],t)},et.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},et.prototype.getLocaleMessage=function(t){return a(this._vm.messages[t]||{})},et.prototype.setLocaleMessage=function(t,e){this._vm.$set(this._vm.messages,t,e)},et.prototype.mergeLocaleMessage=function(t,e){this._vm.$set(this._vm.messages,t,l(this._vm.messages[t]||{},e))},et.prototype.getDateTimeFormat=function(t){return a(this._vm.dateTimeFormats[t]||{})},et.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e)},et.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,l(this._vm.dateTimeFormats[t]||{},e))},et.prototype._localizeDateTime=function(t,e,n,i,a){var o=e,s=i[o];if((r(s)||r(s[a]))&&(o=n,s=i[o]),r(s)||r(s[a]))return null;var l=s[a],c=o+"__"+a,u=this._dateTimeFormatters[c];return u||(u=this._dateTimeFormatters[c]=new Intl.DateTimeFormat(o,l)),u.format(t)},et.prototype._d=function(t,e,n){if(!n)return new Intl.DateTimeFormat(e).format(t);var r=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return r||""},et.prototype.d=function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];var i=this.locale,a=null;return 1===n.length?"string"==typeof n[0]?a=n[0]:e(n[0])&&(n[0].locale&&(i=n[0].locale),n[0].key&&(a=n[0].key)):2===n.length&&("string"==typeof n[0]&&(a=n[0]),"string"==typeof n[1]&&(i=n[1])),this._d(t,i,a)},et.prototype.getNumberFormat=function(t){return a(this._vm.numberFormats[t]||{})},et.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e)},et.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,l(this._vm.numberFormats[t]||{},e))},et.prototype._localizeNumber=function(t,e,n,i,a,o){var s=e,l=i[s];if((r(l)||r(l[a]))&&(s=n,l=i[s]),r(l)||r(l[a]))return null;var c,u=l[a];if(o)c=new Intl.NumberFormat(s,Object.assign({},u,o));else{var f=s+"__"+a;c=this._numberFormatters[f],c||(c=this._numberFormatters[f]=new Intl.NumberFormat(s,u))}return c.format(t)},et.prototype._n=function(t,e,n,r){if(!et.availabilities.numberFormat)return"";if(!n){return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).format(t)}var i=this._localizeNumber(t,e,this.fallbackLocale,this._getNumberFormats(),n,r);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.n(t,Object.assign({},{key:n,locale:e},r))}return i||""},et.prototype.n=function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];var i=this.locale,a=null,o=null;return 1===n.length?"string"==typeof n[0]?a=n[0]:e(n[0])&&(n[0].locale&&(i=n[0].locale),n[0].key&&(a=n[0].key),o=Object.keys(n[0]).reduce(function(t,e){var r;return K.includes(e)?Object.assign({},t,(r={},r[e]=n[0][e],r)):t},null)):2===n.length&&("string"==typeof n[0]&&(a=n[0]),"string"==typeof n[1]&&(i=n[1])),this._n(t,i,a,o)},Object.defineProperties(et.prototype,nt);var rt;return Object.defineProperty(et,"availabilities",{get:function(){if(!rt){var t="undefined"!=typeof Intl;rt={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return rt}}),et.install=d,et.version="8.9.0",et});