!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.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;r>t;t+=1)if(n=a[t])for(o in n)G.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 s(e,t){this.id=e,this.options=t}function u(e,t,r){var n="string"==typeof e?u.__parse(e):e;if(!n||"messageFormatPattern"!==n.type)throw new TypeError("A message must be provided as a String or AST.");r=this._mergeFormats(u.formats,r),W(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 l(e){return 400*e/146097}function c(e,t){e=+e,t=+t;var r=te(t-e),n=te(r/1e3),o=te(n/60),a=te(o/60),i=te(a/24),s=te(i/7),u=l(i),c=te(12*u),p=te(u);return{millisecond:r,second:n,minute:o,hour:a,day:i,week:s,month:c,year:p}}function p(e,t){t=t||{},X(e)&&(e=e.concat()),$(this,"_locale",{value:this._resolveLocale(e)}),$(this,"_options",{value:{style:this._resolveStyle(t.style),units:this._isValidUnits(t.units)&&t.units}}),$(this,"_locales",{value:e}),$(this,"_fields",{value:this._findFields(this._locale)}),$(this,"_messages",{value:K(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){u.__addLocaleData(e),p.__addLocaleData(e)})}function m(e){var t=e&&e.toLowerCase();return!(!u.__localeData__[t]||!p.__localeData__[t])}function d(e){return(""+e).replace(we,function(e){return _e[e]})}function h(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.intl;be(t,"[React Intl] Could not find required `intl` object. needs to exist in the component ancestry.")}function y(e,t){if(e===t)return!0;if("object"!==("undefined"==typeof e?"undefined":S["typeof"](e))||null===e||"object"!==("undefined"==typeof t?"undefined":S["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;a0;if(!f)return p||c||l;var m=void 0;if(p)try{var d=t.getMessageFormat(p,o,a);m=d.format(n)}catch(h){}if(!m&&c)try{var d=t.getMessageFormat(c,s,u);m=d.format(n)}catch(h){}return m||p||c||l}function R(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 O(e,t,r,o)}function j(e){return u.prototype._resolveLocale(e)}function N(e){return u.prototype._findPluralRuleFunction(e)}function A(e){var t=Ae(null);return function(){var r=Array.prototype.slice.call(arguments),n=M(r),o=n&&t[n];return o||(o=new(Oe.apply(e,[null].concat(r))),n&&(t[n]=o)),o}}function M(e){if("undefined"!=typeof JSON){var t,r,n,o=[];for(t=0,r=e.length;r>t;t+=1)n=e[t],n&&"object"===("undefined"==typeof n?"undefined":S["typeof"](n))?o.push(k(n)):o.push(n);return JSON.stringify(o)}}function k(e){var t,r,n,o,a=[],i=[];for(t in e)e.hasOwnProperty(t)&&i.push(t);var s=i.sort();for(r=0,n=s.length;n>r;r+=1)t=s[r],o={},o[t]=e[t],a[r]=o;return a}function E(e){var t=Math.abs(e);return qe>t?"second":Ue>t?"minute":Ge>t?"hour":"day"}function D(e){switch(e){case"second":return Se;case"minute":return qe;case"hour":return Ue;case"day":return Ge;default:return He}}function L(e){return e}var I="default"in t?t["default"]:t,S={};S["typeof"]=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},S.classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},S.createClass=function(){function e(e,t){for(var r=0;ro;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 Ye!==t&&(Ye>t&&(Ye=0,$e={line:1,column:1,seenCR:!1}),r($e,Ye,t),Ye=t),$e}function n(e){Ke>ze||(ze>Ke&&(Ke=ze,Qe=[]),Qe.push(e))}function o(n,o,a){function i(e){var t=1;for(e.sort(function(e,t){return e.descriptiont.description?1:0});t1?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 u=r(a),l=a1?arguments[1]:{},N={},A={start:a},M=a,k=function(e){return{type:"messageFormatPattern",elements:e}},E=N,D=function(e){var t,r,n,o,a,i="";for(t=0,n=e.length;n>t;t+=1)for(o=e[t],r=0,a=o.length;a>r;r+=1)i+=o[r];return i},L=function(e){return{type:"messageTextElement",value:e}},I=/^[^ \t\n\r,.+={}#]/,S={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},q="{",U={type:"literal",value:"{",description:'"{"'},G=null,H=",",W={type:"literal",value:",",description:'","'},V="}",Z={type:"literal",value:"}",description:'"}"'},B=function(e,t){return{type:"argumentElement",id:e,format:t&&t[2]}},z="number",J={type:"literal",value:"number",description:'"number"'},Y="date",$={type:"literal",value:"date",description:'"date"'},K="time",Q={type:"literal",value:"time",description:'"time"'},X=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",se={type:"literal",value:"select",description:'"select"'},ue=function(e){return{type:"selectFormat",options:e}},le="=",ce={type:"literal",value:"=",description:'"="'},pe=function(e,t){return{type:"optionalFormatPattern",selector:e,value:t}},fe="offset:",me={type:"literal",value:"offset:",description:'"offset:"'},de=function(e){return e},he=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"},_e=/^[0-9]/,we={type:"class",value:"[0-9]",description:"[0-9]"},Fe=/^[0-9a-f]/i,Te={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},Pe="0",Ce={type:"literal",value:"0",description:'"0"'},xe=/^[1-9]/,Oe={type:"class",value:"[1-9]",description:"[1-9]"},Re=function(e){return parseInt(e,10)},je=/^[^{}\\\0-\x1F \t\n\r]/,Ne={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},Ae="\\\\",Me={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},ke=function(){return"\\"},Ee="\\#",De={type:"literal",value:"\\#",description:'"\\\\#"'},Le=function(){return"\\#"},Ie="\\{",Se={type:"literal",value:"\\{",description:'"\\\\{"'},qe=function(){return"{"},Ue="\\}",Ge={type:"literal",value:"\\}",description:'"\\\\}"'},He=function(){return"}"},We="\\u",Ve={type:"literal",value:"\\u",description:'"\\\\u"'},Ze=function(e){return String.fromCharCode(parseInt(e,16))},Be=function(e){return e.join("")},ze=0,Je=0,Ye=0,$e={line:1,column:1,seenCR:!1},Ke=0,Qe=[],Xe=0;if("startRule"in j){if(!(j.startRule in A))throw new Error("Can't start parsing from rule \""+j.startRule+'".');M=A[j.startRule]}if(R=M(),R!==N&&ze===e.length)return R;throw R!==N&&zet;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,u=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,u);case"selectFormat":return r=this.compileOptions(e),new s(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;a>o;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,"#")},s.prototype.getOption=function(e){var t=this.options;return t[e]||t.other},W(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"}}}}),W(u,"__localeData__",{value:V(null)}),W(u,"__addLocaleData",{value:function(e){if(!e||!e.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");u.__localeData__[e.locale.toLowerCase()]=e}}),W(u,"__parse",{value:Z.parse}),W(u,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),u.prototype.resolvedOptions=function(){return{locale:this._locale}},u.prototype._compilePattern=function(e,t,r,o){var a=new n(t,r,o);return a.compile(e)},u.prototype._findPluralRuleFunction=function(e){for(var t=u.__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)},u.prototype._format=function(e,t){var r,n,o,a,i,s="";for(r=0,n=e.length;n>r;r+=1)if(o=e[r],"string"!=typeof o){if(a=o.id,!t||!G.call(t,a))throw new Error("A value must be provided for: "+a);i=t[a],s+=o.options?this._format(o.getOption(i),t):o.format(i)}else s+=o;return s},u.prototype._mergeFormats=function(e,t){var n,o,a={};for(n in e)G.call(e,n)&&(a[n]=o=V(e[n]),t&&G.call(t,n)&&r(o,t[n]));return a},u.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(u.defaultLocale);var t,r,n,o,a=u.__localeData__;for(t=0,r=e.length;r>t;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)},u.__addLocaleData(U),u.defaultLocale="en";var B={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"}}}}},z=Object.prototype.hasOwnProperty,J=Object.prototype.toString,Y=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),$=(!Y&&!Object.prototype.__defineGetter__,Y?Object.defineProperty:function(e,t,r){"get"in r&&e.__defineGetter__?e.__defineGetter__(t,r.get):(!z.call(e,t)||"value"in r)&&(e[t]=r.value)}),K=Object.create||function(e,t){function r(){}var n,o;r.prototype=e,n=new r;for(o in t)z.call(t,o)&&$(n,o,t[o]);return n},Q=Array.prototype.indexOf||function(e,t){var r=this;if(!r.length)return-1;for(var n=t||0,o=r.length;o>n;n++)if(r[n]===e)return n;return-1},X=Array.isArray||function(e){return"[object Array]"===J.call(e)},ee=Date.now||function(){return(new Date).getTime()},te=Math.round,re=["second","minute","hour","day","month","year"],ne=["best fit","numeric"];$(p,"__localeData__",{value:K(null)}),$(p,"__addLocaleData",{value:function(e){if(!e||!e.locale)throw new Error("Locale data provided to IntlRelativeFormat is missing a `locale` property value");p.__localeData__[e.locale.toLowerCase()]=e,u.__addLocaleData(e)}}),$(p,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),$(p,"thresholds",{enumerable:!0,value:{second:45,minute:45,hour:22,day:26,month:11}}),p.prototype.resolvedOptions=function(){return{locale:this._locale,style:this._options.style,units:this._options.units}},p.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 s="{when, select, future {{0, plural, "+a+"}}past {{0, plural, "+i+"}}}";return new u(s,r)},p.prototype._getMessage=function(e){var t=this._messages;return t[e]||(t[e]=this._compileMessage(e)),t[e]},p.prototype._getRelativeUnits=function(e,t){var r=this._fields[t];return r.relative?r.relative[e]:void 0},p.prototype._findFields=function(e){for(var t=p.__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)},p.prototype._format=function(e,t){var r=t&&void 0!==t.now?t.now:ee();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=c(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:0>a?"past":"future"})},p.prototype._isValidUnits=function(e){if(!e||Q.call(re,e)>=0)return!0;if("string"==typeof e){var t=/s$/.test(e)&&e.substr(0,e.length-1);if(t&&Q.call(re,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: "'+re.join('", "')+'"')},p.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(p.defaultLocale);var t,r,n,o,a=p.__localeData__;for(t=0,r=e.length;r>t;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)},p.prototype._resolveStyle=function(e){if(!e)return ne[0];if(Q.call(ne,e)>=0)return e;throw new Error('"'+e+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+ne.join('", "')+'"')},p.prototype._selectUnits=function(e){var t,r,n;for(t=0,r=re.length;r>t&&(n=re[t],!(Math.abs(e[n])":">","<":"<",'"':""","'":"'"},we=/[&><"']/g,Fe=Object.keys(he),Te=Object.keys(ye),Pe=Object.keys(ve),Ce=Object.keys(ge),xe=Object.freeze({formatDate:F,formatTime:T,formatRelative:P,formatNumber:C,formatPlural:x,formatMessage:O,formatHTMLMessage:R}),Oe=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},Re=Object.prototype.hasOwnProperty,je=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),Ne=(!je&&!Object.prototype.__defineGetter__,je?Object.defineProperty:function(e,t,r){"get"in r&&e.__defineGetter__?e.__defineGetter__(t,r.get):(!Re.call(e,t)||"value"in r)&&(e[t]=r.value)}),Ae=Object.create||function(e,t){function r(){}var n,o;r.prototype=e,n=new r;for(o in t)Re.call(t,o)&&Ne(n,o,t[o]);return n},Me=function Je(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];S.classCallCheck(this,Je);var r="ordinal"===t.style,n=N(j(e));this.format=function(e){return n(e,r)}},ke=Object.keys(pe),Ee=Object.keys(fe),De=function(e){function r(e,t){S.classCallCheck(this,r);var n=S.possibleConstructorReturn(this,Object.getPrototypeOf(r).call(this,e,t));be(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=void 0;return o=isFinite(e.initialNow)?Number(e.initialNow):t.intl?t.intl.now():Date.now(),n.state={getDateTimeFormat:A(Intl.DateTimeFormat),getNumberFormat:A(Intl.NumberFormat),getMessageFormat:A(u),getRelativeFormat:A(p),getPluralFormat:A(Me),now:function(){return n._didDisplay?Date.now():o}},n}return S.inherits(r,e),S.createClass(r,[{key:"getConfig",value:function(){var e=this,t=this.context.intl,n=void 0===t?{}:t,o=ke.reduce(function(t,r){return t[r]=e.props[r]||n[r],t},{});if(!m(o.locale)){var a=o,i=(a.locale,a.defaultLocale),s=a.defaultFormats;o=S["extends"]({},o,{locale:i,formats:s,messages:r.defaultProps.messages})}return o}},{key:"getBoundFormatFns",value:function(e,t){return Ee.reduce(function(r,n){return r[n]=xe[n].bind(null,e,t),r},{})}},{key:"getChildContext",value:function(){var e=this.getConfig(),t=this.getBoundFormatFns(e,this.state);return{intl:S["extends"]({},e,t,{now:this.state.now})}}},{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return v.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);De.displayName="IntlProvider",De.contextTypes={intl:me},De.childContextTypes={intl:me.isRequired},De.propTypes=S["extends"]({},pe,{children:t.PropTypes.element.isRequired,initialNow:t.PropTypes.any}),De.defaultProps={formats:{},messages:{},defaultLocale:"en",defaultFormats:{}};var Le=function(e){function t(e,r){S.classCallCheck(this,t);var n=S.possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,e,r));return h(r),n}return S.inherits(t,e),S.createClass(t,[{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return v.apply(void 0,[this].concat(t))}},{key:"render",value:function(){var e=this.context.intl.formatDate,t=this.props,r=t.value,n=t.children,o=e(r,this.props);return"function"==typeof n?n(o):I.createElement("span",null,o)}}]),t}(t.Component);Le.displayName="FormattedDate",Le.contextTypes={intl:me},Le.propTypes=S["extends"]({},he,{value:t.PropTypes.any.isRequired,format:t.PropTypes.string,children:t.PropTypes.func});var Ie=function(e){function t(e,r){S.classCallCheck(this,t);var n=S.possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,e,r));return h(r),n}return S.inherits(t,e),S.createClass(t,[{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return v.apply(void 0,[this].concat(t))}},{key:"render",value:function(){var e=this.context.intl.formatTime,t=this.props,r=t.value,n=t.children,o=e(r,this.props);return"function"==typeof n?n(o):I.createElement("span",null,o)}}]),t}(t.Component);Ie.displayName="FormattedTime",Ie.contextTypes={intl:me},Ie.propTypes=S["extends"]({},he,{value:t.PropTypes.any.isRequired,format:t.PropTypes.string,children:t.PropTypes.func});var Se=1e3,qe=6e4,Ue=36e5,Ge=864e5,He=2147483647,We=function(e){function t(e,r){S.classCallCheck(this,t);var n=S.possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,e,r));h(r);var o=isFinite(e.initialNow)?Number(e.initialNow):r.intl.now();return n.state={now:o},n}return S.inherits(t,e),S.createClass(t,[{key:"scheduleNextUpdate",value:function(e,t){var r=this,n=e.updateInterval;if(n){var o=Number(e.value)-t.now,a=e.units||E(o),i=D(a),s=Math.abs(o%i),u=0>o?Math.max(n,i-s):Math.max(n,s);clearTimeout(this._timer),this._timer=setTimeout(function(){r.setState({now:r.context.intl.now()})},u)}}},{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return v.apply(void 0,[this].concat(t))}},{key:"componentWillUpdate",value:function(e,t){this.scheduleNextUpdate(e,t)}},{key:"componentDidMount",value:function(){this.scheduleNextUpdate(this.props,this.state)}},{key:"componentWillUnmount",value:function(){clearTimeout(this._timer)}},{key:"render",value:function(){var e=this.context.intl.formatRelative,t=this.props,r=t.value,n=t.children,o=e(r,S["extends"]({},this.props,this.state));return"function"==typeof n?n(o):I.createElement("span",null,o)}}]),t}(t.Component);We.displayName="FormattedRelative",We.contextTypes={intl:me},We.propTypes=S["extends"]({},ve,{value:t.PropTypes.any.isRequired,format:t.PropTypes.string,updateInterval:t.PropTypes.number,initialNow:t.PropTypes.any,children:t.PropTypes.func}),We.defaultProps={updateInterval:1e4};var Ve=function(e){function t(e,r){S.classCallCheck(this,t);var n=S.possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,e,r));return h(r),n}return S.inherits(t,e),S.createClass(t,[{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return v.apply(void 0,[this].concat(t))}},{key:"render",value:function(){var e=this.context.intl.formatNumber,t=this.props,r=t.value,n=t.children,o=e(r,this.props);return"function"==typeof n?n(o):I.createElement("span",null,o)}}]),t}(t.Component);Ve.displayName="FormattedNumber",Ve.contextTypes={intl:me},Ve.propTypes=S["extends"]({},ye,{value:t.PropTypes.any.isRequired,format:t.PropTypes.string,children:t.PropTypes.func});var Ze=function(e){function t(e,r){S.classCallCheck(this,t);var n=S.possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,e,r));return h(r),n}return S.inherits(t,e),S.createClass(t,[{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return v.apply(void 0,[this].concat(t))}},{key:"render",value:function(){var e=this.context.intl.formatPlural,t=this.props,r=t.value,n=t.other,o=t.children,a=e(r,this.props),i=this.props[a]||n;return"function"==typeof o?o(i):I.createElement("span",null,i)}}]),t}(t.Component);Ze.displayName="FormattedPlural",Ze.contextTypes={intl:me},Ze.propTypes=S["extends"]({},ge,{value:t.PropTypes.any.isRequired,other:t.PropTypes.node.isRequired,zero:t.PropTypes.node,one:t.PropTypes.node,two:t.PropTypes.node,few:t.PropTypes.node,many:t.PropTypes.node,children:t.PropTypes.func}),Ze.defaultProps={style:"cardinal"};var Be=function(e){function r(e,t){S.classCallCheck(this,r);var n=S.possibleConstructorReturn(this,Object.getPrototypeOf(r).call(this,e,t));return h(t),n}return S.inherits(r,e),S.createClass(r,[{key:"shouldComponentUpdate",value:function(e){var t=this.props.values,r=e.values;if(!y(r,t))return!0;for(var n=S["extends"]({},e,{values:t}),o=arguments.length,a=Array(o>1?o-1:0),i=1;o>i;i++)a[i-1]=arguments[i];return v.apply(void 0,[this,n].concat(a))}},{key:"render",value:function(){var e=this.context.intl.formatMessage,r=this.props,n=r.id,o=r.description,a=r.defaultMessage,i=r.values,s=r.tagName,u=r.children,l=Math.floor(1099511627776*Math.random()).toString(16),c=new RegExp("(@__ELEMENT-"+l+"-\\d+__@)","g"),p=function(){var e=0;return function(){return"@__ELEMENT-"+l+"-"+(e+=1)+"__@"}}(),f={},m={};Object.keys(i).forEach(function(e){var r=i[e];if(t.isValidElement(r)){var n=p();f[e]=n,m[n]=r}else f[e]=r});var d={id:n,description:o,defaultMessage:a},h=e(d,f),y=h.split(c).filter(function(e){return!!e}).map(function(e){return m[e]||e});return"function"==typeof u?u.apply(void 0,S.toConsumableArray(y)):t.createElement.apply(void 0,[s,null].concat(S.toConsumableArray(y)))}}]),r}(t.Component);Be.displayName="FormattedMessage",Be.contextTypes={intl:me},Be.propTypes=S["extends"]({},de,{values:t.PropTypes.object,tagName:t.PropTypes.string,children:t.PropTypes.func}),Be.defaultProps={values:{},tagName:"span"};var ze=function(e){function r(e,t){S.classCallCheck(this,r);var n=S.possibleConstructorReturn(this,Object.getPrototypeOf(r).call(this,e,t));return h(t),n}return S.inherits(r,e),S.createClass(r,[{key:"shouldComponentUpdate",value:function(e){var t=this.props.values,r=e.values;if(!y(r,t))return!0;for(var n=S["extends"]({},e,{values:t}),o=arguments.length,a=Array(o>1?o-1:0),i=1;o>i;i++)a[i-1]=arguments[i];return v.apply(void 0,[this,n].concat(a))}},{key:"render",value:function(){var e=this.context.intl.formatHTMLMessage,r=this.props,n=r.id,o=r.description,a=r.defaultMessage,i=r.values,s=r.tagName,u=r.children,l={id:n,description:o,defaultMessage:a},c=e(l,i);return"function"==typeof u?u(c):t.createElement(s,{dangerouslySetInnerHTML:{__html:c}})}}]),r}(t.Component);ze.displayName="FormattedHTMLMessage",ze.contextTypes={intl:me},ze.propTypes=S["extends"]({},de,{values:t.PropTypes.object,tagName:t.PropTypes.string,children:t.PropTypes.func}),ze.defaultProps={values:{},tagName:"span"},f(q),e.addLocaleData=f,e.defineMessages=L,e.intlShape=me,e.injectIntl=b,e.IntlProvider=De,e.FormattedDate=Le,e.FormattedTime=Ie,e.FormattedRelative=We,e.FormattedNumber=Ve,e.FormattedPlural=Ze,e.FormattedMessage=Be,e.FormattedHTMLMessage=ze}); //# sourceMappingURL=react-intl.min.js.map