react-intl 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +20 -0
- package/dist/react-intl.js +145 -615
- package/dist/react-intl.js.map +1 -1
- package/dist/react-intl.min.js +2 -2
- package/dist/react-intl.min.js.map +1 -1
- package/lib/index.es.js +74 -520
- package/lib/index.js +110 -556
- package/package.json +24 -20
- package/yarn.lock +4804 -0
- package/src/components/date.js +0 -46
- package/src/components/html-message.js +0 -87
- package/src/components/message.js +0 -134
- package/src/components/number.js +0 -46
- package/src/components/plural.js +0 -58
- package/src/components/provider.js +0 -176
- package/src/components/relative.js +0 -163
- package/src/components/time.js +0 -46
- package/src/define-messages.js +0 -11
- package/src/en.js +0 -2
- package/src/format.js +0 -275
- package/src/index.js +0 -12
- package/src/inject.js +0 -61
- package/src/locale-data-registry.js +0 -42
- package/src/plural.js +0 -28
- package/src/react-intl.js +0 -24
- package/src/types.js +0 -88
- package/src/utils.js +0 -93
package/dist/react-intl.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.ReactIntl=e.ReactIntl||{},e.React)}(this,function(e,t){"use strict";function r(e){var t,r,n,o,a=Array.prototype.slice.call(arguments,1);for(t=0,r=a.length;t<r;t+=1)if(n=a[t])for(o in n)q.call(n,o)&&(e[o]=n[o]);return e}function n(e,t,r){this.locales=e,this.formats=t,this.pluralFn=r}function o(e){this.id=e}function a(e,t,r,n,o){this.id=e,this.useOrdinal=t,this.offset=r,this.options=n,this.pluralFn=o}function i(e,t,r,n){this.id=e,this.offset=t,this.numberFormat=r,this.string=n}function u(e,t){this.id=e,this.options=t}function l(e,t,r){var n="string"==typeof e?l.__parse(e):e;if(!n||"messageFormatPattern"!==n.type)throw new TypeError("A message must be provided as a String or AST.");r=this._mergeFormats(l.formats,r),H(this,"_locale",{value:this._resolveLocale(t)});var o=this._findPluralRuleFunction(this._locale),a=this._compilePattern(n,t,r,o),i=this;this.format=function(e){return i._format(a,e)}}function s(e){return 400*e/146097}function c(e,t){t=t||{},te(e)&&(e=e.concat()),X(this,"_locale",{value:this._resolveLocale(e)}),X(this,"_options",{value:{style:this._resolveStyle(t.style),units:this._isValidUnits(t.units)&&t.units}}),X(this,"_locales",{value:e}),X(this,"_fields",{value:this._findFields(this._locale)}),X(this,"_messages",{value:Y(null)});var r=this;this.format=function(e,t){return r._format(e,t)}}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=Array.isArray(e)?e:[e];t.forEach(function(e){e&&e.locale&&(l.__addLocaleData(e),c.__addLocaleData(e))})}function p(e){for(var t=(e||"").split("-");t.length>0;){if(h(t.join("-")))return!0;t.pop()}return!1}function h(e){var t=e&&e.toLowerCase();return!(!l.__localeData__[t]||!c.__localeData__[t])}function d(e){return(""+e).replace(lt,function(e){return ut[e]})}function m(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.reduce(function(t,n){return e.hasOwnProperty(n)?t[n]=e[n]:r.hasOwnProperty(n)&&(t[n]=r[n]),t},{})}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.intl;at(t,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}function v(e,t){if(e===t)return!0;if("object"!==("undefined"==typeof e?"undefined":Ie.typeof(e))||null===e||"object"!==("undefined"==typeof t?"undefined":Ie.typeof(t))||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),a=0;a<r.length;a++)if(!o(r[a])||e[r[a]]!==t[r[a]])return!1;return!0}function g(e,t,r){var n=e.props,o=e.state,a=e.context,i=void 0===a?{}:a,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=i.intl,s=void 0===l?{}:l,c=u.intl,f=void 0===c?{}:c;return!v(t,n)||!v(r,o)||!(f===s||v(m(f,it),m(s,it)))}function b(e){return e.displayName||e.name||"Component"}function w(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.intlPropName,o=void 0===n?"intl":n,a=r.withRef,i=void 0!==a&&a,u=function(t){function r(e,t){pe(this,r);var n=je(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return y(t),n}return be(r,t),he(r,[{key:"getWrappedInstance",value:function(){return at(i,"[React Intl] To access the wrapped instance, the `{withRef: true}` option must be set when calling: `injectIntl()`"),this.refs.wrappedInstance}},{key:"render",value:function(){return U.createElement(e,Ie.extends({},this.props,ye({},o,this.context.intl),{ref:i?"wrappedInstance":null}))}}]),r}(t.Component);return u.displayName="InjectIntl("+b(e)+")",u.contextTypes={intl:Xe},u.WrappedComponent=e,u}function _(e){return e}function F(e){return l.prototype._resolveLocale(e)}function O(e){return l.prototype._findPluralRuleFunction(e)}function x(e){var t=dt(null);return function(){var r=Array.prototype.slice.call(arguments),n=P(r),o=n&&t[n];return o||(o=new(ct.apply(e,[null].concat(r))),n&&(t[n]=o)),o}}function P(e){if("undefined"!=typeof JSON){var t,r,n,o=[];for(t=0,r=e.length;t<r;t+=1)n=e[t],n&&"object"===("undefined"==typeof n?"undefined":Ie.typeof(n))?o.push(j(n)):o.push(n);return JSON.stringify(o)}}function j(e){var t,r,n,o,a=[],i=[];for(t in e)e.hasOwnProperty(t)&&i.push(t);var u=i.sort();for(r=0,n=u.length;r<n;r+=1)t=u[r],o={},o[t]=e[t],a[r]=o;return a}function T(e){var t=c.thresholds;t.second=e.second,t.minute=e.minute,t.hour=e.hour,t.day=e.day,t.month=e.month}function A(e,t,r){var n=e&&e[t]&&e[t][r];if(n)return n}function C(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=e.formats,i=n.format,u=new Date(r),l=i&&A(a,"date",i),s=m(n,mt,l);try{return t.getDateTimeFormat(o,s).format(u)}catch(e){}return String(u)}function k(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=e.formats,i=n.format,u=new Date(r),l=i&&A(a,"time",i),s=m(n,mt,l);s.hour||s.minute||s.second||(s=Ie.extends({},s,{hour:"numeric",minute:"numeric"}));try{return t.getDateTimeFormat(o,s).format(u)}catch(e){}return String(u)}function N(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=e.formats,i=n.format,u=new Date(r),l=new Date(n.now),s=i&&A(a,"relative",i),f=m(n,vt,s),p=Ie.extends({},c.thresholds);T(bt);try{return t.getRelativeFormat(o,f).format(u,{now:isFinite(l)?l:t.now()})}catch(e){}finally{T(p)}return String(u)}function M(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=e.formats,i=n.format,u=i&&A(a,"number",i),l=m(n,yt,u);try{return t.getNumberFormat(o,l).format(r)}catch(e){}return String(r)}function R(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=m(n,gt);try{return t.getPluralFormat(o,a).format(r)}catch(e){}return"other"}function S(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,a=e.formats,i=e.messages,u=e.defaultLocale,l=e.defaultFormats,s=r.id,c=r.defaultMessage;at(s,"[React Intl] An `id` must be provided to format a message.");var f=i&&i[s],p=Object.keys(n).length>0;if(!p)return f||c||s;var h=void 0;if(f)try{var d=t.getMessageFormat(f,o,a);h=d.format(n)}catch(e){}if(!h&&c)try{var m=t.getMessageFormat(c,u,l);h=m.format(n)}catch(e){}return h||f||c||s}function D(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Object.keys(n).reduce(function(e,t){var r=n[t];return e[t]="string"==typeof r?d(r):r,e},{});return S(e,t,r,o)}function E(e){var t=Math.abs(e);return t<At?"second":t<Ct?"minute":t<kt?"hour":"day"}function I(e){switch(e){case"second":return Tt;case"minute":return At;case"hour":return Ct;case"day":return kt;default:return Nt}}function L(e,t){if(e===t)return!0;var r=new Date(e).getTime(),n=new Date(t).getTime();return isFinite(r)&&isFinite(n)&&r===n}if("undefined"==typeof t)throw new ReferenceError("React must be loaded before ReactIntl.");var U="default"in t?t.default:t,G={locale:"en",pluralRuleFunction:function(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return t?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==e&&n?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}},q=Object.prototype.hasOwnProperty,W=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),H=W?Object.defineProperty:function(e,t,r){"get"in r&&e.__defineGetter__?e.__defineGetter__(t,r.get):(!q.call(e,t)||"value"in r)&&(e[t]=r.value)},z=Object.create||function(e,t){function r(){}var n,o;r.prototype=e,n=new r;for(o in t)q.call(t,o)&&H(n,o,t[o]);return n};n.prototype.compile=function(e){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(e)},n.prototype.compileMessage=function(e){if(!e||"messageFormatPattern"!==e.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var t,r,n,o=e.elements,a=[];for(t=0,r=o.length;t<r;t+=1)switch(n=o[t],n.type){case"messageTextElement":a.push(this.compileMessageText(n));break;case"argumentElement":a.push(this.compileArgument(n));break;default:throw new Error("Message element does not have a valid type")}return a},n.prototype.compileMessageText=function(e){return this.currentPlural&&/(^|[^\\])#/g.test(e.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new i(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,e.value)):e.value.replace(/\\#/g,"#")},n.prototype.compileArgument=function(e){var t=e.format;if(!t)return new o(e.id);var r,n=this.formats,i=this.locales,l=this.pluralFn;switch(t.type){case"numberFormat":return r=n.number[t.style],{id:e.id,format:new Intl.NumberFormat(i,r).format};case"dateFormat":return r=n.date[t.style],{id:e.id,format:new Intl.DateTimeFormat(i,r).format};case"timeFormat":return r=n.time[t.style],{id:e.id,format:new Intl.DateTimeFormat(i,r).format};case"pluralFormat":return r=this.compileOptions(e),new a(e.id,t.ordinal,t.offset,r,l);case"selectFormat":return r=this.compileOptions(e),new u(e.id,r);default:throw new Error("Message element does not have a valid format type")}},n.prototype.compileOptions=function(e){var t=e.format,r=t.options,n={};this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===t.type?e:null;var o,a,i;for(o=0,a=r.length;o<a;o+=1)i=r[o],n[i.selector]=this.compileMessage(i.value);return this.currentPlural=this.pluralStack.pop(),n},o.prototype.format=function(e){return e?"string"==typeof e?e:String(e):""},a.prototype.getOption=function(e){var t=this.options,r=t["="+e]||t[this.pluralFn(e-this.offset,this.useOrdinal)];return r||t.other},i.prototype.format=function(e){var t=this.numberFormat.format(e-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+t).replace(/\\#/g,"#")},u.prototype.getOption=function(e){var t=this.options;return t[e]||t.other};var V=function(){function e(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function t(e,t,r,n,o,a){this.message=e,this.expected=t,this.found=r,this.offset=n,this.line=o,this.column=a,this.name="SyntaxError"}function r(e){function r(t){function r(t,r,n){var o,a;for(o=r;o<n;o++)a=e.charAt(o),"\n"===a?(t.seenCR||t.line++,t.column=1,t.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(t.line++,t.column=1,t.seenCR=!0):(t.column++,t.seenCR=!1)}return Je!==t&&(Je>t&&(Je=0,Ke={line:1,column:1,seenCR:!1}),r(Ke,Je,t),Je=t),Ke}function n(e){$e<Qe||($e>Qe&&(Qe=$e,Xe=[]),Xe.push(e))}function o(n,o,a){function i(e){var t=1;for(e.sort(function(e,t){return e.description<t.description?-1:e.description>t.description?1:0});t<e.length;)e[t-1]===e[t]?e.splice(t,1):t++}function u(e,t){function r(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var n,o,a,i=new Array(e.length);for(a=0;a<e.length;a++)i[a]=e[a].description;return n=e.length>1?i.slice(0,-1).join(", ")+" or "+i[e.length-1]:i[0],o=t?'"'+r(t)+'"':"end of input","Expected "+n+" but "+o+" found."}var l=r(a),s=a<e.length?e.charAt(a):null;return null!==o&&i(o),new t(null!==n?n:u(o,s),o,s,a,l.line,l.column)}function a(){var e;return e=i()}function i(){var e,t,r;for(e=$e,t=[],r=u();r!==k;)t.push(r),r=u();return t!==k&&(Be=e,t=R(t)),e=t}function u(){var e;return e=s(),e===k&&(e=f()),e}function l(){var t,r,n,o,a,i;if(t=$e,r=[],n=$e,o=F(),o!==k?(a=T(),a!==k?(i=F(),i!==k?(o=[o,a,i],n=o):($e=n,n=S)):($e=n,n=S)):($e=n,n=S),n!==k)for(;n!==k;)r.push(n),n=$e,o=F(),o!==k?(a=T(),a!==k?(i=F(),i!==k?(o=[o,a,i],n=o):($e=n,n=S)):($e=n,n=S)):($e=n,n=S);else r=S;return r!==k&&(Be=t,r=D(r)),t=r,t===k&&(t=$e,r=_(),r!==k&&(r=e.substring(t,$e)),t=r),t}function s(){var e,t;return e=$e,t=l(),t!==k&&(Be=e,t=E(t)),e=t}function c(){var t,r,o;if(t=P(),t===k){if(t=$e,r=[],I.test(e.charAt($e))?(o=e.charAt($e),$e++):(o=k,0===Ye&&n(L)),o!==k)for(;o!==k;)r.push(o),I.test(e.charAt($e))?(o=e.charAt($e),$e++):(o=k,0===Ye&&n(L));else r=S;r!==k&&(r=e.substring(t,$e)),t=r}return t}function f(){var t,r,o,a,i,u,l,s,f;return t=$e,123===e.charCodeAt($e)?(r=U,$e++):(r=k,0===Ye&&n(G)),r!==k?(o=F(),o!==k?(a=c(),a!==k?(i=F(),i!==k?(u=$e,44===e.charCodeAt($e)?(l=W,$e++):(l=k,0===Ye&&n(H)),l!==k?(s=F(),s!==k?(f=p(),f!==k?(l=[l,s,f],u=l):($e=u,u=S)):($e=u,u=S)):($e=u,u=S),u===k&&(u=q),u!==k?(l=F(),l!==k?(125===e.charCodeAt($e)?(s=z,$e++):(s=k,0===Ye&&n(V)),s!==k?(Be=t,r=Z(a,u),t=r):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S),t}function p(){var e;return e=h(),e===k&&(e=d(),e===k&&(e=m(),e===k&&(e=y()))),e}function h(){var t,r,o,a,i,u,l;return t=$e,e.substr($e,6)===$?(r=$,$e+=6):(r=k,0===Ye&&n(B)),r===k&&(e.substr($e,4)===J?(r=J,$e+=4):(r=k,0===Ye&&n(K)),r===k&&(e.substr($e,4)===Q?(r=Q,$e+=4):(r=k,0===Ye&&n(X)))),r!==k?(o=F(),o!==k?(a=$e,44===e.charCodeAt($e)?(i=W,$e++):(i=k,0===Ye&&n(H)),i!==k?(u=F(),u!==k?(l=T(),l!==k?(i=[i,u,l],a=i):($e=a,a=S)):($e=a,a=S)):($e=a,a=S),a===k&&(a=q),a!==k?(Be=t,r=Y(r,a),t=r):($e=t,t=S)):($e=t,t=S)):($e=t,t=S),t}function d(){var t,r,o,a,i,u;return t=$e,e.substr($e,6)===ee?(r=ee,$e+=6):(r=k,0===Ye&&n(te)),r!==k?(o=F(),o!==k?(44===e.charCodeAt($e)?(a=W,$e++):(a=k,0===Ye&&n(H)),a!==k?(i=F(),i!==k?(u=w(),u!==k?(Be=t,r=re(u),t=r):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S),t}function m(){var t,r,o,a,i,u;return t=$e,e.substr($e,13)===ne?(r=ne,$e+=13):(r=k,0===Ye&&n(oe)),r!==k?(o=F(),o!==k?(44===e.charCodeAt($e)?(a=W,$e++):(a=k,0===Ye&&n(H)),a!==k?(i=F(),i!==k?(u=w(),u!==k?(Be=t,r=ae(u),t=r):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S),t}function y(){var t,r,o,a,i,u,l;if(t=$e,e.substr($e,6)===ie?(r=ie,$e+=6):(r=k,0===Ye&&n(ue)),r!==k)if(o=F(),o!==k)if(44===e.charCodeAt($e)?(a=W,$e++):(a=k,0===Ye&&n(H)),a!==k)if(i=F(),i!==k){if(u=[],l=g(),l!==k)for(;l!==k;)u.push(l),l=g();else u=S;u!==k?(Be=t,r=le(u),t=r):($e=t,t=S)}else $e=t,t=S;else $e=t,t=S;else $e=t,t=S;else $e=t,t=S;return t}function v(){var t,r,o,a;return t=$e,r=$e,61===e.charCodeAt($e)?(o=se,$e++):(o=k,0===Ye&&n(ce)),o!==k?(a=P(),a!==k?(o=[o,a],r=o):($e=r,r=S)):($e=r,r=S),r!==k&&(r=e.substring(t,$e)),t=r,t===k&&(t=T()),t}function g(){var t,r,o,a,u,l,s,c,f;return t=$e,r=F(),r!==k?(o=v(),o!==k?(a=F(),a!==k?(123===e.charCodeAt($e)?(u=U,$e++):(u=k,0===Ye&&n(G)),u!==k?(l=F(),l!==k?(s=i(),s!==k?(c=F(),c!==k?(125===e.charCodeAt($e)?(f=z,$e++):(f=k,0===Ye&&n(V)),f!==k?(Be=t,r=fe(o,s),t=r):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S)):($e=t,t=S),t}function b(){var t,r,o,a;return t=$e,e.substr($e,7)===pe?(r=pe,$e+=7):(r=k,0===Ye&&n(he)),r!==k?(o=F(),o!==k?(a=P(),a!==k?(Be=t,r=de(a),t=r):($e=t,t=S)):($e=t,t=S)):($e=t,t=S),t}function w(){var e,t,r,n,o;if(e=$e,t=b(),t===k&&(t=q),t!==k)if(r=F(),r!==k){if(n=[],o=g(),o!==k)for(;o!==k;)n.push(o),o=g();else n=S;n!==k?(Be=e,t=me(t,n),e=t):($e=e,e=S)}else $e=e,e=S;else $e=e,e=S;return e}function _(){var t,r;if(Ye++,t=[],ve.test(e.charAt($e))?(r=e.charAt($e),$e++):(r=k,0===Ye&&n(ge)),r!==k)for(;r!==k;)t.push(r),ve.test(e.charAt($e))?(r=e.charAt($e),$e++):(r=k,0===Ye&&n(ge));else t=S;return Ye--,t===k&&(r=k,0===Ye&&n(ye)),t}function F(){var t,r,o;for(Ye++,t=$e,r=[],o=_();o!==k;)r.push(o),o=_();return r!==k&&(r=e.substring(t,$e)),t=r,Ye--,t===k&&(r=k,0===Ye&&n(be)),t}function O(){var t;return we.test(e.charAt($e))?(t=e.charAt($e),$e++):(t=k,0===Ye&&n(_e)),t}function x(){var t;return Fe.test(e.charAt($e))?(t=e.charAt($e),$e++):(t=k,0===Ye&&n(Oe)),t}function P(){var t,r,o,a,i,u;if(t=$e,48===e.charCodeAt($e)?(r=xe,$e++):(r=k,0===Ye&&n(Pe)),r===k){if(r=$e,o=$e,je.test(e.charAt($e))?(a=e.charAt($e),$e++):(a=k,0===Ye&&n(Te)),a!==k){for(i=[],u=O();u!==k;)i.push(u),u=O();i!==k?(a=[a,i],o=a):($e=o,o=S)}else $e=o,o=S;o!==k&&(o=e.substring(r,$e)),r=o}return r!==k&&(Be=t,r=Ae(r)),t=r}function j(){var t,r,o,a,i,u,l,s;return Ce.test(e.charAt($e))?(t=e.charAt($e),$e++):(t=k,0===Ye&&n(ke)),t===k&&(t=$e,e.substr($e,2)===Ne?(r=Ne,$e+=2):(r=k,0===Ye&&n(Me)),r!==k&&(Be=t,r=Re()),t=r,t===k&&(t=$e,e.substr($e,2)===Se?(r=Se,$e+=2):(r=k,0===Ye&&n(De)),r!==k&&(Be=t,r=Ee()),t=r,t===k&&(t=$e,e.substr($e,2)===Ie?(r=Ie,$e+=2):(r=k,0===Ye&&n(Le)),r!==k&&(Be=t,r=Ue()),t=r,t===k&&(t=$e,e.substr($e,2)===Ge?(r=Ge,$e+=2):(r=k,0===Ye&&n(qe)),r!==k&&(Be=t,r=We()),t=r,t===k&&(t=$e,e.substr($e,2)===He?(r=He,$e+=2):(r=k,0===Ye&&n(ze)),r!==k?(o=$e,a=$e,i=x(),i!==k?(u=x(),u!==k?(l=x(),l!==k?(s=x(),s!==k?(i=[i,u,l,s],a=i):($e=a,a=S)):($e=a,a=S)):($e=a,a=S)):($e=a,a=S),a!==k&&(a=e.substring(o,$e)),o=a,o!==k?(Be=t,r=Ve(o),t=r):($e=t,t=S)):($e=t,t=S)))))),t}function T(){var e,t,r;if(e=$e,t=[],r=j(),r!==k)for(;r!==k;)t.push(r),r=j();else t=S;return t!==k&&(Be=e,t=Ze(t)),e=t}var A,C=arguments.length>1?arguments[1]:{},k={},N={start:a},M=a,R=function(e){return{type:"messageFormatPattern",elements:e}},S=k,D=function(e){var t,r,n,o,a,i="";for(t=0,n=e.length;t<n;t+=1)for(o=e[t],r=0,a=o.length;r<a;r+=1)i+=o[r];return i},E=function(e){return{type:"messageTextElement",value:e}},I=/^[^ \t\n\r,.+={}#]/,L={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},U="{",G={type:"literal",value:"{",description:'"{"'},q=null,W=",",H={type:"literal",value:",",description:'","'},z="}",V={type:"literal",value:"}",description:'"}"'},Z=function(e,t){return{type:"argumentElement",id:e,format:t&&t[2]}},$="number",B={type:"literal",value:"number",description:'"number"'},J="date",K={type:"literal",value:"date",description:'"date"'},Q="time",X={type:"literal",value:"time",description:'"time"'},Y=function(e,t){return{type:e+"Format",style:t&&t[2]}},ee="plural",te={type:"literal",value:"plural",description:'"plural"'},re=function(e){return{type:e.type,ordinal:!1,offset:e.offset||0,options:e.options}},ne="selectordinal",oe={type:"literal",value:"selectordinal",description:'"selectordinal"'},ae=function(e){return{type:e.type,ordinal:!0,offset:e.offset||0,options:e.options}},ie="select",ue={type:"literal",value:"select",description:'"select"'},le=function(e){return{type:"selectFormat",options:e}},se="=",ce={type:"literal",value:"=",description:'"="'},fe=function(e,t){return{type:"optionalFormatPattern",selector:e,value:t}},pe="offset:",he={type:"literal",value:"offset:",description:'"offset:"'},de=function(e){return e},me=function(e,t){return{type:"pluralFormat",offset:e,options:t}},ye={type:"other",description:"whitespace"},ve=/^[ \t\n\r]/,ge={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},be={type:"other",description:"optionalWhitespace"},we=/^[0-9]/,_e={type:"class",value:"[0-9]",description:"[0-9]"},Fe=/^[0-9a-f]/i,Oe={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},xe="0",Pe={type:"literal",value:"0",description:'"0"'},je=/^[1-9]/,Te={type:"class",value:"[1-9]",description:"[1-9]"},Ae=function(e){return parseInt(e,10)},Ce=/^[^{}\\\0-\x1F \t\n\r]/,ke={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},Ne="\\\\",Me={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},Re=function(){return"\\"},Se="\\#",De={type:"literal",value:"\\#",description:'"\\\\#"'},Ee=function(){return"\\#"},Ie="\\{",Le={type:"literal",value:"\\{",description:'"\\\\{"'},Ue=function(){return"{"},Ge="\\}",qe={type:"literal",value:"\\}",description:'"\\\\}"'},We=function(){return"}"},He="\\u",ze={type:"literal",value:"\\u",description:'"\\\\u"'},Ve=function(e){return String.fromCharCode(parseInt(e,16))},Ze=function(e){return e.join("")},$e=0,Be=0,Je=0,Ke={line:1,column:1,seenCR:!1},Qe=0,Xe=[],Ye=0;if("startRule"in C){if(!(C.startRule in N))throw new Error("Can't start parsing from rule \""+C.startRule+'".');M=N[C.startRule]}if(A=M(),A!==k&&$e===e.length)return A;throw A!==k&&$e<e.length&&n({type:"end",description:"end of input"}),o(null,Xe,Qe)}return e(t,Error),{SyntaxError:t,parse:r}}();H(l,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),H(l,"__localeData__",{value:z(null)}),H(l,"__addLocaleData",{value:function(e){if(!e||!e.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");l.__localeData__[e.locale.toLowerCase()]=e}}),H(l,"__parse",{value:V.parse}),H(l,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),l.prototype.resolvedOptions=function(){return{locale:this._locale}},l.prototype._compilePattern=function(e,t,r,o){var a=new n(t,r,o);return a.compile(e)},l.prototype._findPluralRuleFunction=function(e){for(var t=l.__localeData__,r=t[e.toLowerCase()];r;){if(r.pluralRuleFunction)return r.pluralRuleFunction;r=r.parentLocale&&t[r.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+e)},l.prototype._format=function(e,t){var r,n,o,a,i,u="";for(r=0,n=e.length;r<n;r+=1)if(o=e[r],"string"!=typeof o){if(a=o.id,!t||!q.call(t,a))throw new Error("A value must be provided for: "+a);i=t[a],u+=o.options?this._format(o.getOption(i),t):o.format(i)}else u+=o;return u},l.prototype._mergeFormats=function(e,t){var n,o,a={};for(n in e)q.call(e,n)&&(a[n]=o=z(e[n]),t&&q.call(t,n)&&r(o,t[n]));return a},l.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(l.defaultLocale);var t,r,n,o,a=l.__localeData__;for(t=0,r=e.length;t<r;t+=1)for(n=e[t].toLowerCase().split("-");n.length;){if(o=a[n.join("-")])return o.locale;n.pop()}var i=e.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+e.join(", ")+", or the default locale: "+i)};var Z={locale:"en",pluralRuleFunction:function(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return t?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==e&&n?"one":"other"}};l.__addLocaleData(Z),l.defaultLocale="en";var $=Math.round,B=function(e,t){e=+e,t=+t;var r=$(t-e),n=$(r/1e3),o=$(n/60),a=$(o/60),i=$(a/24),u=$(i/7),l=s(i),c=$(12*l),f=$(l);return{millisecond:r,second:n,minute:o,hour:a,day:i,week:u,month:c,year:f}},J=Object.prototype.hasOwnProperty,K=Object.prototype.toString,Q=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),X=Q?Object.defineProperty:function(e,t,r){"get"in r&&e.__defineGetter__?e.__defineGetter__(t,r.get):(!J.call(e,t)||"value"in r)&&(e[t]=r.value)},Y=Object.create||function(e,t){function r(){}var n,o;r.prototype=e,n=new r;for(o in t)J.call(t,o)&&X(n,o,t[o]);return n},ee=Array.prototype.indexOf||function(e,t){var r=this;if(!r.length)return-1;for(var n=t||0,o=r.length;n<o;n++)if(r[n]===e)return n;return-1},te=Array.isArray||function(e){return"[object Array]"===K.call(e)},re=Date.now||function(){return(new Date).getTime()},ne=["second","minute","hour","day","month","year"],oe=["best fit","numeric"];X(c,"__localeData__",{value:Y(null)}),X(c,"__addLocaleData",{value:function(e){if(!e||!e.locale)throw new Error("Locale data provided to IntlRelativeFormat is missing a `locale` property value");c.__localeData__[e.locale.toLowerCase()]=e,l.__addLocaleData(e)}}),X(c,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),X(c,"thresholds",{enumerable:!0,value:{second:45,minute:45,hour:22,day:26,month:11}}),c.prototype.resolvedOptions=function(){return{locale:this._locale,style:this._options.style,units:this._options.units}},c.prototype._compileMessage=function(e){var t,r=this._locales,n=(this._locale,this._fields[e]),o=n.relativeTime,a="",i="";for(t in o.future)o.future.hasOwnProperty(t)&&(a+=" "+t+" {"+o.future[t].replace("{0}","#")+"}");for(t in o.past)o.past.hasOwnProperty(t)&&(i+=" "+t+" {"+o.past[t].replace("{0}","#")+"}");var u="{when, select, future {{0, plural, "+a+"}}past {{0, plural, "+i+"}}}";return new l(u,r)},c.prototype._getMessage=function(e){var t=this._messages;return t[e]||(t[e]=this._compileMessage(e)),t[e]},c.prototype._getRelativeUnits=function(e,t){var r=this._fields[t];if(r.relative)return r.relative[e]},c.prototype._findFields=function(e){for(var t=c.__localeData__,r=t[e.toLowerCase()];r;){if(r.fields)return r.fields;r=r.parentLocale&&t[r.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlRelativeFormat is missing `fields` for :"+e)},c.prototype._format=function(e,t){var r=t&&void 0!==t.now?t.now:re();if(void 0===e&&(e=r),!isFinite(r))throw new RangeError("The `now` option provided to IntlRelativeFormat#format() is not in valid range.");if(!isFinite(e))throw new RangeError("The date value provided to IntlRelativeFormat#format() is not in valid range.");var n=B(r,e),o=this._options.units||this._selectUnits(n),a=n[o];if("numeric"!==this._options.style){var i=this._getRelativeUnits(a,o);if(i)return i}return this._getMessage(o).format({0:Math.abs(a),when:a<0?"past":"future"})},c.prototype._isValidUnits=function(e){if(!e||ee.call(ne,e)>=0)return!0;if("string"==typeof e){var t=/s$/.test(e)&&e.substr(0,e.length-1);if(t&&ee.call(ne,t)>=0)throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+t)}throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+ne.join('", "')+'"')},c.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(c.defaultLocale);var t,r,n,o,a=c.__localeData__;for(t=0,r=e.length;t<r;t+=1)for(n=e[t].toLowerCase().split("-");n.length;){if(o=a[n.join("-")])return o.locale;n.pop()}var i=e.pop();throw new Error("No locale data has been added to IntlRelativeFormat for: "+e.join(", ")+", or the default locale: "+i)},c.prototype._resolveStyle=function(e){if(!e)return oe[0];if(ee.call(oe,e)>=0)return e;throw new Error('"'+e+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+oe.join('", "')+'"')},c.prototype._selectUnits=function(e){var t,r,n;for(t=0,r=ne.length;t<r&&(n=ne[t],!(Math.abs(e[n])<c.thresholds[n]));t+=1);return n};var ae={locale:"en",pluralRuleFunction:function(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return t?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==e&&n?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}};c.__addLocaleData(ae),c.defaultLocale="en";var ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue=function(){var e="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;return function(t,r,n,o){var a=t&&t.defaultProps,i=arguments.length-3;if(r||0===i||(r={}),r&&a)for(var u in a)void 0===r[u]&&(r[u]=a[u]);else r||(r=a||{});if(1===i)r.children=o;else if(i>1){for(var l=Array(i),s=0;s<i;s++)l[s]=arguments[s+3];r.children=l}return{$$typeof:e,type:t,key:void 0===n?null:""+n,ref:null,props:r,_owner:null}}}(),le=function(e){if("function"==typeof Symbol){if(Symbol.asyncIterator){var t=e[Symbol.asyncIterator];if(null!=t)return t.call(e)}if(Symbol.iterator)return e[Symbol.iterator]()}throw new TypeError("Object is not async iterable")},se=function(){function e(e){this.value=e}function t(t){function r(e,t){return new Promise(function(r,o){var u={key:e,arg:t,resolve:r,reject:o,next:null};i?i=i.next=u:(a=i=u,n(e,t))})}function n(r,a){try{var i=t[r](a),u=i.value;u instanceof e?Promise.resolve(u.value).then(function(e){n("next",e)},function(e){n("throw",e)}):o(i.done?"return":"normal",i.value)}catch(e){o("throw",e)}}function o(e,t){switch(e){case"return":a.resolve({value:t,done:!0});break;case"throw":a.reject(t);break;default:a.resolve({value:t,done:!1})}a=a.next,a?n(a.key,a.arg):i=null}var a,i;this._invoke=r,"function"!=typeof t.return&&(this.return=void 0)}return"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)},{wrap:function(e){return function(){return new t(e.apply(this,arguments))}},await:function(t){return new e(t)}}}(),ce=function(e,t){function r(r,n){return o=!0,n=new Promise(function(t){t(e[r](n))}),{done:!1,value:t(n)}}var n={},o=!1;return"function"==typeof Symbol&&Symbol.iterator&&(n[Symbol.iterator]=function(){return this}),n.next=function(e){return o?(o=!1,e):r("next",e)},"function"==typeof e.throw&&(n.throw=function(e){if(o)throw o=!1,e;return r("throw",e)}),"function"==typeof e.return&&(n.return=function(e){return r("return",e)}),n},fe=function(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,a){try{var i=t[o](a),u=i.value}catch(e){return void r(e)}return i.done?void e(u):Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)})}return n("next")})}},pe=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},he=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),de=function(e,t){for(var r in t){var n=t[r];n.configurable=n.enumerable=!0,"value"in n&&(n.writable=!0),
|
|
2
|
-
Object.defineProperty(e,r,n)}return e},me=function(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],a=Object.getOwnPropertyDescriptor(t,o);a&&a.configurable&&void 0===e[o]&&Object.defineProperty(e,o,a)}return e},ye=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},ve=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ge=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)},be=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},we=function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t},_e=function(e){return e&&e.__esModule?e:{default:e}},Fe=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},Oe=function(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")},xe=function(e){if(null==e)throw new TypeError("Cannot destructure undefined")},Pe=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},je=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},Te="undefined"==typeof global?self:global,Ae=function e(t,r,n,o){var a=Object.getOwnPropertyDescriptor(t,r);if(void 0===a){var i=Object.getPrototypeOf(t);null!==i&&e(i,r,n,o)}else if("value"in a&&a.writable)a.value=n;else{var u=a.set;void 0!==u&&u.call(o,n)}return n},Ce=function(){function e(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw a}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),ke=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){for(var r,n=[],o=e[Symbol.iterator]();!(r=o.next()).done&&(n.push(r.value),!t||n.length!==t););return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")},Ne=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))},Me=function(e,t){return e.raw=t,e},Re=function(e,t,r){if(e===r)throw new ReferenceError(t+" is not defined - temporal dead zone");return e},Se={},De=function(e){return Array.isArray(e)?e:Array.from(e)},Ee=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},Ie=Object.freeze({jsx:ue,asyncIterator:le,asyncGenerator:se,asyncGeneratorDelegate:ce,asyncToGenerator:fe,classCallCheck:pe,createClass:he,defineEnumerableProperties:de,defaults:me,defineProperty:ye,get:ge,inherits:be,interopRequireDefault:_e,interopRequireWildcard:Fe,newArrowCheck:Oe,objectDestructuringEmpty:xe,objectWithoutProperties:Pe,possibleConstructorReturn:je,selfGlobal:Te,set:Ae,slicedToArray:Ce,slicedToArrayLoose:ke,taggedTemplateLiteral:Ne,taggedTemplateLiteralLoose:Me,temporalRef:Re,temporalUndefined:Se,toArray:De,toConsumableArray:Ee,typeof:ie,extends:ve,instanceof:we}),Le=t.PropTypes.bool,Ue=t.PropTypes.number,Ge=t.PropTypes.string,qe=t.PropTypes.func,We=t.PropTypes.object,He=t.PropTypes.oneOf,ze=t.PropTypes.shape,Ve=t.PropTypes.node,Ze=He(["best fit","lookup"]),$e=He(["narrow","short","long"]),Be=He(["numeric","2-digit"]),Je=qe.isRequired,Ke={locale:Ge,formats:We,messages:We,textComponent:Ve,defaultLocale:Ge,defaultFormats:We},Qe={formatDate:Je,formatTime:Je,formatRelative:Je,formatNumber:Je,formatPlural:Je,formatMessage:Je,formatHTMLMessage:Je},Xe=ze(Ie.extends({},Ke,Qe,{formatters:We,now:Je})),Ye={localeMatcher:Ze,formatMatcher:He(["basic","best fit"]),timeZone:Ge,hour12:Le,weekday:$e,era:$e,year:Be,month:He(["numeric","2-digit","narrow","short","long"]),day:Be,hour:Be,minute:Be,second:Be,timeZoneName:He(["short","long"])},et={localeMatcher:Ze,style:He(["decimal","currency","percent"]),currency:Ge,currencyDisplay:He(["symbol","code","name"]),useGrouping:Le,minimumIntegerDigits:Ue,minimumFractionDigits:Ue,maximumFractionDigits:Ue,minimumSignificantDigits:Ue,maximumSignificantDigits:Ue},tt={style:He(["best fit","numeric"]),units:He(["second","minute","hour","day","month","year"])},rt={style:He(["cardinal","ordinal"])},nt="production",ot=function(e,t,r,n,o,a,i,u){if("production"!==nt&&void 0===t)throw new Error("invariant requires an error message argument");if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,a,i,u],c=0;l=new Error(t.replace(/%s/g,function(){return s[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},at=ot,it=Object.keys(Ke),ut={"&":"&",">":">","<":"<",'"':""","'":"'"},lt=/[&><"']/g,st=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};pe(this,e);var n="ordinal"===r.style,o=O(F(t));this.format=function(e){return o(e,n)}},ct=Function.prototype.bind||function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),r=this,n=function(){},o=function(){return r.apply(this instanceof n?this:e,t.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(n.prototype=this.prototype),o.prototype=new n,o},ft=Object.prototype.hasOwnProperty,pt=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),ht=pt?Object.defineProperty:function(e,t,r){"get"in r&&e.__defineGetter__?e.__defineGetter__(t,r.get):(!ft.call(e,t)||"value"in r)&&(e[t]=r.value)},dt=Object.create||function(e,t){function r(){}var n,o;r.prototype=e,n=new r;for(o in t)ft.call(t,o)&&ht(n,o,t[o]);return n},mt=Object.keys(Ye),yt=Object.keys(et),vt=Object.keys(tt),gt=Object.keys(rt),bt={second:60,minute:60,hour:24,day:30,month:12},wt=Object.freeze({formatDate:C,formatTime:k,formatRelative:N,formatNumber:M,formatPlural:R,formatMessage:S,formatHTMLMessage:D}),_t=Object.keys(Ke),Ft=Object.keys(Qe),Ot={formats:{},messages:{},textComponent:"span",defaultLocale:"en",defaultFormats:{}},xt=function(e){function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};pe(this,r);var n=je(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));at("undefined"!=typeof Intl,"[React Intl] The `Intl` APIs must be available in the runtime, and do not appear to be built-in. An `Intl` polyfill should be loaded.\nSee: http://formatjs.io/guides/runtime-environments/");var o=t.intl,a=void 0;a=isFinite(e.initialNow)?Number(e.initialNow):o?o.now():Date.now();var i=o||{},u=i.formatters,s=void 0===u?{getDateTimeFormat:x(Intl.DateTimeFormat),getNumberFormat:x(Intl.NumberFormat),getMessageFormat:x(l),getRelativeFormat:x(c),getPluralFormat:x(st)}:u;return n.state=Ie.extends({},s,{now:function(){return n._didDisplay?Date.now():a}}),n}return be(r,e),he(r,[{key:"getConfig",value:function(){var e=this.context.intl,t=m(this.props,_t,e);for(var r in Ot)void 0===t[r]&&(t[r]=Ot[r]);if(!p(t.locale)){var n=t,o=(n.locale,n.defaultLocale),a=n.defaultFormats;t=Ie.extends({},t,{locale:o,formats:a,messages:Ot.messages})}return t}},{key:"getBoundFormatFns",value:function(e,t){return Ft.reduce(function(r,n){return r[n]=wt[n].bind(null,e,t),r},{})}},{key:"getChildContext",value:function(){var e=this.getConfig(),t=this.getBoundFormatFns(e,this.state),r=this.state,n=r.now,o=Pe(r,["now"]);return{intl:Ie.extends({},e,t,{formatters:o,now:n})}}},{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.apply(void 0,[this].concat(t))}},{key:"componentDidMount",value:function(){this._didDisplay=!0}},{key:"render",value:function(){return t.Children.only(this.props.children)}}]),r}(t.Component);xt.displayName="IntlProvider",xt.contextTypes={intl:Xe},xt.childContextTypes={intl:Xe.isRequired};var Pt=function(e){function t(e,r){pe(this,t);var n=je(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return y(r),n}return be(t,e),he(t,[{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.apply(void 0,[this].concat(t))}},{key:"render",value:function(){var e=this.context.intl,t=e.formatDate,r=e.textComponent,n=this.props,o=n.value,a=n.children,i=t(o,this.props);return"function"==typeof a?a(i):U.createElement(r,null,i)}}]),t}(t.Component);Pt.displayName="FormattedDate",Pt.contextTypes={intl:Xe};var jt=function(e){function t(e,r){pe(this,t);var n=je(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return y(r),n}return be(t,e),he(t,[{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.apply(void 0,[this].concat(t))}},{key:"render",value:function(){var e=this.context.intl,t=e.formatTime,r=e.textComponent,n=this.props,o=n.value,a=n.children,i=t(o,this.props);return"function"==typeof a?a(i):U.createElement(r,null,i)}}]),t}(t.Component);jt.displayName="FormattedTime",jt.contextTypes={intl:Xe};var Tt=1e3,At=6e4,Ct=36e5,kt=864e5,Nt=2147483647,Mt=function(e){function t(e,r){pe(this,t);var n=je(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));y(r);var o=isFinite(e.initialNow)?Number(e.initialNow):r.intl.now();return n.state={now:o},n}return be(t,e),he(t,[{key:"scheduleNextUpdate",value:function(e,t){var r=this,n=e.updateInterval;if(n){var o=new Date(e.value).getTime(),a=o-t.now,i=e.units||E(a),u=I(i),l=Math.abs(a%u),s=a<0?Math.max(n,u-l):Math.max(n,l);clearTimeout(this._timer),this._timer=setTimeout(function(){r.setState({now:r.context.intl.now()})},s)}}},{key:"componentDidMount",value:function(){this.scheduleNextUpdate(this.props,this.state)}},{key:"componentWillReceiveProps",value:function(e){var t=e.value;L(t,this.props.value)||this.setState({now:this.context.intl.now()})}},{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.apply(void 0,[this].concat(t))}},{key:"componentWillUpdate",value:function(e,t){this.scheduleNextUpdate(e,t)}},{key:"componentWillUnmount",value:function(){clearTimeout(this._timer)}},{key:"render",value:function(){var e=this.context.intl,t=e.formatRelative,r=e.textComponent,n=this.props,o=n.value,a=n.children,i=t(o,Ie.extends({},this.props,this.state));return"function"==typeof a?a(i):U.createElement(r,null,i)}}]),t}(t.Component);Mt.displayName="FormattedRelative",Mt.contextTypes={intl:Xe},Mt.defaultProps={updateInterval:1e4};var Rt=function(e){function t(e,r){pe(this,t);var n=je(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return y(r),n}return be(t,e),he(t,[{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.apply(void 0,[this].concat(t))}},{key:"render",value:function(){var e=this.context.intl,t=e.formatNumber,r=e.textComponent,n=this.props,o=n.value,a=n.children,i=t(o,this.props);return"function"==typeof a?a(i):U.createElement(r,null,i)}}]),t}(t.Component);Rt.displayName="FormattedNumber",Rt.contextTypes={intl:Xe};var St=function(e){function t(e,r){pe(this,t);var n=je(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return y(r),n}return be(t,e),he(t,[{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.apply(void 0,[this].concat(t))}},{key:"render",value:function(){var e=this.context.intl,t=e.formatPlural,r=e.textComponent,n=this.props,o=n.value,a=n.other,i=n.children,u=t(o,this.props),l=this.props[u]||a;return"function"==typeof i?i(l):U.createElement(r,null,l)}}]),t}(t.Component);St.displayName="FormattedPlural",St.contextTypes={intl:Xe},St.defaultProps={style:"cardinal"};var Dt=function(e){function r(e,t){pe(this,r);var n=je(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return y(t),n}return be(r,e),he(r,[{key:"shouldComponentUpdate",value:function(e){var t=this.props.values,r=e.values;if(!v(r,t))return!0;for(var n=Ie.extends({},e,{values:t}),o=arguments.length,a=Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return g.apply(void 0,[this,n].concat(a))}},{key:"render",value:function(){var e=this.context.intl,r=e.formatMessage,n=e.textComponent,o=this.props,a=o.id,i=o.description,u=o.defaultMessage,l=o.values,s=o.tagName,c=void 0===s?n:s,f=o.children,p=void 0,h=void 0,d=void 0,m=l&&Object.keys(l).length>0;m&&!function(){var e=Math.floor(1099511627776*Math.random()).toString(16),r=function(){var t=0;return function(){return"ELEMENT-"+e+"-"+(t+=1)}}();p="@__"+e+"__@",h={},d={},Object.keys(l).forEach(function(e){var n=l[e];if(t.isValidElement(n)){var o=r();h[e]=p+o+p,d[o]=n}else h[e]=n})}();var y={id:a,description:i,defaultMessage:u},v=r(y,h||l),g=void 0,b=d&&Object.keys(d).length>0;return g=b?v.split(p).filter(function(e){return!!e}).map(function(e){return d[e]||e}):[v],"function"==typeof f?f.apply(void 0,Ee(g)):U.createElement(c,null,g)}}]),r}(t.Component);Dt.displayName="FormattedMessage",Dt.contextTypes={intl:Xe},Dt.defaultProps={values:{}};var Et=function(e){function t(e,r){pe(this,t);var n=je(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return y(r),n}return be(t,e),he(t,[{key:"shouldComponentUpdate",value:function(e){var t=this.props.values,r=e.values;if(!v(r,t))return!0;for(var n=Ie.extends({},e,{values:t}),o=arguments.length,a=Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return g.apply(void 0,[this,n].concat(a))}},{key:"render",value:function(){var e=this.context.intl,t=e.formatHTMLMessage,r=e.textComponent,n=this.props,o=n.id,a=n.description,i=n.defaultMessage,u=n.values,l=n.tagName,s=void 0===l?r:l,c=n.children,f={id:o,description:a,defaultMessage:i},p=t(f,u);if("function"==typeof c)return c(p);var h={__html:p};return U.createElement(s,{dangerouslySetInnerHTML:h})}}]),t}(t.Component);Et.displayName="FormattedHTMLMessage",Et.contextTypes={intl:Xe},Et.defaultProps={values:{}},f(G),e.addLocaleData=f,e.intlShape=Xe,e.injectIntl=w,e.defineMessages=_,e.IntlProvider=xt,e.FormattedDate=Pt,e.FormattedTime=jt,e.FormattedRelative=Mt,e.FormattedNumber=Rt,e.FormattedPlural=St,e.FormattedMessage=Dt,e.FormattedHTMLMessage=Et,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prop-types"),require("react")):"function"==typeof define&&define.amd?define(["exports","prop-types","react"],e):e(t.ReactIntl=t.ReactIntl||{},t.PropTypes,t.React)}(this,function(t,e,r){"use strict";function n(t){var e,r,n,o,a=Array.prototype.slice.call(arguments,1);for(e=0,r=a.length;e<r;e+=1)if(n=a[e])for(o in n)H.call(n,o)&&(t[o]=n[o]);return t}function o(t,e,r){this.locales=t,this.formats=e,this.pluralFn=r}function a(t){this.id=t}function i(t,e,r,n,o){this.id=t,this.useOrdinal=e,this.offset=r,this.options=n,this.pluralFn=o}function l(t,e,r,n){this.id=t,this.offset=e,this.numberFormat=r,this.string=n}function u(t,e){this.id=t,this.options=e}function s(t,e,r){var n="string"==typeof t?s.__parse(t):t;if(!n||"messageFormatPattern"!==n.type)throw new TypeError("A message must be provided as a String or AST.");r=this._mergeFormats(s.formats,r),V(this,"_locale",{value:this._resolveLocale(e)});var o=this._findPluralRuleFunction(this._locale),a=this._compilePattern(n,e,r,o),i=this;this.format=function(t){return i._format(a,t)}}function c(t){return 400*t/146097}function f(t,e){e=e||{},rt(t)&&(t=t.concat()),Y(this,"_locale",{value:this._resolveLocale(t)}),Y(this,"_options",{value:{style:this._resolveStyle(e.style),units:this._isValidUnits(e.units)&&e.units}}),Y(this,"_locales",{value:t}),Y(this,"_fields",{value:this._findFields(this._locale)}),Y(this,"_messages",{value:tt(null)});var r=this;this.format=function(t,e){return r._format(t,e)}}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=Array.isArray(t)?t:[t];e.forEach(function(t){t&&t.locale&&(s.__addLocaleData(t),f.__addLocaleData(t))})}function h(t){for(var e=(t||"").split("-");e.length>0;){if(m(e.join("-")))return!0;e.pop()}return!1}function m(t){var e=t&&t.toLowerCase();return!(!s.__localeData__[e]||!f.__localeData__[e])}function d(t){return(""+t).replace(qt,function(t){return Ut[t]})}function y(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.reduce(function(e,n){return t.hasOwnProperty(n)?e[n]=t[n]:r.hasOwnProperty(n)&&(e[n]=r[n]),e},{})}function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.intl;It(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}function g(t,e){if(t===e)return!0;if("object"!==("undefined"==typeof t?"undefined":lt(t))||null===t||"object"!==("undefined"==typeof e?"undefined":lt(e))||null===e)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(e),a=0;a<r.length;a++)if(!o(r[a])||t[r[a]]!==e[r[a]])return!1;return!0}function _(t,e,r){var n=t.props,o=t.state,a=t.context,i=void 0===a?{}:a,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=i.intl,s=void 0===u?{}:u,c=l.intl,f=void 0===c?{}:c;return!g(e,n)||!g(r,o)||!(f===s||g(y(f,St),y(s,St)))}function b(t){return t.displayName||t.name||"Component"}function w(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.intlPropName,o=void 0===n?"intl":n,a=e.withRef,i=void 0!==a&&a,l=function(e){function r(t,e){ut(this,r);var n=mt(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));return v(e),n}return pt(r,e),st(r,[{key:"getWrappedInstance",value:function(){return It(i,"[React Intl] To access the wrapped instance, the `{withRef: true}` option must be set when calling: `injectIntl()`"),this.refs.wrappedInstance}},{key:"render",value:function(){return q.createElement(t,ft({},this.props,ct({},o,this.context.intl),{ref:i?"wrappedInstance":null}))}}]),r}(r.Component);return l.displayName="InjectIntl("+b(t)+")",l.contextTypes={intl:Nt},l.WrappedComponent=t,l}function F(t){return t}function O(t){return s.prototype._resolveLocale(t)}function x(t){return s.prototype._findPluralRuleFunction(t)}function j(t){var e=Bt(null);return function(){var r=Array.prototype.slice.call(arguments),n=C(r),o=n&&e[n];return o||(o=new(Ht.apply(t,[null].concat(r))),n&&(e[n]=o)),o}}function C(t){if("undefined"!=typeof JSON){var e,r,n,o=[];for(e=0,r=t.length;e<r;e+=1)n=t[e],n&&"object"==typeof n?o.push(P(n)):o.push(n);return JSON.stringify(o)}}function P(t){var e,r,n,o,a=[],i=[];for(e in t)t.hasOwnProperty(e)&&i.push(e);var l=i.sort();for(r=0,n=l.length;r<n;r+=1)e=l[r],o={},o[e]=t[e],a[r]=o;return a}function T(t){var e=f.thresholds;e.second=t.second,e.minute=t.minute,e.hour=t.hour,e.day=t.day,e.month=t.month}function A(t,e,r){var n=t&&t[e]&&t[e][r];if(n)return n}function N(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=new Date(r),u=i&&A(a,"date",i),s=y(n,Jt,u);try{return e.getDateTimeFormat(o,s).format(l)}catch(t){}return String(l)}function M(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=new Date(r),u=i&&A(a,"time",i),s=y(n,Jt,u);s.hour||s.minute||s.second||(s=ft({},s,{hour:"numeric",minute:"numeric"}));try{return e.getDateTimeFormat(o,s).format(l)}catch(t){}return String(l)}function R(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=new Date(r),u=new Date(n.now),s=i&&A(a,"relative",i),c=y(n,zt,s),p=ft({},f.thresholds);T(Qt);try{return e.getRelativeFormat(o,c).format(l,{now:isFinite(u)?u:e.now()})}catch(t){}finally{T(p)}return String(l)}function k(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=i&&A(a,"number",i),u=y(n,$t,l);try{return e.getNumberFormat(o,u).format(r)}catch(t){}return String(r)}function D(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=y(n,Kt);try{return e.getPluralFormat(o,a).format(r)}catch(t){}return"other"}function E(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=t.messages,l=t.defaultLocale,u=t.defaultFormats,s=r.id,c=r.defaultMessage;It(s,"[React Intl] An `id` must be provided to format a message.");var f=i&&i[s],p=Object.keys(n).length>0;if(!p)return f||c||s;var h=void 0;if(f)try{var m=e.getMessageFormat(f,o,a);h=m.format(n)}catch(t){}if(!h&&c)try{var d=e.getMessageFormat(c,l,u);h=d.format(n)}catch(t){}return h||f||c||s}function L(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Object.keys(n).reduce(function(t,e){var r=n[e];return t[e]="string"==typeof r?d(r):r,t},{});return E(t,e,r,o)}function I(t){var e=Math.abs(t);return e<ie?"second":e<le?"minute":e<ue?"hour":"day"}function S(t){switch(t){case"second":return ae;case"minute":return ie;case"hour":return le;case"day":return ue;default:return se}}function U(t,e){if(t===e)return!0;var r=new Date(t).getTime(),n=new Date(e).getTime();return isFinite(r)&&isFinite(n)&&r===n}if("undefined"==typeof r)throw new ReferenceError("React must be loaded before ReactIntl.");e="default"in e?e.default:e;var q="default"in r?r.default:r,G={locale:"en",pluralRuleFunction:function(t,e){var r=String(t).split("."),n=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return e?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==t&&n?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}},H=Object.prototype.hasOwnProperty,W=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),V=W?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!H.call(t,e)||"value"in r)&&(t[e]=r.value)},Z=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)H.call(e,o)&&V(n,o,e[o]);return n};o.prototype.compile=function(t){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(t)},o.prototype.compileMessage=function(t){if(!t||"messageFormatPattern"!==t.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var e,r,n,o=t.elements,a=[];for(e=0,r=o.length;e<r;e+=1)switch(n=o[e],n.type){case"messageTextElement":a.push(this.compileMessageText(n));break;case"argumentElement":a.push(this.compileArgument(n));break;default:throw new Error("Message element does not have a valid type")}return a},o.prototype.compileMessageText=function(t){return this.currentPlural&&/(^|[^\\])#/g.test(t.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new l(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,t.value)):t.value.replace(/\\#/g,"#")},o.prototype.compileArgument=function(t){var e=t.format;if(!e)return new a(t.id);var r,n=this.formats,o=this.locales,l=this.pluralFn;switch(e.type){case"numberFormat":return r=n.number[e.style],{id:t.id,format:new Intl.NumberFormat(o,r).format};case"dateFormat":return r=n.date[e.style],{id:t.id,format:new Intl.DateTimeFormat(o,r).format};case"timeFormat":return r=n.time[e.style],{id:t.id,format:new Intl.DateTimeFormat(o,r).format};case"pluralFormat":return r=this.compileOptions(t),new i(t.id,e.ordinal,e.offset,r,l);case"selectFormat":return r=this.compileOptions(t),new u(t.id,r);default:throw new Error("Message element does not have a valid format type")}},o.prototype.compileOptions=function(t){var e=t.format,r=e.options,n={};this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===e.type?t:null;var o,a,i;for(o=0,a=r.length;o<a;o+=1)i=r[o],n[i.selector]=this.compileMessage(i.value);return this.currentPlural=this.pluralStack.pop(),n},a.prototype.format=function(t){return t?"string"==typeof t?t:String(t):""},i.prototype.getOption=function(t){var e=this.options,r=e["="+t]||e[this.pluralFn(t-this.offset,this.useOrdinal)];return r||e.other},l.prototype.format=function(t){var e=this.numberFormat.format(t-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+e).replace(/\\#/g,"#")},u.prototype.getOption=function(t){var e=this.options;return e[t]||e.other};var B=function(){function t(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function e(t,e,r,n,o,a){this.message=t,this.expected=e,this.found=r,this.offset=n,this.line=o,this.column=a,this.name="SyntaxError"}function r(t){function r(e){function r(e,r,n){var o,a;for(o=r;o<n;o++)a=t.charAt(o),"\n"===a?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(e.line++,e.column=1,e.seenCR=!0):(e.column++,e.seenCR=!1)}return zt!==e&&(zt>e&&(zt=0,Kt={line:1,column:1,seenCR:!1}),r(Kt,zt,e),zt=e),Kt}function n(t){Jt<Qt||(Jt>Qt&&(Qt=Jt,Xt=[]),Xt.push(t))}function o(n,o,a){function i(t){var e=1;for(t.sort(function(t,e){return t.description<e.description?-1:t.description>e.description?1:0});e<t.length;)t[e-1]===t[e]?t.splice(e,1):e++}function l(t,e){function r(t){function e(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+e(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+e(t)}).replace(/[\u0180-\u0FFF]/g,function(t){return"\\u0"+e(t)}).replace(/[\u1080-\uFFFF]/g,function(t){return"\\u"+e(t)})}var n,o,a,i=new Array(t.length);for(a=0;a<t.length;a++)i[a]=t[a].description;return n=t.length>1?i.slice(0,-1).join(", ")+" or "+i[t.length-1]:i[0],o=e?'"'+r(e)+'"':"end of input","Expected "+n+" but "+o+" found."}var u=r(a),s=a<t.length?t.charAt(a):null;return null!==o&&i(o),new e(null!==n?n:l(o,s),o,s,a,u.line,u.column)}function a(){var t;return t=i()}function i(){var t,e,r;for(t=Jt,e=[],r=l();r!==N;)e.push(r),r=l();return e!==N&&($t=t,e=k(e)),t=e}function l(){var t;return t=s(),t===N&&(t=f()),t}function u(){var e,r,n,o,a,i;if(e=Jt,r=[],n=Jt,o=F(),o!==N?(a=P(),a!==N?(i=F(),i!==N?(o=[o,a,i],n=o):(Jt=n,n=D)):(Jt=n,n=D)):(Jt=n,n=D),n!==N)for(;n!==N;)r.push(n),n=Jt,o=F(),o!==N?(a=P(),a!==N?(i=F(),i!==N?(o=[o,a,i],n=o):(Jt=n,n=D)):(Jt=n,n=D)):(Jt=n,n=D);else r=D;return r!==N&&($t=e,r=E(r)),e=r,e===N&&(e=Jt,r=w(),r!==N&&(r=t.substring(e,Jt)),e=r),e}function s(){var t,e;return t=Jt,e=u(),e!==N&&($t=t,e=L(e)),t=e}function c(){var e,r,o;if(e=j(),e===N){if(e=Jt,r=[],I.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=N,0===Yt&&n(S)),o!==N)for(;o!==N;)r.push(o),I.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=N,0===Yt&&n(S));else r=D;r!==N&&(r=t.substring(e,Jt)),e=r}return e}function f(){var e,r,o,a,i,l,u,s,f;return e=Jt,123===t.charCodeAt(Jt)?(r=U,Jt++):(r=N,0===Yt&&n(q)),r!==N?(o=F(),o!==N?(a=c(),a!==N?(i=F(),i!==N?(l=Jt,44===t.charCodeAt(Jt)?(u=H,Jt++):(u=N,0===Yt&&n(W)),u!==N?(s=F(),s!==N?(f=p(),f!==N?(u=[u,s,f],l=u):(Jt=l,l=D)):(Jt=l,l=D)):(Jt=l,l=D),l===N&&(l=G),l!==N?(u=F(),u!==N?(125===t.charCodeAt(Jt)?(s=V,Jt++):(s=N,0===Yt&&n(Z)),s!==N?($t=e,r=B(a,l),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function p(){var t;return t=h(),t===N&&(t=m(),t===N&&(t=d(),t===N&&(t=y()))),t}function h(){var e,r,o,a,i,l,u;return e=Jt,t.substr(Jt,6)===J?(r=J,Jt+=6):(r=N,0===Yt&&n($)),r===N&&(t.substr(Jt,4)===z?(r=z,Jt+=4):(r=N,0===Yt&&n(K)),r===N&&(t.substr(Jt,4)===Q?(r=Q,Jt+=4):(r=N,0===Yt&&n(X)))),r!==N?(o=F(),o!==N?(a=Jt,44===t.charCodeAt(Jt)?(i=H,Jt++):(i=N,0===Yt&&n(W)),i!==N?(l=F(),l!==N?(u=P(),u!==N?(i=[i,l,u],a=i):(Jt=a,a=D)):(Jt=a,a=D)):(Jt=a,a=D),a===N&&(a=G),a!==N?($t=e,r=Y(r,a),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function m(){var e,r,o,a,i,l;return e=Jt,t.substr(Jt,6)===tt?(r=tt,Jt+=6):(r=N,0===Yt&&n(et)),r!==N?(o=F(),o!==N?(44===t.charCodeAt(Jt)?(a=H,Jt++):(a=N,0===Yt&&n(W)),a!==N?(i=F(),i!==N?(l=b(),l!==N?($t=e,r=rt(l),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function d(){var e,r,o,a,i,l;return e=Jt,t.substr(Jt,13)===nt?(r=nt,Jt+=13):(r=N,0===Yt&&n(ot)),r!==N?(o=F(),o!==N?(44===t.charCodeAt(Jt)?(a=H,Jt++):(a=N,0===Yt&&n(W)),a!==N?(i=F(),i!==N?(l=b(),l!==N?($t=e,r=at(l),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function y(){var e,r,o,a,i,l,u;if(e=Jt,t.substr(Jt,6)===it?(r=it,Jt+=6):(r=N,0===Yt&&n(lt)),r!==N)if(o=F(),o!==N)if(44===t.charCodeAt(Jt)?(a=H,Jt++):(a=N,0===Yt&&n(W)),a!==N)if(i=F(),i!==N){if(l=[],u=g(),u!==N)for(;u!==N;)l.push(u),u=g();else l=D;l!==N?($t=e,r=ut(l),e=r):(Jt=e,e=D)}else Jt=e,e=D;else Jt=e,e=D;else Jt=e,e=D;else Jt=e,e=D;return e}function v(){var e,r,o,a;return e=Jt,r=Jt,61===t.charCodeAt(Jt)?(o=st,Jt++):(o=N,0===Yt&&n(ct)),o!==N?(a=j(),a!==N?(o=[o,a],r=o):(Jt=r,r=D)):(Jt=r,r=D),r!==N&&(r=t.substring(e,Jt)),e=r,e===N&&(e=P()),e}function g(){var e,r,o,a,l,u,s,c,f;return e=Jt,r=F(),r!==N?(o=v(),o!==N?(a=F(),a!==N?(123===t.charCodeAt(Jt)?(l=U,Jt++):(l=N,0===Yt&&n(q)),l!==N?(u=F(),u!==N?(s=i(),s!==N?(c=F(),c!==N?(125===t.charCodeAt(Jt)?(f=V,Jt++):(f=N,0===Yt&&n(Z)),f!==N?($t=e,r=ft(o,s),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function _(){var e,r,o,a;return e=Jt,t.substr(Jt,7)===pt?(r=pt,Jt+=7):(r=N,0===Yt&&n(ht)),r!==N?(o=F(),o!==N?(a=j(),a!==N?($t=e,r=mt(a),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function b(){var t,e,r,n,o;if(t=Jt,e=_(),e===N&&(e=G),e!==N)if(r=F(),r!==N){if(n=[],o=g(),o!==N)for(;o!==N;)n.push(o),o=g();else n=D;n!==N?($t=t,e=dt(e,n),t=e):(Jt=t,t=D)}else Jt=t,t=D;else Jt=t,t=D;return t}function w(){var e,r;if(Yt++,e=[],vt.test(t.charAt(Jt))?(r=t.charAt(Jt),Jt++):(r=N,0===Yt&&n(gt)),r!==N)for(;r!==N;)e.push(r),vt.test(t.charAt(Jt))?(r=t.charAt(Jt),Jt++):(r=N,0===Yt&&n(gt));else e=D;return Yt--,e===N&&(r=N,0===Yt&&n(yt)),e}function F(){var e,r,o;for(Yt++,e=Jt,r=[],o=w();o!==N;)r.push(o),o=w();return r!==N&&(r=t.substring(e,Jt)),e=r,Yt--,e===N&&(r=N,0===Yt&&n(_t)),e}function O(){var e;return bt.test(t.charAt(Jt))?(e=t.charAt(Jt),Jt++):(e=N,0===Yt&&n(wt)),e}function x(){var e;return Ft.test(t.charAt(Jt))?(e=t.charAt(Jt),Jt++):(e=N,0===Yt&&n(Ot)),e}function j(){var e,r,o,a,i,l;if(e=Jt,48===t.charCodeAt(Jt)?(r=xt,Jt++):(r=N,0===Yt&&n(jt)),r===N){if(r=Jt,o=Jt,Ct.test(t.charAt(Jt))?(a=t.charAt(Jt),Jt++):(a=N,0===Yt&&n(Pt)),a!==N){for(i=[],l=O();l!==N;)i.push(l),l=O();i!==N?(a=[a,i],o=a):(Jt=o,o=D)}else Jt=o,o=D;o!==N&&(o=t.substring(r,Jt)),r=o}return r!==N&&($t=e,r=Tt(r)),e=r}function C(){var e,r,o,a,i,l,u,s;return At.test(t.charAt(Jt))?(e=t.charAt(Jt),Jt++):(e=N,0===Yt&&n(Nt)),e===N&&(e=Jt,t.substr(Jt,2)===Mt?(r=Mt,Jt+=2):(r=N,0===Yt&&n(Rt)),r!==N&&($t=e,r=kt()),e=r,e===N&&(e=Jt,t.substr(Jt,2)===Dt?(r=Dt,Jt+=2):(r=N,0===Yt&&n(Et)),r!==N&&($t=e,r=Lt()),e=r,e===N&&(e=Jt,t.substr(Jt,2)===It?(r=It,Jt+=2):(r=N,0===Yt&&n(St)),r!==N&&($t=e,r=Ut()),e=r,e===N&&(e=Jt,t.substr(Jt,2)===qt?(r=qt,Jt+=2):(r=N,0===Yt&&n(Gt)),r!==N&&($t=e,r=Ht()),e=r,e===N&&(e=Jt,t.substr(Jt,2)===Wt?(r=Wt,Jt+=2):(r=N,0===Yt&&n(Vt)),r!==N?(o=Jt,a=Jt,i=x(),i!==N?(l=x(),l!==N?(u=x(),u!==N?(s=x(),s!==N?(i=[i,l,u,s],a=i):(Jt=a,a=D)):(Jt=a,a=D)):(Jt=a,a=D)):(Jt=a,a=D),a!==N&&(a=t.substring(o,Jt)),o=a,o!==N?($t=e,r=Zt(o),e=r):(Jt=e,e=D)):(Jt=e,e=D)))))),e}function P(){var t,e,r;if(t=Jt,e=[],r=C(),r!==N)for(;r!==N;)e.push(r),r=C();else e=D;return e!==N&&($t=t,e=Bt(e)),t=e}var T,A=arguments.length>1?arguments[1]:{},N={},M={start:a},R=a,k=function(t){return{type:"messageFormatPattern",elements:t}},D=N,E=function(t){var e,r,n,o,a,i="";for(e=0,n=t.length;e<n;e+=1)for(o=t[e],r=0,a=o.length;r<a;r+=1)i+=o[r];return i},L=function(t){return{type:"messageTextElement",value:t}},I=/^[^ \t\n\r,.+={}#]/,S={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},U="{",q={type:"literal",value:"{",description:'"{"'},G=null,H=",",W={type:"literal",value:",",description:'","'},V="}",Z={type:"literal",value:"}",description:'"}"'},B=function(t,e){return{type:"argumentElement",id:t,format:e&&e[2]}},J="number",$={type:"literal",value:"number",description:'"number"'},z="date",K={type:"literal",value:"date",description:'"date"'},Q="time",X={type:"literal",value:"time",description:'"time"'},Y=function(t,e){return{type:t+"Format",style:e&&e[2]}},tt="plural",et={type:"literal",value:"plural",description:'"plural"'},rt=function(t){return{type:t.type,ordinal:!1,offset:t.offset||0,options:t.options}},nt="selectordinal",ot={type:"literal",value:"selectordinal",description:'"selectordinal"'},at=function(t){return{type:t.type,ordinal:!0,offset:t.offset||0,options:t.options}},it="select",lt={type:"literal",value:"select",description:'"select"'},ut=function(t){return{type:"selectFormat",options:t}},st="=",ct={type:"literal",value:"=",description:'"="'},ft=function(t,e){return{type:"optionalFormatPattern",selector:t,value:e}},pt="offset:",ht={type:"literal",value:"offset:",description:'"offset:"'},mt=function(t){return t},dt=function(t,e){return{type:"pluralFormat",offset:t,options:e}},yt={type:"other",description:"whitespace"},vt=/^[ \t\n\r]/,gt={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},_t={type:"other",description:"optionalWhitespace"},bt=/^[0-9]/,wt={type:"class",value:"[0-9]",description:"[0-9]"},Ft=/^[0-9a-f]/i,Ot={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},xt="0",jt={type:"literal",value:"0",description:'"0"'},Ct=/^[1-9]/,Pt={type:"class",value:"[1-9]",description:"[1-9]"},Tt=function(t){return parseInt(t,10)},At=/^[^{}\\\0-\x1F \t\n\r]/,Nt={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},Mt="\\\\",Rt={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},kt=function(){return"\\"},Dt="\\#",Et={type:"literal",value:"\\#",description:'"\\\\#"'},Lt=function(){return"\\#"},It="\\{",St={type:"literal",value:"\\{",description:'"\\\\{"'},Ut=function(){return"{"},qt="\\}",Gt={type:"literal",value:"\\}",description:'"\\\\}"'},Ht=function(){return"}"},Wt="\\u",Vt={type:"literal",value:"\\u",description:'"\\\\u"'},Zt=function(t){return String.fromCharCode(parseInt(t,16))},Bt=function(t){return t.join("")},Jt=0,$t=0,zt=0,Kt={line:1,column:1,seenCR:!1},Qt=0,Xt=[],Yt=0;if("startRule"in A){if(!(A.startRule in M))throw new Error("Can't start parsing from rule \""+A.startRule+'".');R=M[A.startRule]}if(T=R(),T!==N&&Jt===t.length)return T;throw T!==N&&Jt<t.length&&n({type:"end",description:"end of input"}),o(null,Xt,Qt)}return t(e,Error),{SyntaxError:e,parse:r}}();V(s,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),V(s,"__localeData__",{value:Z(null)}),V(s,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");s.__localeData__[t.locale.toLowerCase()]=t}}),V(s,"__parse",{value:B.parse}),V(s,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),s.prototype.resolvedOptions=function(){return{locale:this._locale}},s.prototype._compilePattern=function(t,e,r,n){var a=new o(e,r,n);return a.compile(t)},s.prototype._findPluralRuleFunction=function(t){for(var e=s.__localeData__,r=e[t.toLowerCase()];r;){if(r.pluralRuleFunction)return r.pluralRuleFunction;r=r.parentLocale&&e[r.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+t)},s.prototype._format=function(t,e){var r,n,o,a,i,l="";for(r=0,n=t.length;r<n;r+=1)if(o=t[r],"string"!=typeof o){if(a=o.id,!e||!H.call(e,a))throw new Error("A value must be provided for: "+a);i=e[a],l+=o.options?this._format(o.getOption(i),e):o.format(i)}else l+=o;return l},s.prototype._mergeFormats=function(t,e){var r,o,a={};for(r in t)H.call(t,r)&&(a[r]=o=Z(t[r]),e&&H.call(e,r)&&n(o,e[r]));return a},s.prototype._resolveLocale=function(t){"string"==typeof t&&(t=[t]),t=(t||[]).concat(s.defaultLocale);var e,r,n,o,a=s.__localeData__;for(e=0,r=t.length;e<r;e+=1)for(n=t[e].toLowerCase().split("-");n.length;){if(o=a[n.join("-")])return o.locale;n.pop()}var i=t.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+t.join(", ")+", or the default locale: "+i)};var J={locale:"en",pluralRuleFunction:function(t,e){var r=String(t).split("."),n=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return e?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==t&&n?"one":"other"}};s.__addLocaleData(J),s.defaultLocale="en";var $=Math.round,z=function(t,e){t=+t,e=+e;var r=$(e-t),n=$(r/1e3),o=$(n/60),a=$(o/60),i=$(a/24),l=$(i/7),u=c(i),s=$(12*u),f=$(u);return{millisecond:r,second:n,minute:o,hour:a,day:i,week:l,month:s,year:f}},K=Object.prototype.hasOwnProperty,Q=Object.prototype.toString,X=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),Y=X?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!K.call(t,e)||"value"in r)&&(t[e]=r.value)},tt=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)K.call(e,o)&&Y(n,o,e[o]);return n},et=Array.prototype.indexOf||function(t,e){var r=this;if(!r.length)return-1;for(var n=e||0,o=r.length;n<o;n++)if(r[n]===t)return n;return-1},rt=Array.isArray||function(t){return"[object Array]"===Q.call(t)},nt=Date.now||function(){return(new Date).getTime()},ot=["second","minute","hour","day","month","year"],at=["best fit","numeric"];Y(f,"__localeData__",{value:tt(null)}),Y(f,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlRelativeFormat is missing a `locale` property value");f.__localeData__[t.locale.toLowerCase()]=t,s.__addLocaleData(t)}}),Y(f,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),Y(f,"thresholds",{enumerable:!0,value:{second:45,minute:45,hour:22,day:26,month:11}}),f.prototype.resolvedOptions=function(){return{locale:this._locale,style:this._options.style,units:this._options.units}},f.prototype._compileMessage=function(t){var e,r=this._locales,n=(this._locale,this._fields[t]),o=n.relativeTime,a="",i="";for(e in o.future)o.future.hasOwnProperty(e)&&(a+=" "+e+" {"+o.future[e].replace("{0}","#")+"}");for(e in o.past)o.past.hasOwnProperty(e)&&(i+=" "+e+" {"+o.past[e].replace("{0}","#")+"}");var l="{when, select, future {{0, plural, "+a+"}}past {{0, plural, "+i+"}}}";return new s(l,r)},f.prototype._getMessage=function(t){var e=this._messages;return e[t]||(e[t]=this._compileMessage(t)),e[t]},f.prototype._getRelativeUnits=function(t,e){var r=this._fields[e];if(r.relative)return r.relative[t]},f.prototype._findFields=function(t){for(var e=f.__localeData__,r=e[t.toLowerCase()];r;){if(r.fields)return r.fields;r=r.parentLocale&&e[r.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlRelativeFormat is missing `fields` for :"+t)},f.prototype._format=function(t,e){var r=e&&void 0!==e.now?e.now:nt();if(void 0===t&&(t=r),!isFinite(r))throw new RangeError("The `now` option provided to IntlRelativeFormat#format() is not in valid range.");if(!isFinite(t))throw new RangeError("The date value provided to IntlRelativeFormat#format() is not in valid range.");var n=z(r,t),o=this._options.units||this._selectUnits(n),a=n[o];if("numeric"!==this._options.style){var i=this._getRelativeUnits(a,o);if(i)return i}return this._getMessage(o).format({0:Math.abs(a),when:a<0?"past":"future"})},f.prototype._isValidUnits=function(t){if(!t||et.call(ot,t)>=0)return!0;if("string"==typeof t){var e=/s$/.test(t)&&t.substr(0,t.length-1);if(e&&et.call(ot,e)>=0)throw new Error('"'+t+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+e)}throw new Error('"'+t+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+ot.join('", "')+'"')},f.prototype._resolveLocale=function(t){"string"==typeof t&&(t=[t]),t=(t||[]).concat(f.defaultLocale);var e,r,n,o,a=f.__localeData__;for(e=0,r=t.length;e<r;e+=1)for(n=t[e].toLowerCase().split("-");n.length;){if(o=a[n.join("-")])return o.locale;n.pop()}var i=t.pop();throw new Error("No locale data has been added to IntlRelativeFormat for: "+t.join(", ")+", or the default locale: "+i)},f.prototype._resolveStyle=function(t){if(!t)return at[0];if(et.call(at,t)>=0)return t;throw new Error('"'+t+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+at.join('", "')+'"')},f.prototype._selectUnits=function(t){var e,r,n;for(e=0,r=ot.length;e<r&&(n=ot[e],!(Math.abs(t[n])<f.thresholds[n]));e+=1);return n};var it={locale:"en",pluralRuleFunction:function(t,e){var r=String(t).split("."),n=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return e?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==t&&n?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}};f.__addLocaleData(it),f.defaultLocale="en";var lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},st=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),ct=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},ft=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},pt=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},ht=function(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},mt=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},dt=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)},yt=e.bool,vt=e.number,gt=e.string,_t=e.func,bt=e.object,wt=e.oneOf,Ft=e.shape,Ot=e.any,xt=wt(["best fit","lookup"]),jt=wt(["narrow","short","long"]),Ct=wt(["numeric","2-digit"]),Pt=_t.isRequired,Tt={locale:gt,formats:bt,messages:bt,textComponent:Ot,defaultLocale:gt,defaultFormats:bt},At={formatDate:Pt,formatTime:Pt,formatRelative:Pt,formatNumber:Pt,formatPlural:Pt,formatMessage:Pt,formatHTMLMessage:Pt},Nt=Ft(ft({},Tt,At,{formatters:bt,now:Pt})),Mt={localeMatcher:xt,formatMatcher:wt(["basic","best fit"]),timeZone:gt,hour12:yt,weekday:jt,era:jt,year:Ct,month:wt(["numeric","2-digit","narrow","short","long"]),day:Ct,hour:Ct,minute:Ct,second:Ct,timeZoneName:wt(["short","long"])},Rt={localeMatcher:xt,style:wt(["decimal","currency","percent"]),currency:gt,currencyDisplay:wt(["symbol","code","name"]),useGrouping:yt,minimumIntegerDigits:vt,minimumFractionDigits:vt,maximumFractionDigits:vt,minimumSignificantDigits:vt,maximumSignificantDigits:vt},kt={style:wt(["best fit","numeric"]),units:wt(["second","minute","hour","day","month","year"])},Dt={style:wt(["cardinal","ordinal"])},Et="production",Lt=function(t,e,r,n,o,a,i,l){if("production"!==Et&&void 0===e)throw new Error("invariant requires an error message argument");if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,a,i,l],c=0;u=new Error(e.replace(/%s/g,function(){return s[c++]})),u.name="Invariant Violation";
|
|
2
|
+
}throw u.framesToPop=1,u}},It=Lt,St=Object.keys(Tt),Ut={"&":"&",">":">","<":"<",'"':""","'":"'"},qt=/[&><"']/g,Gt=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ut(this,t);var n="ordinal"===r.style,o=x(O(e));this.format=function(t){return o(t,n)}},Ht=Function.prototype.bind||function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),r=this,n=function(){},o=function(){return r.apply(this instanceof n?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(n.prototype=this.prototype),o.prototype=new n,o},Wt=Object.prototype.hasOwnProperty,Vt=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),Zt=Vt?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!Wt.call(t,e)||"value"in r)&&(t[e]=r.value)},Bt=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)Wt.call(e,o)&&Zt(n,o,e[o]);return n},Jt=Object.keys(Mt),$t=Object.keys(Rt),zt=Object.keys(kt),Kt=Object.keys(Dt),Qt={second:60,minute:60,hour:24,day:30,month:12},Xt=Object.freeze({formatDate:N,formatTime:M,formatRelative:R,formatNumber:k,formatPlural:D,formatMessage:E,formatHTMLMessage:L}),Yt=Object.keys(Tt),te=Object.keys(At),ee={formats:{},messages:{},textComponent:"span",defaultLocale:"en",defaultFormats:{}},re=function(t){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ut(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));It("undefined"!=typeof Intl,"[React Intl] The `Intl` APIs must be available in the runtime, and do not appear to be built-in. An `Intl` polyfill should be loaded.\nSee: http://formatjs.io/guides/runtime-environments/");var o=r.intl,a=void 0;a=isFinite(t.initialNow)?Number(t.initialNow):o?o.now():Date.now();var i=o||{},l=i.formatters,u=void 0===l?{getDateTimeFormat:j(Intl.DateTimeFormat),getNumberFormat:j(Intl.NumberFormat),getMessageFormat:j(s),getRelativeFormat:j(f),getPluralFormat:j(Gt)}:l;return n.state=ft({},u,{now:function(){return n._didDisplay?Date.now():a}}),n}return pt(e,t),st(e,[{key:"getConfig",value:function(){var t=this.context.intl,e=y(this.props,Yt,t);for(var r in ee)void 0===e[r]&&(e[r]=ee[r]);if(!h(e.locale)){var n=e,o=(n.locale,n.defaultLocale),a=n.defaultFormats;e=ft({},e,{locale:o,formats:a,messages:ee.messages})}return e}},{key:"getBoundFormatFns",value:function(t,e){return te.reduce(function(r,n){return r[n]=Xt[n].bind(null,t,e),r},{})}},{key:"getChildContext",value:function(){var t=this.getConfig(),e=this.getBoundFormatFns(t,this.state),r=this.state,n=r.now,o=ht(r,["now"]);return{intl:ft({},t,e,{formatters:o,now:n})}}},{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"componentDidMount",value:function(){this._didDisplay=!0}},{key:"render",value:function(){return r.Children.only(this.props.children)}}]),e}(r.Component);re.displayName="IntlProvider",re.contextTypes={intl:Nt},re.childContextTypes={intl:Nt.isRequired};var ne=function(t){function e(t,r){ut(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return v(r),n}return pt(e,t),st(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatDate,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,this.props);return"function"==typeof a?a(i):q.createElement(r,null,i)}}]),e}(r.Component);ne.displayName="FormattedDate",ne.contextTypes={intl:Nt};var oe=function(t){function e(t,r){ut(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return v(r),n}return pt(e,t),st(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatTime,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,this.props);return"function"==typeof a?a(i):q.createElement(r,null,i)}}]),e}(r.Component);oe.displayName="FormattedTime",oe.contextTypes={intl:Nt};var ae=1e3,ie=6e4,le=36e5,ue=864e5,se=2147483647,ce=function(t){function e(t,r){ut(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));v(r);var o=isFinite(t.initialNow)?Number(t.initialNow):r.intl.now();return n.state={now:o},n}return pt(e,t),st(e,[{key:"scheduleNextUpdate",value:function(t,e){var r=this;clearTimeout(this._timer);var n=t.value,o=t.units,a=t.updateInterval,i=new Date(n).getTime();if(a&&isFinite(i)){var l=i-e.now,u=S(o||I(l)),s=Math.abs(l%u),c=l<0?Math.max(a,u-s):Math.max(a,s);this._timer=setTimeout(function(){r.setState({now:r.context.intl.now()})},c)}}},{key:"componentDidMount",value:function(){this.scheduleNextUpdate(this.props,this.state)}},{key:"componentWillReceiveProps",value:function(t){var e=t.value;U(e,this.props.value)||this.setState({now:this.context.intl.now()})}},{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"componentWillUpdate",value:function(t,e){this.scheduleNextUpdate(t,e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this._timer)}},{key:"render",value:function(){var t=this.context.intl,e=t.formatRelative,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,ft({},this.props,this.state));return"function"==typeof a?a(i):q.createElement(r,null,i)}}]),e}(r.Component);ce.displayName="FormattedRelative",ce.contextTypes={intl:Nt},ce.defaultProps={updateInterval:1e4};var fe=function(t){function e(t,r){ut(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return v(r),n}return pt(e,t),st(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatNumber,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,this.props);return"function"==typeof a?a(i):q.createElement(r,null,i)}}]),e}(r.Component);fe.displayName="FormattedNumber",fe.contextTypes={intl:Nt};var pe=function(t){function e(t,r){ut(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return v(r),n}return pt(e,t),st(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatPlural,r=t.textComponent,n=this.props,o=n.value,a=n.other,i=n.children,l=e(o,this.props),u=this.props[l]||a;return"function"==typeof i?i(u):q.createElement(r,null,u)}}]),e}(r.Component);pe.displayName="FormattedPlural",pe.contextTypes={intl:Nt},pe.defaultProps={style:"cardinal"};var he=function(t){function e(t,r){ut(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return v(r),n}return pt(e,t),st(e,[{key:"shouldComponentUpdate",value:function(t){var e=this.props.values,r=t.values;if(!g(r,e))return!0;for(var n=ft({},t,{values:e}),o=arguments.length,a=Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return _.apply(void 0,[this,n].concat(a))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatMessage,n=t.textComponent,o=this.props,a=o.id,i=o.description,l=o.defaultMessage,u=o.values,s=o.tagName,c=void 0===s?n:s,f=o.children,p=void 0,h=void 0,m=void 0,d=u&&Object.keys(u).length>0;if(d){var y=Math.floor(1099511627776*Math.random()).toString(16),v=function(){var t=0;return function(){return"ELEMENT-"+y+"-"+(t+=1)}}();p="@__"+y+"__@",h={},m={},Object.keys(u).forEach(function(t){var e=u[t];if(r.isValidElement(e)){var n=v();h[t]=p+n+p,m[n]=e}else h[t]=e})}var g={id:a,description:i,defaultMessage:l},_=e(g,h||u),b=void 0,w=m&&Object.keys(m).length>0;return b=w?_.split(p).filter(function(t){return!!t}).map(function(t){return m[t]||t}):[_],"function"==typeof f?f.apply(void 0,dt(b)):r.createElement.apply(void 0,[c,null].concat(dt(b)))}}]),e}(r.Component);he.displayName="FormattedMessage",he.contextTypes={intl:Nt},he.defaultProps={values:{}};var me=function(t){function e(t,r){ut(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return v(r),n}return pt(e,t),st(e,[{key:"shouldComponentUpdate",value:function(t){var e=this.props.values,r=t.values;if(!g(r,e))return!0;for(var n=ft({},t,{values:e}),o=arguments.length,a=Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return _.apply(void 0,[this,n].concat(a))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatHTMLMessage,r=t.textComponent,n=this.props,o=n.id,a=n.description,i=n.defaultMessage,l=n.values,u=n.tagName,s=void 0===u?r:u,c=n.children,f={id:o,description:a,defaultMessage:i},p=e(f,l);if("function"==typeof c)return c(p);var h={__html:p};return q.createElement(s,{dangerouslySetInnerHTML:h})}}]),e}(r.Component);me.displayName="FormattedHTMLMessage",me.contextTypes={intl:Nt},me.defaultProps={values:{}},p(G),t.addLocaleData=p,t.intlShape=Nt,t.injectIntl=w,t.defineMessages=F,t.IntlProvider=re,t.FormattedDate=ne,t.FormattedTime=oe,t.FormattedRelative=ce,t.FormattedNumber=fe,t.FormattedPlural=pe,t.FormattedMessage=he,t.FormattedHTMLMessage=me,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
3
3
|
//# sourceMappingURL=react-intl.min.js.map
|