Socket
Socket
Sign inDemoInstall

@lingui/core

Package Overview
Dependencies
Maintainers
3
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lingui/core - npm Package Compare versions

Comparing version 3.14.0 to 3.15.0

3

cjs/core.development.js

@@ -117,4 +117,5 @@ 'use strict';

var norm = Array.isArray(msg) ? msg : [msg];
var numberFormat = Object.keys(formats).length ? style('number') : {};
var valueStr = number(locales)(value);
var valueStr = number(locales, numberFormat)(value);

@@ -121,0 +122,0 @@ return norm.map(function (m) {

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),u=i(t),c=i(r),f=i(n),h=i(a),v=i(l),d=i(o),m=function(e){return"string"==typeof e},_=function(e){return"function"==typeof e},g=new Map,y=new Map;function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(m(n)&&(n=new Date(n)),r){var a=D(e,t),l=y.get(a);if(l)return l.format(n);var o=new Intl.DateTimeFormat(e,t);return y.set(a,o),o.format(n)}var i=new Intl.DateTimeFormat(e,t);return i.format(n)}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(r){var a=D(e,t),l=g.get(a);if(l)return l.format(n);var o=new Intl.NumberFormat(e,t);return g.set(a,o),o.format(n)}var i=new Intl.NumberFormat(e,t);return i.format(n)}}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Array.isArray(e)?e.sort().join("-"):e;return"".concat(r,"-").concat(JSON.stringify(t))}var k=Object.freeze({__proto__:null,date:p,number:b}),A=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function O(e){var t=e.locale,r=e.locales,n=e.values,a=e.formats,l=e.localeData,o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=r.plurals,l=function(e){return m(e)?n[e]||{style:e}:e},o=function(e,r){return function(n){var a=_(r)?r(n):r,l=Array.isArray(a)?a:[a],o=b(t)(e);return l.map((function(e){return m(e)?e.replace("#",o):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n)]||l.other;return o(e-n,i)},selectordinal:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n,!0)]||l.other;return o(e-n,i)},select:function(e,t){return t[e]||t.other},number:function(e,r){return b(t,l(r))(e)},date:function(e,r){return p(t,l(r))(e)},undefined:function(e){return e}}}(t,r,l,a);return function e(t,r,a){var l=n[t],i=o[r](l,a),s=_(i)?i(e):i;return Array.isArray(s)?s.join(""):s}}function j(e,t,r,n){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=O({locale:t,locales:r,localeData:n,formats:l,values:a}),i=function e(t){return Array.isArray(t)?t.reduce((function(t,r){if(m(r))return t+r;var n=v.default(r,3),a=n[0],l=n[1],i=n[2],s={};null==i||m(i)?s=i:Object.keys(i).forEach((function(t){s[t]=e(i[t])}));var u=o(a,l,s);return null==u?t:t+u}),""):t},s=i(e);return m(s)&&A.test(s)?JSON.parse('"'.concat(s.trim(),'"')):m(s)?s.trim():s}}var x=function(){function e(){s.default(this,e),this._events={}}return u.default(e,[{key:"on",value:function(e,t){var r=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return r.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var r=this._events[e].indexOf(t);~r&&this._events[e].splice(r,1)}}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,n)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),e}();function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h.default(e);if(t){var a=h.default(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return f.default(this,r)}}var L=function(e){c.default(r,e);var t=w(r);function r(e){var n;return s.default(this,r),n=t.call(this),n._messages={},n._localeData={},null!=e.missing&&(n._missing=e.missing),null!=e.messages&&n.load(e.messages),null!=e.localeData&&n.loadLocaleData(e.localeData),null==e.locale&&null==e.locales||n.activate(e.locale,e.locales),n}return u.default(r,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var r=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return r._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var r=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return r._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.message,a=r.formats,l=r.context;m(e)||(t=e.values||t,n=e.message,l=e.context,e=e.id);var o,i=!l&&!this.messages[e],s=l&&!this.messages[l][e],u=s||i,c=this._missing;return c&&u?_(c)?c(this._locale,e,l):c:(u&&this.emit("missing",{id:e,context:l,locale:this._locale}),o=l&&!s?this.messages[l][e]||n||e:this.messages[e]||n||e,m(o)&&A.test(o)?JSON.parse('"'.concat(o,'"')):m(o)?o:j(o,this._locale,this._locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return p(this._locales||this._locale,t)(e)}},{key:"number",value:function(e,t){return b(this._locales||this._locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),r}(x);function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new L(e)}var E=q();exports.I18n=L,exports.formats=k,exports.i18n=E,exports.setupI18n=q;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),u=i(t),c=i(r),f=i(n),h=i(a),v=i(l),d=i(o),m=function(e){return"string"==typeof e},_=function(e){return"function"==typeof e},g=new Map,y=new Map;function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(m(n)&&(n=new Date(n)),r){var a=k(e,t),l=y.get(a);if(l)return l.format(n);var o=new Intl.DateTimeFormat(e,t);return y.set(a,o),o.format(n)}var i=new Intl.DateTimeFormat(e,t);return i.format(n)}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(r){var a=k(e,t),l=g.get(a);if(l)return l.format(n);var o=new Intl.NumberFormat(e,t);return g.set(a,o),o.format(n)}var i=new Intl.NumberFormat(e,t);return i.format(n)}}function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Array.isArray(e)?e.sort().join("-"):e;return"".concat(r,"-").concat(JSON.stringify(t))}var D=Object.freeze({__proto__:null,date:p,number:b}),A=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function O(e){var t=e.locale,r=e.locales,n=e.values,a=e.formats,l=e.localeData,o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=r.plurals,l=function(e){return m(e)?n[e]||{style:e}:e},o=function(e,r){return function(a){var o=_(r)?r(a):r,i=Array.isArray(o)?o:[o],s=Object.keys(n).length?l("number"):{},u=b(t,s)(e);return i.map((function(e){return m(e)?e.replace("#",u):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n)]||l.other;return o(e-n,i)},selectordinal:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n,!0)]||l.other;return o(e-n,i)},select:function(e,t){return t[e]||t.other},number:function(e,r){return b(t,l(r))(e)},date:function(e,r){return p(t,l(r))(e)},undefined:function(e){return e}}}(t,r,l,a);return function e(t,r,a){var l=n[t],i=o[r](l,a),s=_(i)?i(e):i;return Array.isArray(s)?s.join(""):s}}function j(e,t,r,n){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=O({locale:t,locales:r,localeData:n,formats:l,values:a}),i=function e(t){return Array.isArray(t)?t.reduce((function(t,r){if(m(r))return t+r;var n=v.default(r,3),a=n[0],l=n[1],i=n[2],s={};null==i||m(i)?s=i:Object.keys(i).forEach((function(t){s[t]=e(i[t])}));var u=o(a,l,s);return null==u?t:t+u}),""):t},s=i(e);return m(s)&&A.test(s)?JSON.parse('"'.concat(s.trim(),'"')):m(s)?s.trim():s}}var x=function(){function e(){s.default(this,e),this._events={}}return u.default(e,[{key:"on",value:function(e,t){var r=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return r.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var r=this._events[e].indexOf(t);~r&&this._events[e].splice(r,1)}}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,n)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),e}();function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h.default(e);if(t){var a=h.default(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return f.default(this,r)}}var L=function(e){c.default(r,e);var t=w(r);function r(e){var n;return s.default(this,r),n=t.call(this),n._messages={},n._localeData={},null!=e.missing&&(n._missing=e.missing),null!=e.messages&&n.load(e.messages),null!=e.localeData&&n.loadLocaleData(e.localeData),null==e.locale&&null==e.locales||n.activate(e.locale,e.locales),n}return u.default(r,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var r=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return r._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var r=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return r._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.message,a=r.formats,l=r.context;m(e)||(t=e.values||t,n=e.message,l=e.context,e=e.id);var o,i=!l&&!this.messages[e],s=l&&!this.messages[l][e],u=s||i,c=this._missing;return c&&u?_(c)?c(this._locale,e,l):c:(u&&this.emit("missing",{id:e,context:l,locale:this._locale}),o=l&&!s?this.messages[l][e]||n||e:this.messages[e]||n||e,m(o)&&A.test(o)?JSON.parse('"'.concat(o,'"')):m(o)?o:j(o,this._locale,this._locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return p(this._locales||this._locale,t)(e)}},{key:"number",value:function(e,t){return b(this._locales||this._locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),r}(x);function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new L(e)}var E=q();exports.I18n=L,exports.formats=D,exports.i18n=E,exports.setupI18n=q;
//# sourceMappingURL=core.production.min.js.map

@@ -117,4 +117,5 @@ 'use strict';

var norm = Array.isArray(msg) ? msg : [msg];
var numberFormat = Object.keys(formats).length ? style('number') : {};
var valueStr = number(locales)(value);
var valueStr = number(locales, numberFormat)(value);

@@ -121,0 +122,0 @@ return norm.map(function (m) {

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),u=i(t),c=i(r),f=i(n),h=i(a),v=i(l),d=i(o),m=function(e){return"string"==typeof e},_=function(e){return"function"==typeof e},g=new Map,y=new Map;function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(m(n)&&(n=new Date(n)),r){var a=D(e,t),l=y.get(a);if(l)return l.format(n);var o=new Intl.DateTimeFormat(e,t);return y.set(a,o),o.format(n)}var i=new Intl.DateTimeFormat(e,t);return i.format(n)}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(r){var a=D(e,t),l=g.get(a);if(l)return l.format(n);var o=new Intl.NumberFormat(e,t);return g.set(a,o),o.format(n)}var i=new Intl.NumberFormat(e,t);return i.format(n)}}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Array.isArray(e)?e.sort().join("-"):e;return"".concat(r,"-").concat(JSON.stringify(t))}var k=Object.freeze({__proto__:null,date:p,number:b}),A=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function O(e){var t=e.locale,r=e.locales,n=e.values,a=e.formats,l=e.localeData,o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=r.plurals,l=function(e){return m(e)?n[e]||{style:e}:e},o=function(e,r){return function(n){var a=_(r)?r(n):r,l=Array.isArray(a)?a:[a],o=b(t)(e);return l.map((function(e){return m(e)?e.replace("#",o):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n)]||l.other;return o(e-n,i)},selectordinal:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n,!0)]||l.other;return o(e-n,i)},select:function(e,t){return t[e]||t.other},number:function(e,r){return b(t,l(r))(e)},date:function(e,r){return p(t,l(r))(e)},undefined:function(e){return e}}}(t,r,l,a);return function e(t,r,a){var l=n[t],i=o[r](l,a),s=_(i)?i(e):i;return Array.isArray(s)?s.join(""):s}}function j(e,t,r,n){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=O({locale:t,locales:r,localeData:n,formats:l,values:a}),i=function e(t){return Array.isArray(t)?t.reduce((function(t,r){if(m(r))return t+r;var n=v.default(r,3),a=n[0],l=n[1],i=n[2],s={};null==i||m(i)?s=i:Object.keys(i).forEach((function(t){s[t]=e(i[t])}));var u=o(a,l,s);return null==u?t:t+u}),""):t},s=i(e);return m(s)&&A.test(s)?JSON.parse('"'.concat(s.trim(),'"')):m(s)?s.trim():s}}var x=function(){function e(){s.default(this,e),this._events={}}return u.default(e,[{key:"on",value:function(e,t){var r=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return r.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var r=this._events[e].indexOf(t);~r&&this._events[e].splice(r,1)}}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,n)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),e}();function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h.default(e);if(t){var a=h.default(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return f.default(this,r)}}var L=function(e){c.default(r,e);var t=w(r);function r(e){var n;return s.default(this,r),n=t.call(this),n._messages={},n._localeData={},null!=e.missing&&(n._missing=e.missing),null!=e.messages&&n.load(e.messages),null!=e.localeData&&n.loadLocaleData(e.localeData),null==e.locale&&null==e.locales||n.activate(e.locale,e.locales),n}return u.default(r,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var r=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return r._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var r=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return r._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.message,a=r.formats,l=r.context;m(e)||(t=e.values||t,n=e.message,l=e.context,e=e.id);var o,i=!l&&!this.messages[e],s=l&&!this.messages[l][e],u=s||i,c=this._missing;return c&&u?_(c)?c(this._locale,e,l):c:(u&&this.emit("missing",{id:e,context:l,locale:this._locale}),o=l&&!s?this.messages[l][e]||n||e:this.messages[e]||n||e,m(o)&&A.test(o)?JSON.parse('"'.concat(o,'"')):m(o)?o:j(o,this._locale,this._locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return p(this._locales||this._locale,t)(e)}},{key:"number",value:function(e,t){return b(this._locales||this._locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),r}(x);function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new L(e)}var E=q();exports.I18n=L,exports.formats=k,exports.i18n=E,exports.setupI18n=q;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),u=i(t),c=i(r),f=i(n),h=i(a),v=i(l),d=i(o),m=function(e){return"string"==typeof e},_=function(e){return"function"==typeof e},g=new Map,y=new Map;function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(m(n)&&(n=new Date(n)),r){var a=k(e,t),l=y.get(a);if(l)return l.format(n);var o=new Intl.DateTimeFormat(e,t);return y.set(a,o),o.format(n)}var i=new Intl.DateTimeFormat(e,t);return i.format(n)}}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n){if(r){var a=k(e,t),l=g.get(a);if(l)return l.format(n);var o=new Intl.NumberFormat(e,t);return g.set(a,o),o.format(n)}var i=new Intl.NumberFormat(e,t);return i.format(n)}}function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Array.isArray(e)?e.sort().join("-"):e;return"".concat(r,"-").concat(JSON.stringify(t))}var D=Object.freeze({__proto__:null,date:p,number:b}),A=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function O(e){var t=e.locale,r=e.locales,n=e.values,a=e.formats,l=e.localeData,o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=r.plurals,l=function(e){return m(e)?n[e]||{style:e}:e},o=function(e,r){return function(a){var o=_(r)?r(a):r,i=Array.isArray(o)?o:[o],s=Object.keys(n).length?l("number"):{},u=b(t,s)(e);return i.map((function(e){return m(e)?e.replace("#",u):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n)]||l.other;return o(e-n,i)},selectordinal:function(e,t){var r=t.offset,n=void 0===r?0:r,l=d.default(t,["offset"]),i=l[e]||l[null==a?void 0:a(e-n,!0)]||l.other;return o(e-n,i)},select:function(e,t){return t[e]||t.other},number:function(e,r){return b(t,l(r))(e)},date:function(e,r){return p(t,l(r))(e)},undefined:function(e){return e}}}(t,r,l,a);return function e(t,r,a){var l=n[t],i=o[r](l,a),s=_(i)?i(e):i;return Array.isArray(s)?s.join(""):s}}function j(e,t,r,n){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=O({locale:t,locales:r,localeData:n,formats:l,values:a}),i=function e(t){return Array.isArray(t)?t.reduce((function(t,r){if(m(r))return t+r;var n=v.default(r,3),a=n[0],l=n[1],i=n[2],s={};null==i||m(i)?s=i:Object.keys(i).forEach((function(t){s[t]=e(i[t])}));var u=o(a,l,s);return null==u?t:t+u}),""):t},s=i(e);return m(s)&&A.test(s)?JSON.parse('"'.concat(s.trim(),'"')):m(s)?s.trim():s}}var x=function(){function e(){s.default(this,e),this._events={}}return u.default(e,[{key:"on",value:function(e,t){var r=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return r.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var r=this._events[e].indexOf(t);~r&&this._events[e].splice(r,1)}}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,n)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),e}();function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h.default(e);if(t){var a=h.default(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return f.default(this,r)}}var L=function(e){c.default(r,e);var t=w(r);function r(e){var n;return s.default(this,r),n=t.call(this),n._messages={},n._localeData={},null!=e.missing&&(n._missing=e.missing),null!=e.messages&&n.load(e.messages),null!=e.localeData&&n.loadLocaleData(e.localeData),null==e.locale&&null==e.locales||n.activate(e.locale,e.locales),n}return u.default(r,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var r=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return r._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var r=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return r._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.message,a=r.formats,l=r.context;m(e)||(t=e.values||t,n=e.message,l=e.context,e=e.id);var o,i=!l&&!this.messages[e],s=l&&!this.messages[l][e],u=s||i,c=this._missing;return c&&u?_(c)?c(this._locale,e,l):c:(u&&this.emit("missing",{id:e,context:l,locale:this._locale}),o=l&&!s?this.messages[l][e]||n||e:this.messages[e]||n||e,m(o)&&A.test(o)?JSON.parse('"'.concat(o,'"')):m(o)?o:j(o,this._locale,this._locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return p(this._locales||this._locale,t)(e)}},{key:"number",value:function(e,t){return b(this._locales||this._locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),r}(x);function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new L(e)}var E=q();exports.I18n=L,exports.formats=D,exports.i18n=E,exports.setupI18n=q;
//# sourceMappingURL=dev.production.min.js.map

@@ -102,4 +102,5 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';

var norm = Array.isArray(msg) ? msg : [msg];
var numberFormat = Object.keys(formats).length ? style('number') : {};
var valueStr = number(locales)(value);
var valueStr = number(locales, numberFormat)(value);

@@ -106,0 +107,0 @@ return norm.map(function (m) {

@@ -1,2 +0,2 @@

import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/slicedToArray";import l from"@babel/runtime/helpers/objectWithoutProperties";var i=function(e){return"string"==typeof e},s=function(e){return"function"==typeof e},u=new Map,c=new Map;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(i(r)&&(r=new Date(r)),n){var a=v(e,t),o=c.get(a);if(o)return o.format(r);var l=new Intl.DateTimeFormat(e,t);return c.set(a,l),l.format(r)}var s=new Intl.DateTimeFormat(e,t);return s.format(r)}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(n){var a=v(e,t),o=u.get(a);if(o)return o.format(r);var l=new Intl.NumberFormat(e,t);return u.set(a,l),l.format(r)}var i=new Intl.NumberFormat(e,t);return i.format(r)}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(e)?e.sort().join("-"):e;return"".concat(n,"-").concat(JSON.stringify(t))}var m=Object.freeze({__proto__:null,date:f,number:h}),g=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function _(e){var t=e.locale,n=e.locales,r=e.values,a=e.formats,o=e.localeData,u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=n.plurals,o=function(e){return i(e)?r[e]||{style:e}:e},u=function(e,n){return function(r){var a=s(n)?n(r):n,o=Array.isArray(a)?a:[a],l=h(t)(e);return o.map((function(e){return i(e)?e.replace("#",l):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r)]||o.other;return u(e-r,i)},selectordinal:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r,!0)]||o.other;return u(e-r,i)},select:function(e,t){return t[e]||t.other},number:function(e,n){return h(t,o(n))(e)},date:function(e,n){return f(t,o(n))(e)},undefined:function(e){return e}}}(t,n,o,a);return function e(t,n,a){var o=r[t],l=u[n](o,a),i=s(l)?l(e):l;return Array.isArray(i)?i.join(""):i}}function d(e,t,n,r){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=_({locale:t,locales:n,localeData:r,formats:l,values:a}),u=function e(t){return Array.isArray(t)?t.reduce((function(t,n){if(i(n))return t+n;var r=o(n,3),a=r[0],l=r[1],u=r[2],c={};null==u||i(u)?c=u:Object.keys(u).forEach((function(t){c[t]=e(u[t])}));var f=s(a,l,c);return null==f?t:t+f}),""):t},c=u(e);return i(c)&&g.test(c)?JSON.parse('"'.concat(c.trim(),'"')):i(c)?c.trim():c}}var p=function(){function n(){e(this,n),this._events={}}return t(n,[{key:"on",value:function(e,t){var n=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return n.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var n=this._events[e].indexOf(t);~n&&this._events[e].splice(n,1)}}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,r)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),n}();function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=a(e);if(t){var l=a(this).constructor;n=Reflect.construct(o,arguments,l)}else n=o.apply(this,arguments);return r(this,n)}}var b=function(r){n(o,r);var a=y(o);function o(t){var n;return e(this,o),n=a.call(this),n._messages={},n._localeData={},null!=t.missing&&(n._missing=t.missing),null!=t.messages&&n.load(t.messages),null!=t.localeData&&n.loadLocaleData(t.localeData),null==t.locale&&null==t.locales||n.activate(t.locale,t.locales),n}return t(o,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var n=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return n._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var n=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return n._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.message,a=n.formats,o=n.context;i(e)||(t=e.values||t,r=e.message,o=e.context,e=e.id);var l,u=!o&&!this.messages[e],c=o&&!this.messages[o][e],f=c||u,h=this._missing;return h&&f?s(h)?h(this._locale,e,o):h:(f&&this.emit("missing",{id:e,context:o,locale:this._locale}),l=o&&!c?this.messages[o][e]||r||e:this.messages[e]||r||e,i(l)&&g.test(l)?JSON.parse('"'.concat(l,'"')):i(l)?l:d(l,this._locale,this._locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return f(this._locales||this._locale,t)(e)}},{key:"number",value:function(e,t){return h(this._locales||this._locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),o}(p);function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new b(e)}var k=D();export{b as I18n,m as formats,k as i18n,D as setupI18n};
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/slicedToArray";import l from"@babel/runtime/helpers/objectWithoutProperties";var i=function(e){return"string"==typeof e},s=function(e){return"function"==typeof e},u=new Map,c=new Map;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(i(r)&&(r=new Date(r)),n){var a=v(e,t),o=c.get(a);if(o)return o.format(r);var l=new Intl.DateTimeFormat(e,t);return c.set(a,l),l.format(r)}var s=new Intl.DateTimeFormat(e,t);return s.format(r)}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(n){var a=v(e,t),o=u.get(a);if(o)return o.format(r);var l=new Intl.NumberFormat(e,t);return u.set(a,l),l.format(r)}var i=new Intl.NumberFormat(e,t);return i.format(r)}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(e)?e.sort().join("-"):e;return"".concat(n,"-").concat(JSON.stringify(t))}var m=Object.freeze({__proto__:null,date:f,number:h}),g=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function _(e){var t=e.locale,n=e.locales,r=e.values,a=e.formats,o=e.localeData,u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=n.plurals,o=function(e){return i(e)?r[e]||{style:e}:e},u=function(e,n){return function(a){var l=s(n)?n(a):n,u=Array.isArray(l)?l:[l],c=Object.keys(r).length?o("number"):{},f=h(t,c)(e);return u.map((function(e){return i(e)?e.replace("#",f):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r)]||o.other;return u(e-r,i)},selectordinal:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r,!0)]||o.other;return u(e-r,i)},select:function(e,t){return t[e]||t.other},number:function(e,n){return h(t,o(n))(e)},date:function(e,n){return f(t,o(n))(e)},undefined:function(e){return e}}}(t,n,o,a);return function e(t,n,a){var o=r[t],l=u[n](o,a),i=s(l)?l(e):l;return Array.isArray(i)?i.join(""):i}}function d(e,t,n,r){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=_({locale:t,locales:n,localeData:r,formats:l,values:a}),u=function e(t){return Array.isArray(t)?t.reduce((function(t,n){if(i(n))return t+n;var r=o(n,3),a=r[0],l=r[1],u=r[2],c={};null==u||i(u)?c=u:Object.keys(u).forEach((function(t){c[t]=e(u[t])}));var f=s(a,l,c);return null==f?t:t+f}),""):t},c=u(e);return i(c)&&g.test(c)?JSON.parse('"'.concat(c.trim(),'"')):i(c)?c.trim():c}}var p=function(){function n(){e(this,n),this._events={}}return t(n,[{key:"on",value:function(e,t){var n=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return n.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var n=this._events[e].indexOf(t);~n&&this._events[e].splice(n,1)}}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,r)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),n}();function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=a(e);if(t){var l=a(this).constructor;n=Reflect.construct(o,arguments,l)}else n=o.apply(this,arguments);return r(this,n)}}var b=function(r){n(o,r);var a=y(o);function o(t){var n;return e(this,o),n=a.call(this),n._messages={},n._localeData={},null!=t.missing&&(n._missing=t.missing),null!=t.messages&&n.load(t.messages),null!=t.localeData&&n.loadLocaleData(t.localeData),null==t.locale&&null==t.locales||n.activate(t.locale,t.locales),n}return t(o,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var n=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return n._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var n=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return n._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.message,a=n.formats,o=n.context;i(e)||(t=e.values||t,r=e.message,o=e.context,e=e.id);var l,u=!o&&!this.messages[e],c=o&&!this.messages[o][e],f=c||u,h=this._missing;return h&&f?s(h)?h(this._locale,e,o):h:(f&&this.emit("missing",{id:e,context:o,locale:this._locale}),l=o&&!c?this.messages[o][e]||r||e:this.messages[e]||r||e,i(l)&&g.test(l)?JSON.parse('"'.concat(l,'"')):i(l)?l:d(l,this._locale,this._locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return f(this._locales||this._locale,t)(e)}},{key:"number",value:function(e,t){return h(this._locales||this._locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),o}(p);function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new b(e)}var D=k();export{b as I18n,m as formats,D as i18n,k as setupI18n};
//# sourceMappingURL=core.production.min.js.map

@@ -102,4 +102,5 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';

var norm = Array.isArray(msg) ? msg : [msg];
var numberFormat = Object.keys(formats).length ? style('number') : {};
var valueStr = number(locales)(value);
var valueStr = number(locales, numberFormat)(value);

@@ -106,0 +107,0 @@ return norm.map(function (m) {

@@ -1,2 +0,2 @@

import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/slicedToArray";import l from"@babel/runtime/helpers/objectWithoutProperties";var i=function(e){return"string"==typeof e},s=function(e){return"function"==typeof e},u=new Map,c=new Map;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(i(r)&&(r=new Date(r)),n){var a=v(e,t),o=c.get(a);if(o)return o.format(r);var l=new Intl.DateTimeFormat(e,t);return c.set(a,l),l.format(r)}var s=new Intl.DateTimeFormat(e,t);return s.format(r)}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(n){var a=v(e,t),o=u.get(a);if(o)return o.format(r);var l=new Intl.NumberFormat(e,t);return u.set(a,l),l.format(r)}var i=new Intl.NumberFormat(e,t);return i.format(r)}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(e)?e.sort().join("-"):e;return"".concat(n,"-").concat(JSON.stringify(t))}var m=Object.freeze({__proto__:null,date:f,number:h}),g=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function _(e){var t=e.locale,n=e.locales,r=e.values,a=e.formats,o=e.localeData,u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=n.plurals,o=function(e){return i(e)?r[e]||{style:e}:e},u=function(e,n){return function(r){var a=s(n)?n(r):n,o=Array.isArray(a)?a:[a],l=h(t)(e);return o.map((function(e){return i(e)?e.replace("#",l):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r)]||o.other;return u(e-r,i)},selectordinal:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r,!0)]||o.other;return u(e-r,i)},select:function(e,t){return t[e]||t.other},number:function(e,n){return h(t,o(n))(e)},date:function(e,n){return f(t,o(n))(e)},undefined:function(e){return e}}}(t,n,o,a);return function e(t,n,a){var o=r[t],l=u[n](o,a),i=s(l)?l(e):l;return Array.isArray(i)?i.join(""):i}}function d(e,t,n,r){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=_({locale:t,locales:n,localeData:r,formats:l,values:a}),u=function e(t){return Array.isArray(t)?t.reduce((function(t,n){if(i(n))return t+n;var r=o(n,3),a=r[0],l=r[1],u=r[2],c={};null==u||i(u)?c=u:Object.keys(u).forEach((function(t){c[t]=e(u[t])}));var f=s(a,l,c);return null==f?t:t+f}),""):t},c=u(e);return i(c)&&g.test(c)?JSON.parse('"'.concat(c.trim(),'"')):i(c)?c.trim():c}}var p=function(){function n(){e(this,n),this._events={}}return t(n,[{key:"on",value:function(e,t){var n=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return n.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var n=this._events[e].indexOf(t);~n&&this._events[e].splice(n,1)}}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,r)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),n}();function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=a(e);if(t){var l=a(this).constructor;n=Reflect.construct(o,arguments,l)}else n=o.apply(this,arguments);return r(this,n)}}var b=function(r){n(o,r);var a=y(o);function o(t){var n;return e(this,o),n=a.call(this),n._messages={},n._localeData={},null!=t.missing&&(n._missing=t.missing),null!=t.messages&&n.load(t.messages),null!=t.localeData&&n.loadLocaleData(t.localeData),null==t.locale&&null==t.locales||n.activate(t.locale,t.locales),n}return t(o,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var n=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return n._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var n=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return n._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.message,a=n.formats,o=n.context;i(e)||(t=e.values||t,r=e.message,o=e.context,e=e.id);var l,u=!o&&!this.messages[e],c=o&&!this.messages[o][e],f=c||u,h=this._missing;return h&&f?s(h)?h(this._locale,e,o):h:(f&&this.emit("missing",{id:e,context:o,locale:this._locale}),l=o&&!c?this.messages[o][e]||r||e:this.messages[e]||r||e,i(l)&&g.test(l)?JSON.parse('"'.concat(l,'"')):i(l)?l:d(l,this._locale,this._locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return f(this._locales||this._locale,t)(e)}},{key:"number",value:function(e,t){return h(this._locales||this._locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),o}(p);function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new b(e)}var k=D();export{b as I18n,m as formats,k as i18n,D as setupI18n};
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/slicedToArray";import l from"@babel/runtime/helpers/objectWithoutProperties";var i=function(e){return"string"==typeof e},s=function(e){return"function"==typeof e},u=new Map,c=new Map;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(i(r)&&(r=new Date(r)),n){var a=v(e,t),o=c.get(a);if(o)return o.format(r);var l=new Intl.DateTimeFormat(e,t);return c.set(a,l),l.format(r)}var s=new Intl.DateTimeFormat(e,t);return s.format(r)}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){if(n){var a=v(e,t),o=u.get(a);if(o)return o.format(r);var l=new Intl.NumberFormat(e,t);return u.set(a,l),l.format(r)}var i=new Intl.NumberFormat(e,t);return i.format(r)}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(e)?e.sort().join("-"):e;return"".concat(n,"-").concat(JSON.stringify(t))}var m=Object.freeze({__proto__:null,date:f,number:h}),g=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;function _(e){var t=e.locale,n=e.locales,r=e.values,a=e.formats,o=e.localeData,u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{plurals:void 0},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=t||e;var a=n.plurals,o=function(e){return i(e)?r[e]||{style:e}:e},u=function(e,n){return function(a){var l=s(n)?n(a):n,u=Array.isArray(l)?l:[l],c=Object.keys(r).length?o("number"):{},f=h(t,c)(e);return u.map((function(e){return i(e)?e.replace("#",f):e}))}};return a||console.error("Plurals for locale ".concat(e," aren't loaded. Use i18n.loadLocaleData method to load plurals for specific locale. Using other plural rule as a fallback.")),{plural:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r)]||o.other;return u(e-r,i)},selectordinal:function(e,t){var n=t.offset,r=void 0===n?0:n,o=l(t,["offset"]),i=o[e]||o[null==a?void 0:a(e-r,!0)]||o.other;return u(e-r,i)},select:function(e,t){return t[e]||t.other},number:function(e,n){return h(t,o(n))(e)},date:function(e,n){return f(t,o(n))(e)},undefined:function(e){return e}}}(t,n,o,a);return function e(t,n,a){var o=r[t],l=u[n](o,a),i=s(l)?l(e):l;return Array.isArray(i)?i.join(""):i}}function d(e,t,n,r){return function(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=_({locale:t,locales:n,localeData:r,formats:l,values:a}),u=function e(t){return Array.isArray(t)?t.reduce((function(t,n){if(i(n))return t+n;var r=o(n,3),a=r[0],l=r[1],u=r[2],c={};null==u||i(u)?c=u:Object.keys(u).forEach((function(t){c[t]=e(u[t])}));var f=s(a,l,c);return null==f?t:t+f}),""):t},c=u(e);return i(c)&&g.test(c)?JSON.parse('"'.concat(c.trim(),'"')):i(c)?c.trim():c}}var p=function(){function n(){e(this,n),this._events={}}return t(n,[{key:"on",value:function(e,t){var n=this;return this._hasEvent(e)||(this._events[e]=[]),this._events[e].push(t),function(){return n.removeListener(e,t)}}},{key:"removeListener",value:function(e,t){if(this._hasEvent(e)){var n=this._events[e].indexOf(t);~n&&this._events[e].splice(n,1)}}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];this._hasEvent(e)&&this._events[e].map((function(e){return e.apply(t,r)}))}},{key:"_hasEvent",value:function(e){return Array.isArray(this._events[e])}}]),n}();function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=a(e);if(t){var l=a(this).constructor;n=Reflect.construct(o,arguments,l)}else n=o.apply(this,arguments);return r(this,n)}}var b=function(r){n(o,r);var a=y(o);function o(t){var n;return e(this,o),n=a.call(this),n._messages={},n._localeData={},null!=t.missing&&(n._missing=t.missing),null!=t.messages&&n.load(t.messages),null!=t.localeData&&n.loadLocaleData(t.localeData),null==t.locale&&null==t.locales||n.activate(t.locale,t.locales),n}return t(o,[{key:"_loadLocaleData",value:function(e,t){null==this._localeData[e]?this._localeData[e]=t:Object.assign(this._localeData[e],t)}},{key:"loadLocaleData",value:function(e,t){var n=this;null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach((function(t){return n._loadLocaleData(t,e[t])})),this.emit("change")}},{key:"_load",value:function(e,t){null==this._messages[e]?this._messages[e]=t:Object.assign(this._messages[e],t)}},{key:"load",value:function(e,t){var n=this;null!=t?this._load(e,t):Object.keys(e).forEach((function(t){return n._load(t,e[t])})),this.emit("change")}},{key:"activate",value:function(e,t){this._locale=e,this._locales=t,this.emit("change")}},{key:"_",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.message,a=n.formats,o=n.context;i(e)||(t=e.values||t,r=e.message,o=e.context,e=e.id);var l,u=!o&&!this.messages[e],c=o&&!this.messages[o][e],f=c||u,h=this._missing;return h&&f?s(h)?h(this._locale,e,o):h:(f&&this.emit("missing",{id:e,context:o,locale:this._locale}),l=o&&!c?this.messages[o][e]||r||e:this.messages[e]||r||e,i(l)&&g.test(l)?JSON.parse('"'.concat(l,'"')):i(l)?l:d(l,this._locale,this._locales,this.localeData)(t,a))}},{key:"date",value:function(e,t){return f(this._locales||this._locale,t)(e)}},{key:"number",value:function(e,t){return h(this._locales||this._locale,t)(e)}},{key:"locale",get:function(){return this._locale}},{key:"locales",get:function(){return this._locales}},{key:"messages",get:function(){var e;return null!==(e=this._messages[this._locale])&&void 0!==e?e:{}}},{key:"localeData",get:function(){var e;return null!==(e=this._localeData[this._locale])&&void 0!==e?e:{}}}]),o}(p);function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new b(e)}var D=k();export{b as I18n,m as formats,D as i18n,k as setupI18n};
//# sourceMappingURL=dev.production.min.js.map
{
"name": "@lingui/core",
"version": "3.14.0",
"version": "3.15.0",
"sideEffects": false,

@@ -5,0 +5,0 @@ "description": "I18n tools for javascript",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc