react-intl
Version:
Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.
3 lines (2 loc) • 45.3 kB
JavaScript
!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.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)L.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 s(t,e,r,n){this.id=t,this.offset=e,this.numberFormat=r,this.string=n}function l(t,e){this.id=t,this.options=e}function u(t,e,r){var n="string"==typeof t?u.__parse(t):t;if(!n||"messageFormatPattern"!==n.type)throw new TypeError("A message must be provided as a String or AST.");r=this._mergeFormats(u.formats,r),S(this,"_locale",{value:this._resolveLocale(e)});var o=this._findPluralRuleFunction(this._locale),a=this._compilePattern(n,e,r,o),i=this;this.format=function(e){try{return i._format(a,e)}catch(e){throw e.variableId?new Error("The intl string context variable '"+e.variableId+"' was not provided to the string '"+t+"'"):e}}}function c(t){return 400*t/146097}function f(t,e){e=e||{},z(t)&&(t=t.concat()),B(this,"_locale",{value:this._resolveLocale(t)}),B(this,"_options",{value:{style:this._resolveStyle(e.style),units:this._isValidUnits(e.units)&&e.units}}),B(this,"_locales",{value:t}),B(this,"_fields",{value:this._findFields(this._locale)}),B(this,"_messages",{value:J(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]:[];(Array.isArray(t)?t:[t]).forEach(function(t){t&&t.locale&&(u.__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!(!u.__localeData__[e]||!f.__localeData__[e])}function d(t,e,r){if("string"!=typeof e){if(It){var n=Dt(e);n&&n!==It&&d(t,n,r)}var o=At(e);Mt&&(o=o.concat(Mt(e)));for(var a=0;a<o.length;++a){var i=o[a];if(!(Nt[i]||kt[i]||r&&r[i])){var s=Rt(e,i);try{Et(t,i,s)}catch(t){}}}return t}return t}function y(t){return(""+t).replace(qt,function(t){return Zt[t]})}function v(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 g(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).intl;St(t,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}function _(t,e){if(t===e)return!0;if("object"!==(void 0===t?"undefined":tt(t))||null===t||"object"!==(void 0===e?"undefined":tt(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 b(t,e,r){var n=t.props,o=t.state,a=t.context,i=void 0===a?{}:a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=i.intl,u=void 0===l?{}:l,c=s.intl,f=void 0===c?{}:c;return!_(e,n)||!_(r,o)||!(f===u||_(v(f,Ut),v(u,Ut)))}function w(t,e){return"[React Intl] "+t+(e?"\n"+e:"")}function F(t){}function O(t){return t.displayName||t.name||"Component"}function x(t){return u.prototype._resolveLocale(t)}function P(t){return u.prototype._findPluralRuleFunction(t)}function j(t){var e=Bt(null);return function(){var r=Array.prototype.slice.call(arguments),n=T(r),o=n&&e[n];return o||(o=new(Ht.apply(t,[null].concat(r))),n&&(e[n]=o)),o}}function T(t){if("undefined"!=typeof JSON){var e,r,n,o=[];for(e=0,r=t.length;e<r;e+=1)(n=t[e])&&"object"==typeof n?o.push(C(n)):o.push(n);return JSON.stringify(o)}}function C(t){var e,r,n,o,a=[],i=[];for(e in t)t.hasOwnProperty(e)&&i.push(e);var s=i.sort();for(r=0,n=s.length;r<n;r+=1)(o={})[e=s[r]]=t[e],a[r]=o;return a}function N(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,e["second-short"]=t["second-short"],e["minute-short"]=t["minute-short"],e["hour-short"]=t["hour-short"],e["day-short"]=t["day-short"],e["month-short"]=t["month-short"]}function k(t,e,r,n){var o=t&&t[e]&&t[e][r];if(o)return o;n(w("No "+e+" format named: "+r))}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,s=t.defaultLocale,l=t.defaultFormats,u=r.id,c=r.defaultMessage;St(u,"[React Intl] An `id` must be provided to format a message.");var f=i&&i[u];if(!(Object.keys(n).length>0))return f||c||u;var p=void 0,h=t.onError||F;if(f)try{p=e.getMessageFormat(f,o,a).format(n)}catch(t){h(w('Error formatting message: "'+u+'" for locale: "'+o+'"'+(c?", using default message as fallback.":""),t))}else(!c||o&&o.toLowerCase()!==s.toLowerCase())&&h(w('Missing message: "'+u+'" for locale: "'+o+'"'+(c?", using default message as fallback.":"")));if(!p&&c)try{p=e.getMessageFormat(c,s,l).format(n)}catch(t){h(w('Error formatting the default message for: "'+u+'"',t))}return p||h(w('Cannot format message: "'+u+'", using message '+(f||c?"source":"id")+" as fallback.")),p||f||c||u}function A(t){var e=Math.abs(t);return e<ie?"second":e<se?"minute":e<le?"hour":"day"}function M(t){switch(t){case"second":return ae;case"minute":return ie;case"hour":return se;case"day":return le;default:return ue}}function R(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(void 0===r)throw new ReferenceError("React must be loaded before ReactIntl.");e=e&&e.hasOwnProperty("default")?e.default:e;var D="default"in r?r.default:r,I={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",relative:{0:"this hour"},relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"minute",relative:{0:"this 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"}}}}},L=Object.prototype.hasOwnProperty,S=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}()?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!L.call(t,e)||"value"in r)&&(t[e]=r.value)},U=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)L.call(e,o)&&S(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]).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 s(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,s=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,s);case"selectFormat":return r=this.compileOptions(t),new l(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)n[(i=r[o]).selector]=this.compileMessage(i.value);return this.currentPlural=this.pluralStack.pop(),n},a.prototype.format=function(t){return t||"number"==typeof t?"string"==typeof t?t:String(t):""},i.prototype.getOption=function(t){var e=this.options;return e["="+t]||e[this.pluralFn(t-this.offset,this.useOrdinal)]||e.other},s.prototype.format=function(t){var e=this.numberFormat.format(t-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+e).replace(/\\#/g,"#")},l.prototype.getOption=function(t){var e=this.options;return e[t]||e.other};var Z=function(){function t(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"}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),{SyntaxError:t,parse:function(e){function r(t){return Jt!==t&&(Jt>t&&(Jt=0,$t={line:1,column:1,seenCR:!1}),function(t,r,n){var o,a;for(o=Jt;o<n;o++)"\n"===(a=e.charAt(o))?(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)}($t,0,t),Jt=t),$t}function n(t){Bt<zt||(Bt>zt&&(zt=Bt,Kt=[]),Kt.push(t))}function o(){return a()}function a(){var t,e;for(t=[],e=i();e!==N;)t.push(e),e=i();return t!==N&&(t=A(t)),t}function i(){var t;return(t=l())===N&&(t=c()),t}function s(){var t,r,n,o,a,i;if(t=Bt,r=[],n=Bt,(o=w())!==N&&(a=j())!==N&&(i=w())!==N?n=o=[o,a,i]:(Bt=n,n=M),n!==N)for(;n!==N;)r.push(n),n=Bt,(o=w())!==N&&(a=j())!==N&&(i=w())!==N?n=o=[o,a,i]:(Bt=n,n=M);else r=M;return r!==N&&(r=R(r)),(t=r)===N&&(t=Bt,(r=b())!==N&&(r=e.substring(t,Bt)),t=r),t}function l(){var t;return(t=s())!==N&&(t=D(t)),t}function u(){var t,r,o;if((t=x())===N){if(t=Bt,r=[],I.test(e.charAt(Bt))?(o=e.charAt(Bt),Bt++):(o=N,0===Qt&&n(L)),o!==N)for(;o!==N;)r.push(o),I.test(e.charAt(Bt))?(o=e.charAt(Bt),Bt++):(o=N,0===Qt&&n(L));else r=M;r!==N&&(r=e.substring(t,Bt)),t=r}return t}function c(){var t,r,o,a,i,s,l;return t=Bt,123===e.charCodeAt(Bt)?(r=S,Bt++):(r=N,0===Qt&&n(U)),r!==N&&w()!==N&&(o=u())!==N&&w()!==N?(a=Bt,44===e.charCodeAt(Bt)?(i=q,Bt++):(i=N,0===Qt&&n(G)),i!==N&&(s=w())!==N&&(l=f())!==N?a=i=[i,s,l]:(Bt=a,a=M),a===N&&(a=Z),a!==N&&(i=w())!==N?(125===e.charCodeAt(Bt)?(s=H,Bt++):(s=N,0===Qt&&n(W)),s!==N?t=r=V(o,a):(Bt=t,t=M)):(Bt=t,t=M)):(Bt=t,t=M),t}function f(){var t;return(t=p())===N&&(t=h())===N&&(t=m())===N&&(t=d()),t}function p(){var t,r,o,a,i,s;return t=Bt,e.substr(Bt,6)===B?(r=B,Bt+=6):(r=N,0===Qt&&n(J)),r===N&&(e.substr(Bt,4)===$?(r=$,Bt+=4):(r=N,0===Qt&&n(z)),r===N&&(e.substr(Bt,4)===K?(r=K,Bt+=4):(r=N,0===Qt&&n(Q)))),r!==N&&w()!==N?(o=Bt,44===e.charCodeAt(Bt)?(a=q,Bt++):(a=N,0===Qt&&n(G)),a!==N&&(i=w())!==N&&(s=j())!==N?o=a=[a,i,s]:(Bt=o,o=M),o===N&&(o=Z),o!==N?t=r=X(r,o):(Bt=t,t=M)):(Bt=t,t=M),t}function h(){var t,r,o,a;return t=Bt,e.substr(Bt,6)===Y?(r=Y,Bt+=6):(r=N,0===Qt&&n(tt)),r!==N&&w()!==N?(44===e.charCodeAt(Bt)?(o=q,Bt++):(o=N,0===Qt&&n(G)),o!==N&&w()!==N&&(a=_())!==N?t=r=et(a):(Bt=t,t=M)):(Bt=t,t=M),t}function m(){var t,r,o,a;return t=Bt,e.substr(Bt,13)===rt?(r=rt,Bt+=13):(r=N,0===Qt&&n(nt)),r!==N&&w()!==N?(44===e.charCodeAt(Bt)?(o=q,Bt++):(o=N,0===Qt&&n(G)),o!==N&&w()!==N&&(a=_())!==N?t=r=ot(a):(Bt=t,t=M)):(Bt=t,t=M),t}function d(){var t,r,o,a,i;if(t=Bt,e.substr(Bt,6)===at?(r=at,Bt+=6):(r=N,0===Qt&&n(it)),r!==N)if(w()!==N)if(44===e.charCodeAt(Bt)?(o=q,Bt++):(o=N,0===Qt&&n(G)),o!==N)if(w()!==N){if(a=[],(i=v())!==N)for(;i!==N;)a.push(i),i=v();else a=M;a!==N?t=r=st(a):(Bt=t,t=M)}else Bt=t,t=M;else Bt=t,t=M;else Bt=t,t=M;else Bt=t,t=M;return t}function y(){var t,r,o,a;return t=Bt,r=Bt,61===e.charCodeAt(Bt)?(o=lt,Bt++):(o=N,0===Qt&&n(ut)),o!==N&&(a=x())!==N?r=o=[o,a]:(Bt=r,r=M),r!==N&&(r=e.substring(t,Bt)),(t=r)===N&&(t=j()),t}function v(){var t,r,o,i,s;return t=Bt,w()!==N&&(r=y())!==N&&w()!==N?(123===e.charCodeAt(Bt)?(o=S,Bt++):(o=N,0===Qt&&n(U)),o!==N&&w()!==N&&(i=a())!==N&&w()!==N?(125===e.charCodeAt(Bt)?(s=H,Bt++):(s=N,0===Qt&&n(W)),s!==N?t=ct(r,i):(Bt=t,t=M)):(Bt=t,t=M)):(Bt=t,t=M),t}function g(){var t,r,o;return t=Bt,e.substr(Bt,7)===ft?(r=ft,Bt+=7):(r=N,0===Qt&&n(pt)),r!==N&&w()!==N&&(o=x())!==N?t=r=ht(o):(Bt=t,t=M),t}function _(){var t,e,r,n;if(t=Bt,(e=g())===N&&(e=Z),e!==N)if(w()!==N){if(r=[],(n=v())!==N)for(;n!==N;)r.push(n),n=v();else r=M;r!==N?t=e=mt(e,r):(Bt=t,t=M)}else Bt=t,t=M;else Bt=t,t=M;return t}function b(){var t,r;if(Qt++,t=[],yt.test(e.charAt(Bt))?(r=e.charAt(Bt),Bt++):(r=N,0===Qt&&n(vt)),r!==N)for(;r!==N;)t.push(r),yt.test(e.charAt(Bt))?(r=e.charAt(Bt),Bt++):(r=N,0===Qt&&n(vt));else t=M;return Qt--,t===N&&(r=N,0===Qt&&n(dt)),t}function w(){var t,r,o;for(Qt++,t=Bt,r=[],o=b();o!==N;)r.push(o),o=b();return r!==N&&(r=e.substring(t,Bt)),t=r,Qt--,t===N&&(r=N,0===Qt&&n(gt)),t}function F(){var t;return _t.test(e.charAt(Bt))?(t=e.charAt(Bt),Bt++):(t=N,0===Qt&&n(bt)),t}function O(){var t;return wt.test(e.charAt(Bt))?(t=e.charAt(Bt),Bt++):(t=N,0===Qt&&n(Ft)),t}function x(){var t,r,o,a,i;if(48===e.charCodeAt(Bt)?(t=Ot,Bt++):(t=N,0===Qt&&n(xt)),t===N){if(t=Bt,r=Bt,Pt.test(e.charAt(Bt))?(o=e.charAt(Bt),Bt++):(o=N,0===Qt&&n(jt)),o!==N){for(a=[],i=F();i!==N;)a.push(i),i=F();a!==N?r=o=[o,a]:(Bt=r,r=M)}else Bt=r,r=M;r!==N&&(r=e.substring(t,Bt)),t=r}return t!==N&&(t=Tt(t)),t}function P(){var t,r,o,a,i,s,l,u;return Ct.test(e.charAt(Bt))?(t=e.charAt(Bt),Bt++):(t=N,0===Qt&&n(Nt)),t===N&&(t=Bt,e.substr(Bt,2)===kt?(r=kt,Bt+=2):(r=N,0===Qt&&n(Et)),r!==N&&(r=At()),(t=r)===N&&(t=Bt,e.substr(Bt,2)===Mt?(r=Mt,Bt+=2):(r=N,0===Qt&&n(Rt)),r!==N&&(r=Dt()),(t=r)===N&&(t=Bt,e.substr(Bt,2)===It?(r=It,Bt+=2):(r=N,0===Qt&&n(Lt)),r!==N&&(r=St()),(t=r)===N&&(t=Bt,e.substr(Bt,2)===Ut?(r=Ut,Bt+=2):(r=N,0===Qt&&n(Zt)),r!==N&&(r=qt()),(t=r)===N&&(t=Bt,e.substr(Bt,2)===Gt?(r=Gt,Bt+=2):(r=N,0===Qt&&n(Ht)),r!==N?(o=Bt,a=Bt,(i=O())!==N&&(s=O())!==N&&(l=O())!==N&&(u=O())!==N?a=i=[i,s,l,u]:(Bt=a,a=M),a!==N&&(a=e.substring(o,Bt)),(o=a)!==N?t=r=Wt(o):(Bt=t,t=M)):(Bt=t,t=M)))))),t}function j(){var t,e;if(t=[],(e=P())!==N)for(;e!==N;)t.push(e),e=P();else t=M;return t!==N&&(t=Vt(t)),t}var T,C=arguments.length>1?arguments[1]:{},N={},k={start:o},E=o,A=function(t){return{type:"messageFormatPattern",elements:t}},M=N,R=function(t){var e,r,n,o,a,i="";for(e=0,n=t.length;e<n;e+=1)for(r=0,a=(o=t[e]).length;r<a;r+=1)i+=o[r];return i},D=function(t){return{type:"messageTextElement",value:t}},I=/^[^ \t\n\r,.+={}#]/,L={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},S="{",U={type:"literal",value:"{",description:'"{"'},Z=null,q=",",G={type:"literal",value:",",description:'","'},H="}",W={type:"literal",value:"}",description:'"}"'},V=function(t,e){return{type:"argumentElement",id:t,format:e&&e[2]}},B="number",J={type:"literal",value:"number",description:'"number"'},$="date",z={type:"literal",value:"date",description:'"date"'},K="time",Q={type:"literal",value:"time",description:'"time"'},X=function(t,e){return{type:t+"Format",style:e&&e[2]}},Y="plural",tt={type:"literal",value:"plural",description:'"plural"'},et=function(t){return{type:t.type,ordinal:!1,offset:t.offset||0,options:t.options}},rt="selectordinal",nt={type:"literal",value:"selectordinal",description:'"selectordinal"'},ot=function(t){return{type:t.type,ordinal:!0,offset:t.offset||0,options:t.options}},at="select",it={type:"literal",value:"select",description:'"select"'},st=function(t){return{type:"selectFormat",options:t}},lt="=",ut={type:"literal",value:"=",description:'"="'},ct=function(t,e){return{type:"optionalFormatPattern",selector:t,value:e}},ft="offset:",pt={type:"literal",value:"offset:",description:'"offset:"'},ht=function(t){return t},mt=function(t,e){return{type:"pluralFormat",offset:t,options:e}},dt={type:"other",description:"whitespace"},yt=/^[ \t\n\r]/,vt={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},gt={type:"other",description:"optionalWhitespace"},_t=/^[0-9]/,bt={type:"class",value:"[0-9]",description:"[0-9]"},wt=/^[0-9a-f]/i,Ft={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},Ot="0",xt={type:"literal",value:"0",description:'"0"'},Pt=/^[1-9]/,jt={type:"class",value:"[1-9]",description:"[1-9]"},Tt=function(t){return parseInt(t,10)},Ct=/^[^{}\\\0-\x1F \t\n\r]/,Nt={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},kt="\\\\",Et={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},At=function(){return"\\"},Mt="\\#",Rt={type:"literal",value:"\\#",description:'"\\\\#"'},Dt=function(){return"\\#"},It="\\{",Lt={type:"literal",value:"\\{",description:'"\\\\{"'},St=function(){return"{"},Ut="\\}",Zt={type:"literal",value:"\\}",description:'"\\\\}"'},qt=function(){return"}"},Gt="\\u",Ht={type:"literal",value:"\\u",description:'"\\\\u"'},Wt=function(t){return String.fromCharCode(parseInt(t,16))},Vt=function(t){return t.join("")},Bt=0,Jt=0,$t={line:1,column:1,seenCR:!1},zt=0,Kt=[],Qt=0;if("startRule"in C){if(!(C.startRule in k))throw new Error("Can't start parsing from rule \""+C.startRule+'".');E=k[C.startRule]}if((T=E())!==N&&Bt===e.length)return T;throw T!==N&&Bt<e.length&&n({type:"end",description:"end of input"}),function(n,o,a){var i=r(a),s=a<e.length?e.charAt(a):null;return null!==o&&function(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++}(o),new t(null!==n?n:function(t,e){var r,n,o,a=new Array(t.length);for(o=0;o<t.length;o++)a[o]=t[o].description;return r=t.length>1?a.slice(0,-1).join(", ")+" or "+a[t.length-1]:a[0],n=e?'"'+function(t){function r(t){return t.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(t){return"\\x0"+r(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+r(t)}).replace(/[\u0180-\u0FFF]/g,function(t){return"\\u0"+r(t)}).replace(/[\u1080-\uFFFF]/g,function(t){return"\\u"+r(t)})}()+'"':"end of input","Expected "+r+" but "+n+" found."}(o,s),o,s,a,i.line,i.column)}(null,Kt,zt)}}}();S(u,"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"}}}}),S(u,"__localeData__",{value:U(null)}),S(u,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");u.__localeData__[t.locale.toLowerCase()]=t}}),S(u,"__parse",{value:Z.parse}),S(u,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),u.prototype.resolvedOptions=function(){return{locale:this._locale}},u.prototype._compilePattern=function(t,e,r,n){return new o(e,r,n).compile(t)},u.prototype._findPluralRuleFunction=function(t){for(var e=u.__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)},u.prototype._format=function(t,e){var r,n,o,a,i,s,l="";for(r=0,n=t.length;r<n;r+=1)if("string"!=typeof(o=t[r])){if(a=o.id,!e||!L.call(e,a))throw s=new Error("A value must be provided for: "+a),s.variableId=a,s;i=e[a],o.options?l+=this._format(o.getOption(i),e):l+=o.format(i)}else l+=o;return l},u.prototype._mergeFormats=function(t,e){var r,o,a={};for(r in t)L.call(t,r)&&(a[r]=o=U(t[r]),e&&L.call(e,r)&&n(o,e[r]));return a},u.prototype._resolveLocale=function(t){"string"==typeof t&&(t=[t]),t=(t||[]).concat(u.defaultLocale);var e,r,n,o,a=u.__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 q={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"}};u.__addLocaleData(q),u.defaultLocale="en";var G=Math.round,H=function(t,e){var r=G((e=+e)-(t=+t)),n=G(r/1e3),o=G(n/60),a=G(o/60),i=G(a/24),s=G(i/7),l=c(i),u=G(12*l),f=G(l);return{millisecond:r,second:n,"second-short":n,minute:o,"minute-short":o,hour:a,"hour-short":a,day:i,"day-short":i,week:s,"week-short":s,month:u,"month-short":u,year:f,"year-short":f}},W=Object.prototype.hasOwnProperty,V=Object.prototype.toString,B=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}()?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!W.call(t,e)||"value"in r)&&(t[e]=r.value)},J=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)W.call(e,o)&&B(n,o,e[o]);return n},$=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},z=Array.isArray||function(t){return"[object Array]"===V.call(t)},K=Date.now||function(){return(new Date).getTime()},Q=["second","second-short","minute","minute-short","hour","hour-short","day","day-short","month","month-short","year","year-short"],X=["best fit","numeric"];B(f,"__localeData__",{value:J(null)}),B(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,u.__addLocaleData(t)}}),B(f,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),B(f,"thresholds",{enumerable:!0,value:{second:45,"second-short":45,minute:45,"minute-short":45,hour:22,"hour-short":22,day:26,"day-short":26,month:11,"month-short":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._fields[t].relativeTime,o="",a="";for(e in n.future)n.future.hasOwnProperty(e)&&(o+=" "+e+" {"+n.future[e].replace("{0}","#")+"}");for(e in n.past)n.past.hasOwnProperty(e)&&(a+=" "+e+" {"+n.past[e].replace("{0}","#")+"}");return new u("{when, select, future {{0, plural, "+o+"}}past {{0, plural, "+a+"}}}",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:K();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=H(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||$.call(Q,t)>=0)return!0;if("string"==typeof t){var e=/s$/.test(t)&&t.substr(0,t.length-1);if(e&&$.call(Q,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: "'+Q.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 X[0];if($.call(X,t)>=0)return t;throw new Error('"'+t+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+X.join('", "')+'"')},f.prototype._selectUnits=function(t){var e,r,n,o=Q.filter(function(t){return t.indexOf("-short")<1});for(e=0,r=o.length;e<r&&(n=o[e],!(Math.abs(t[n])<f.thresholds[n]));e+=1);return n};var Y={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"}}},"year-short":{displayName:"yr.",relative:{0:"this yr.",1:"next yr.","-1":"last yr."},relativeTime:{future:{one:"in {0} yr.",other:"in {0} yr."},past:{one:"{0} yr. ago",other:"{0} yr. 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"}}},"month-short":{displayName:"mo.",relative:{0:"this mo.",1:"next mo.","-1":"last mo."},relativeTime:{future:{one:"in {0} mo.",other:"in {0} mo."},past:{one:"{0} mo. ago",other:"{0} mo. 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"}}},"day-short":{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",relative:{0:"this hour"},relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},"hour-short":{displayName:"hr.",relative:{0:"this hour"},relativeTime:{future:{one:"in {0} hr.",other:"in {0} hr."},past:{one:"{0} hr. ago",other:"{0} hr. ago"}}},minute:{displayName:"minute",relative:{0:"this minute"},relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},"minute-short":{displayName:"min.",relative:{0:"this minute"},relativeTime:{future:{one:"in {0} min.",other:"in {0} min."},past:{one:"{0} min. ago",other:"{0} min. 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"}}},"second-short":{displayName:"sec.",relative:{0:"now"},relativeTime:{future:{one:"in {0} sec.",other:"in {0} sec."},past:{one:"{0} sec. ago",other:"{0} sec. ago"}}}}};f.__addLocaleData(Y),f.defaultLocale="en";var tt="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},et=(function(){function t(t){this.value=t}function e(e){function r(o,a){try{var i=e[o](a),s=i.value;s instanceof t?Promise.resolve(s.value).then(function(t){r("next",t)},function(t){r("throw",t)}):n(i.done?"return":"normal",i.value)}catch(t){n("throw",t)}}function n(t,e){switch(t){case"return":o.resolve({value:e,done:!0});break;case"throw":o.reject(e);break;default:o.resolve({value:e,done:!1})}(o=o.next)?r(o.key,o.arg):a=null}var o,a;this._invoke=function(t,e){return new Promise(function(n,i){var s={key:t,arg:e,resolve:n,reject:i,next:null};a?a=a.next=s:(o=a=s,r(t,e))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(e.prototype[Symbol.asyncIterator]=function(){return this}),e.prototype.next=function(t){return this._invoke("next",t)},e.prototype.throw=function(t){return this._invoke("throw",t)},e.prototype.return=function(t){return this._invoke("return",t)}}(),function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}),rt=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}}(),nt=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},ot=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},at=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)},it=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},st=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},lt=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)},ut=e.bool,ct=e.number,ft=e.string,pt=e.func,ht=e.object,mt=e.oneOf,dt=e.shape,yt=e.any,vt=e.oneOfType,gt=mt(["best fit","lookup"]),_t=mt(["narrow","short","long"]),bt=mt(["numeric","2-digit"]),wt=pt.isRequired,Ft={locale:ft,timeZone:ft,formats:ht,messages:ht,textComponent:yt,defaultLocale:ft,defaultFormats:ht,onError:pt},Ot={formatDate:wt,formatTime:wt,formatRelative:wt,formatNumber:wt,formatPlural:wt,formatMessage:wt,formatHTMLMessage:wt},xt=dt(ot({},Ft,Ot,{formatters:ht,now:wt})),Pt=(ft.isRequired,vt([ft,ht]),{localeMatcher:gt,formatMatcher:mt(["basic","best fit"]),timeZone:ft,hour12:ut,weekday:_t,era:_t,year:bt,month:mt(["numeric","2-digit","narrow","short","long"]),day:bt,hour:bt,minute:bt,second:bt,timeZoneName:mt(["short","long"])}),jt={localeMatcher:gt,style:mt(["decimal","currency","percent"]),currency:ft,currencyDisplay:mt(["symbol","code","name"]),useGrouping:ut,minimumIntegerDigits:ct,minimumFractionDigits:ct,maximumFractionDigits:ct,minimumSignificantDigits:ct,maximumSignificantDigits:ct},Tt={style:mt(["best fit","numeric"]),units:mt(["second","minute","hour","day","month","year","second-short","minute-short","hour-short","day-short","month-short","year-short"])},Ct={style:mt(["cardinal","ordinal"])},Nt={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},kt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Et=Object.defineProperty,At=Object.getOwnPropertyNames,Mt=Object.getOwnPropertySymbols,Rt=Object.getOwnPropertyDescriptor,Dt=Object.getPrototypeOf,It=Dt&&Dt(Object),Lt=d,St=function(t,e,r,n,o,a,i,s){if(!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,a,i,s],c=0;(l=new Error(e.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}},Ut=Object.keys(Ft),Zt={"&":"&",">":">","<":"<",'"':""","'":"'"},qt=/[&><"']/g,Gt=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};et(this,t);var n="ordinal"===r.style,o=P(x(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}}()?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)&&Vt(n,o,e[o]);return n},Jt=Object.keys(Pt),$t=Object.keys(jt),zt=Object.keys(Tt),Kt=Object.keys(Ct),Qt={second:60,minute:60,hour:24,day:30,month:12},Xt=Object.freeze({formatDate:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=t.timeZone,s=n.format,l=t.onError||F,u=new Date(r),c=ot({},i&&{timeZone:i},s&&k(a,"date",s,l)),f=v(n,Jt,c);try{return e.getDateTimeFormat(o,f).format(u)}catch(t){l(w("Error formatting date.",t))}return String(u)},formatTime:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=t.timeZone,s=n.format,l=t.onError||F,u=new Date(r),c=ot({},i&&{timeZone:i},s&&k(a,"time",s,l)),f=v(n,Jt,c);f.hour||f.minute||f.second||(f=ot({},f,{hour:"numeric",minute:"numeric"}));try{return e.getDateTimeFormat(o,f).format(u)}catch(t){l(w("Error formatting time.",t))}return String(u)},formatRelative:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,s=t.onError||F,l=new Date(r),u=new Date(n.now),c=i&&k(a,"relative",i,s),p=v(n,zt,c),h=ot({},f.thresholds);N(Qt);try{return e.getRelativeFormat(o,p).format(l,{now:isFinite(u)?u:e.now()})}catch(t){s(w("Error formatting relative time.",t))}finally{N(h)}return String(l)},formatNumber:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,s=t.onError||F,l=i&&k(a,"number",i,s),u=v(n,$t,l);try{return e.getNumberFormat(o,u).format(r)}catch(t){s(w("Error formatting number.",t))}return String(r)},formatPlural:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=v(n,Kt),i=t.onError||F;try{return e.getPluralFormat(o,a).format(r)}catch(t){i(w("Error formatting plural.",t))}return"other"},formatMessage:E,formatHTMLMessage:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return E(t,e,r,Object.keys(n).reduce(function(t,e){var r=n[e];return t[e]="string"==typeof r?y(r):r,t},{}))}}),Yt=Object.keys(Ft),te=Object.keys(Ot),ee={formats:{},messages:{},timeZone:null,textComponent:"span",defaultLocale:"en",defaultFormats:{},onError:F},re=function(t){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};et(this,e);var n=st(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));St("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||{}).formatters,s=void 0===i?{getDateTimeFormat:j(Intl.DateTimeFormat),getNumberFormat:j(Intl.NumberFormat),getMessageFormat:j(u),getRelativeFormat:j(f),getPluralFormat:j(Gt)}:i;return n.state=ot({},s,{now:function(){return n._didDisplay?Date.now():a}}),n}return at(e,t),rt(e,[{key:"getConfig",value:function(){var t=this.context.intl,e=v(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,a=n.defaultLocale,i=n.defaultFormats;(0,n.onError)(w('Missing locale data for locale: "'+o+'". Using default locale: "'+a+'" as fallback.')),e=ot({},e,{locale:a,formats:i,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=it(r,["now"]);return{intl:ot({},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 b.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:xt},re.childContextTypes={intl:xt.isRequired};var ne=function(t){function e(t,r){et(this,e);var n=st(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return g(r),n}return at(e,t),rt(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return b.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):D.createElement(r,null,i)}}]),e}(r.Component);ne.displayName="FormattedDate",ne.contextTypes={intl:xt};var oe=function(t){function e(t,r){et(this,e);var n=st(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return g(r),n}return at(e,t),rt(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return b.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):D.createElement(r,null,i)}}]),e}(r.Component);oe.displayName="FormattedTime",oe.contextTypes={intl:xt};var ae=1e3,ie=6e4,se=36e5,le=864e5,ue=2147483647,ce=function(t){function e(t,r){et(this,e);var n=st(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));g(r);var o=isFinite(t.initialNow)?Number(t.initialNow):r.intl.now();return n.state={now:o},n}return at(e,t),rt(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 s=i-e.now,l=M(o||A(s)),u=Math.abs(s%l),c=s<0?Math.max(a,l-u):Math.max(a,u);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){R(t.value,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 b.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,ot({},this.props,this.state));return"function"==typeof a?a(i):D.createElement(r,null,i)}}]),e}(r.Component);ce.displayName="FormattedRelative",ce.contextTypes={intl:xt},ce.defaultProps={updateInterval:1e4};var fe=function(t){function e(t,r){et(this,e);var n=st(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return g(r),n}return at(e,t),rt(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return b.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):D.createElement(r,null,i)}}]),e}(r.Component);fe.displayName="FormattedNumber",fe.contextTypes={intl:xt};var pe=function(t){function e(t,r){et(this,e);var n=st(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return g(r),n}return at(e,t),rt(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return b.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,s=e(o,this.props),l=this.props[s]||a;return"function"==typeof i?i(l):D.createElement(r,null,l)}}]),e}(r.Component);pe.displayName="FormattedPlural",pe.contextTypes={intl:xt},pe.defaultProps={style:"cardinal"};var he=function(t,e){return E({},{getMessageFormat:j(u)},t,e)},me=function(t){function e(t,r){et(this,e);var n=st(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return t.defaultMessage||g(r),n}return at(e,t),rt(e,[{key:"shouldComponentUpdate",value:function(t){var e=this.props.values;if(!_(t.values,e))return!0;for(var r=ot({},t,{values:e}),n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return b.apply(void 0,[this,r].concat(o))}},{key:"render",value:function(){var t=this.context.intl||{},e=t.formatMessage,n=void 0===e?he:e,o=t.textComponent,a=void 0===o?"span":o,i=this.props,s=i.id,l=i.description,u=i.defaultMessage,c=i.values,f=i.tagName,p=void 0===f?a:f,h=i.children,m=void 0,d=void 0,y=void 0;if(c&&Object.keys(c).length>0){var v=Math.floor(1099511627776*Math.random()).toString(16),g=function(){var t=0;return function(){return"ELEMENT-"+v+"-"+(t+=1)}}();m="@__"+v+"__@",d={},y={},Object.keys(c).forEach(function(t){var e=c[t];if(r.isValidElement(e)){var n=g();d[t]=m+n+m,y[n]=e}else d[t]=e})}var _=n({id:s,description:l,defaultMessage:u},d||c),b=void 0;return b=y&&Object.keys(y).length>0?_.split(m).filter(function(t){return!!t}).map(function(t){return y[t]||t}):[_],"function"==typeof h?h.apply(void 0,lt(b)):r.createElement.apply(void 0,[p,null].concat(lt(b)))}}]),e}(r.Component);me.displayName="FormattedMessage",me.contextTypes={intl:xt},me.defaultProps={values:{}};var de=function(t){function e(t,r){et(this,e);var n=st(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return g(r),n}return at(e,t),rt(e,[{key:"shouldComponentUpdate",value:function(t){var e=this.props.values;if(!_(t.values,e))return!0;for(var r=ot({},t,{values:e}),n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return b.apply(void 0,[this,r].concat(o))}},{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,s=n.values,l=n.tagName,u=void 0===l?r:l,c=n.children,f=e({id:o,description:a,defaultMessage:i},s);if("function"==typeof c)return c(f);var p={__html:f};return D.createElement(u,{dangerouslySetInnerHTML:p})}}]),e}(r.Component);de.displayName="FormattedHTMLMessage",de.contextTypes={intl:xt},de.defaultProps={values:{}},p(I),t.addLocaleData=p,t.intlShape=xt,t.injectIntl=function(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,s=function(e){function r(t,e){et(this,r);var n=st(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));return g(e),n}return at(r,e),rt(r,[{key:"getWrappedInstance",value:function(){return St(i,"[React Intl] To access the wrapped instance, the `{withRef: true}` option must be set when calling: `injectIntl()`"),this._wrappedInstance}},{key:"render",value:function(){var e=this;return D.createElement(t,ot({},this.props,nt({},o,this.context.intl),{ref:i?function(t){return e._wrappedInstance=t}:null}))}}]),r}(r.Component);return s.displayName="InjectIntl("+O(t)+")",s.contextTypes={intl:xt},s.WrappedComponent=t,Lt(s,t)},t.defineMessages=function(t){return t},t.IntlProvider=re,t.FormattedDate=ne,t.FormattedTime=oe,t.FormattedRelative=ce,t.FormattedNumber=fe,t.FormattedPlural=pe,t.FormattedMessage=me,t.FormattedHTMLMessage=de,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=react-intl.min.js.map