From 178e6f531221b561fbdeb90174330d3a228f95d3 Mon Sep 17 00:00:00 2001 From: Alan Souza Date: Mon, 1 Jun 2015 22:52:52 -0700 Subject: [PATCH] v0.2.1 --- bower.json | 4 +- grommet.js | 12790 ++++++++++++++++++++++++++++++++++++++++------- grommet.min.js | 20 +- 3 files changed, 11100 insertions(+), 1714 deletions(-) diff --git a/bower.json b/bower.json index c69b817..0cfa981 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,8 @@ { "name": "grommet", - "version": "0.2.0", + "version": "0.2.1", "main": "grommet.js", - "description": "The most advanced UI framework for enterprise applications.", + "description": "The most advanced UX framework for enterprise applications.", "authors": [ "Alan Souza", "Bryan Jacquot", diff --git a/grommet.js b/grommet.js index c337f3d..5d988ea 100644 --- a/grommet.js +++ b/grommet.js @@ -79,9 +79,9 @@ var Grommet = Edit: __webpack_require__(27), Filter: __webpack_require__(28), Help: __webpack_require__(29), - More: __webpack_require__(30), - Next: __webpack_require__(31), - Previous: __webpack_require__(32), + Left: __webpack_require__(30), + More: __webpack_require__(31), + Right: __webpack_require__(32), Search: __webpack_require__(33), SearchPlus: __webpack_require__(34), Spinning: __webpack_require__(35), @@ -111,14 +111,20 @@ var Grommet = var React = __webpack_require__(42); + var IntlMixin = __webpack_require__(43); + var App = React.createClass({displayName: "App", + mixins: [IntlMixin], + propTypes: { centered: React.PropTypes.bool }, getDefaultProps: function () { - return {centered: true}; + return { + centered: true + }; }, render: function() { @@ -132,9 +138,19 @@ var Grommet = if (this.props.className) { classes.push(this.props.className); } + + //remove this when React 0.14 is released. This is required because context props are not being propagated to children. + var children = React.Children.map(this.props.children, function(child) { + if (child) { + return React.cloneElement(child, this.getChildContext()); + } else { + return null; + } + }.bind(this)); + return ( React.createElement("div", {className: classes.join(' ')}, - this.props.children + children ) ); } @@ -151,6 +167,8 @@ var Grommet = var React = __webpack_require__(42); + var CLASS_ROOT = "check-box"; + var CheckBox = React.createClass({displayName: "CheckBox", propTypes: { @@ -159,22 +177,27 @@ var Grommet = id: React.PropTypes.string.isRequired, label: React.PropTypes.string.isRequired, name: React.PropTypes.string, - onChange: React.PropTypes.func + onChange: React.PropTypes.func, + toggle: React.PropTypes.bool }, render: function () { - var classes = ["check-box"]; + var classes = [CLASS_ROOT]; + if (this.props.toggle) { + classes.push(CLASS_ROOT + "--toggle"); + } if (this.props.className) { classes.push(this.props.className); } return ( - React.createElement("span", {className: classes.join(' ')}, - React.createElement("input", {className: "check-box__input", + React.createElement("label", {className: classes.join(' ')}, + React.createElement("input", {className: CLASS_ROOT + "__input", id: this.props.id, name: this.props.name, type: "checkbox", checked: this.props.checked, defaultChecked: this.props.defaultChecked, onChange: this.props.onChange}), - React.createElement("label", {className: "check-box__label checkbox", htmlFor: this.props.id}, + React.createElement("span", {className: CLASS_ROOT + "__control"}), + React.createElement("span", {className: CLASS_ROOT + "__label"}, this.props.label ) ) @@ -191,23 +214,36 @@ var Grommet = /***/ function(module, exports, __webpack_require__) { // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + var React = __webpack_require__(42); + var CLASS_ROOT = "document"; + var GrommetDocument = React.createClass({displayName: "GrommetDocument", propTypes: { - colorIndex: React.PropTypes.string + colorIndex: React.PropTypes.string, + flush: React.PropTypes.bool + }, + + getDefaultProps: function () { + return { + flush: true + }; }, render: function() { - var classes = ["document"]; + var classes = [CLASS_ROOT]; + if (this.props.flush) { + classes.push(CLASS_ROOT + "--flush"); + } if (this.props.colorIndex) { classes.push("header-color-index-" + this.props.colorIndex); } return ( React.createElement("div", {ref: "document", className: classes.join(' ')}, - React.createElement("div", {className: "document__content"}, + React.createElement("div", {className: CLASS_ROOT + "__content"}, this.props.children ) ) @@ -225,24 +261,41 @@ var Grommet = // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. var React = __webpack_require__(42); + var Legend = __webpack_require__(44); + var CLASS_ROOT = "donut"; var BASE_SIZE = 192; + var PARTIAL_SIZE = 168; function polarToCartesian (centerX, centerY, radius, angleInDegrees) { - var angleInRadians = (angleInDegrees-90) * Math.PI / 180.0; + var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0; return { x: centerX + (radius * Math.cos(angleInRadians)), y: centerY + (radius * Math.sin(angleInRadians)) }; } - function describeArc (x, y, radius, startAngle, endAngle) { + function arcCommands (x, y, radius, startAngle, endAngle) { var start = polarToCartesian(x, y, radius, endAngle); var end = polarToCartesian(x, y, radius, startAngle); var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"; var d = [ - "M", start.x, start.y, - "A", radius, radius, 0, arcSweep, 0, end.x, end.y + "M", start.x, start.y, + "A", radius, radius, 0, arcSweep, 0, end.x, end.y + ].join(" "); + return d; + } + + function activeIndicatorCommands (x, y, radius, startAngle, endAngle) { + var midAngle = endAngle - ((endAngle - startAngle) / 2); + var point = polarToCartesian(x, y, radius - 24, midAngle); + var start = polarToCartesian(x, y, radius, midAngle - 10); + var end = polarToCartesian(x, y, radius, midAngle + 10); + //var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"; + var d = ["M", point.x, point.y, + "L", start.x, start.y, + "A", radius, radius, 0, 0, 0, end.x, end.y, + "Z" ].join(" "); return d; } @@ -251,32 +304,54 @@ var Grommet = propTypes: { legend: React.PropTypes.bool, + partial: React.PropTypes.bool, + max: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + value: React.PropTypes.number, + label: React.PropTypes.string + }), + React.PropTypes.number + ]), + min: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + value: React.PropTypes.number, + label: React.PropTypes.string + }), + React.PropTypes.number + ]), series: React.PropTypes.arrayOf(React.PropTypes.shape({ label: React.PropTypes.string, - value: React.PropTypes.number, - colorIndex: React.PropTypes.oneOfType([ - React.PropTypes.number, // 1-6 - React.PropTypes.string // status - ]), + value: React.PropTypes.number.isRequired, + units: React.PropTypes.string, + colorIndex: React.PropTypes.string, + important: React.PropTypes.bool, onClick: React.PropTypes.func - })).isRequired, - units: React.PropTypes.string + })), + small: React.PropTypes.bool, + units: React.PropTypes.string, + value: React.PropTypes.number + }, + + getDefaultProps: function () { + return { + max: {value: 100}, + min: {value: 0} + }; }, _initialTimeout: function () { - this.setState({initial: false, activeIndex: 0}); + this.setState({ + initial: false, + activeIndex: this.state.importantIndex + }); clearTimeout(this._timeout); }, - _onMouseOver: function (index) { + _onActive: function (index) { this.setState({initial: false, activeIndex: index}); }, - _onMouseOut: function () { - this.setState({initial: false, activeIndex: 0}); - }, - - _onResize: function() { + _layout: function () { // orientation based on available window orientation var ratio = window.innerWidth / window.innerHeight; if (ratio < 0.8) { @@ -288,33 +363,78 @@ var Grommet = var parentElement = this.refs.donut.getDOMNode().parentNode; var width = parentElement.offsetWidth; var height = parentElement.offsetHeight; - if (height < BASE_SIZE || width < BASE_SIZE || - (width < (BASE_SIZE * 2) && height < (BASE_SIZE * 2))) { + var donutHeight = BASE_SIZE; + if (this.props.partial) { + donutHeight = PARTIAL_SIZE; + } + if (height < donutHeight || width < BASE_SIZE || + (width < (BASE_SIZE * 2) && height < (donutHeight * 2))) { this.setState({size: 'small'}); } else { this.setState({size: null}); } }, + _onResize: function() { + // debounce + clearTimeout(this._resizeTimer); + this._resizeTimer = setTimeout(this._layout, 50); + }, + + _generateSeries: function (props) { + var total = props.max.value - props.min.value; + var remaining = total - (props.value - props.min.value); + return [ + {value: props.value}, + {value: remaining, colorIndex: 'unset'} + ]; + }, + + _importantIndex: function (series) { + var result = 0; + series.some(function (data, index) { + if (data.important) { + result = index; + return true; + } + }); + return result; + }, + getInitialState: function() { + var series = this.props.series || this._generateSeries(this.props); + var importantIndex = this._importantIndex(series); return { initial: true, - activeIndex: 0, + importantIndex: importantIndex, + activeIndex: importantIndex, legend: false, - orientation: 'portrait' + orientation: 'portrait', + series: series }; }, componentDidMount: function() { - this._timeout = setTimeout(this._initialTimeout, 10); + console.log('Grommet Donut is deprecated. Please use Grommet Meter instead.'); + this._initialTimer = setTimeout(this._initialTimeout, 10); this.setState({initial: true, activeIndex: 0}); window.addEventListener('resize', this._onResize); - setTimeout(this._onResize, 10); + this._onResize(); + }, + + componentWillReceiveProps: function (newProps) { + var series = newProps.series || this._generateSeries(newProps); + var importantIndex = this._importantIndex(series); + this.setState({ + importantIndex: importantIndex, + activeIndex: importantIndex, + series: series + }); }, componentWillUnmount: function() { - clearTimeout(this._timeout); - this._timeout = null; + clearTimeout(this._initialTimer); + clearTimeout(this._resizeTimer); window.removeEventListener('resize', this._onResize); }, @@ -322,106 +442,132 @@ var Grommet = return item.colorIndex || ('graph-' + (index + 1)); }, - _renderLegend: function () { - var total = 0; - - var legends = this.props.series.map(function (item, index) { - var legendClasses = ["donut__legend-item"]; - if (this.state.activeIndex === index) { - legendClasses.push("donut__legend-item--active"); - } - var colorIndex = this._itemColorIndex(item, index); - total += item.value; - - return( - React.createElement("li", {key: item.label, className: legendClasses.join(' '), - onMouseOver: this._onMouseOver.bind(this, index), - onMouseOut: this._onMouseOut.bind(this, index)}, - React.createElement("svg", {className: "donut__legend-item-swatch color-index-" + colorIndex, - viewBox: "0 0 12 12"}, - React.createElement("path", {className: item.className, d: "M 5 0 l 0 12"}) - ), - React.createElement("span", {className: "donut__legend-item-label"}, item.label), - React.createElement("span", {className: "donut__legend-item-value"}, item.value), - React.createElement("span", {className: "donut__legend-item-units"}, this.props.units) - ) - ); - }, this); - - return ( - React.createElement("ol", {className: "donut__legend"}, - legends, - React.createElement("li", {className: "donut__legend-total"}, - React.createElement("span", {className: "donut__legend-total-label"}, "Total"), - React.createElement("span", {className: "donut__legend-total-value"}, total), - React.createElement("span", {className: "donut__legend-total-units"}, this.props.units) - ) - ) - ); - }, - render: function() { - var classes = ["donut", "donut--" + this.state.orientation]; + var classes = [CLASS_ROOT, CLASS_ROOT + "--" + this.state.orientation]; if (this.state.size) { - classes.push("donut--" + this.state.size); + classes.push(CLASS_ROOT + "--" + this.state.size); + } + if (this.props.partial) { + classes.push(CLASS_ROOT + "--partial"); + } + if (this.props.small) { + classes.push(CLASS_ROOT + "--small"); + } + + var viewBoxHeight = BASE_SIZE; + if (this.props.partial) { + viewBoxHeight = PARTIAL_SIZE; } var total = 0; - this.props.series.some(function (item) { + this.state.series.some(function (item) { total += item.value; }); var startAngle = 0; var anglePer = 360.0 / total; + if (this.props.partial) { + startAngle = 60; + anglePer = 240.0 / total; + } var value = null; var units = null; var label = null; + var activeIndicator = null; - var paths = this.props.series.map(function (item, index) { + var paths = this.state.series.map(function (item, index) { var endAngle = Math.min(360, Math.max(10, startAngle + (anglePer * item.value))); + if (item.value > 0 && (startAngle + 360) === endAngle) { + // full use for this item, make sure we render it. + endAngle -= 0.1; + } var radius = 84; - var commands = describeArc(BASE_SIZE/2, BASE_SIZE/2, radius, startAngle, endAngle); - startAngle = endAngle; + // start from the bottom + var commands = arcCommands(BASE_SIZE / 2, BASE_SIZE / 2, radius, + startAngle + 180, endAngle + 180); var colorIndex = this._itemColorIndex(item, index); - var sliceClasses = ["donut__slice"]; + var sliceClasses = [CLASS_ROOT + "__slice"]; sliceClasses.push("color-index-" + colorIndex); if (this.state.activeIndex === index) { - sliceClasses.push("donut__slice--active"); + sliceClasses.push(CLASS_ROOT + "__slice--active"); value = item.value; - units = item.units; + units = item.units || this.props.units; label = item.label; } - return( + if (index === this.state.activeIndex) { + var indicatorCommands = activeIndicatorCommands(BASE_SIZE / 2, BASE_SIZE / 2, radius, + startAngle + 180, endAngle + 180); + activeIndicator = ( + React.createElement("path", {stroke: "none", + className: CLASS_ROOT + "__slice-indicator color-index-" + colorIndex, + d: indicatorCommands}) + ); + } + + startAngle = endAngle; + + return ( React.createElement("path", {key: item.label, fill: "none", className: sliceClasses.join(' '), d: commands, - onMouseOver: this._onMouseOver.bind(null, index), - onMouseOut: this._onMouseOut.bind(null, index), + onMouseOver: this._onActive.bind(this, index), + onMouseOut: this._onActive.bind(this, this.state.importantIndex), onClick: item.onClick}) ); }, this); + var minLabel; + var maxLabel; + if (this.props.partial) { + if (this.props.min) { + minLabel = ( + React.createElement("div", {className: CLASS_ROOT + "__min-label"}, + this.props.min.value, " ", this.props.units + ) + ); + } + if (this.props.max) { + maxLabel = ( + React.createElement("div", {className: CLASS_ROOT + "__max-label"}, + this.props.max.value, " ", this.props.units + ) + ); + } + } + var legend = null; if (this.props.legend) { - legend = this._renderLegend(); + legend = ( + React.createElement(Legend, {className: CLASS_ROOT + "__legend", + series: this.props.series, + units: this.props.units, + value: this.props.value, + activeIndex: this.state.activeIndex, + onActive: this._onActive}) + ); } return ( React.createElement("div", {ref: "donut", className: classes.join(' ')}, - React.createElement("div", {className: "donut__graphic-container"}, - React.createElement("svg", {className: "donut__graphic", - viewBox: "0 0 " + BASE_SIZE + " " + BASE_SIZE, + React.createElement("div", {className: CLASS_ROOT + "__graphic-container"}, + React.createElement("svg", {className: CLASS_ROOT + "__graphic", + viewBox: "0 0 " + BASE_SIZE + " " + viewBoxHeight, preserveAspectRatio: "xMidYMid meet"}, - React.createElement("g", null, paths) + React.createElement("g", null, + activeIndicator, + paths + ) ), - React.createElement("div", {className: "donut__active"}, - React.createElement("div", {className: "donut__active-value large-number-font"}, + React.createElement("div", {className: CLASS_ROOT + "__active"}, + React.createElement("div", {className: CLASS_ROOT + "__active-value large-number-font"}, value, - React.createElement("span", {className: "donut__active-units large-number-font"}, units) + React.createElement("span", {className: CLASS_ROOT + "__active-units large-number-font"}, units) ), - React.createElement("div", {className: "donut__active-label"}, label) - ) + React.createElement("div", {className: CLASS_ROOT + "__active-label"}, label) + ), + minLabel, + maxLabel ), legend ) @@ -440,17 +586,26 @@ var Grommet = // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. var React = __webpack_require__(42); - var Top = __webpack_require__(43); + var Top = __webpack_require__(45); + + var CLASS_ROOT = "footer"; var Footer = React.createClass({displayName: "Footer", propTypes: { centered: React.PropTypes.bool, colorIndex: React.PropTypes.string, + flush: React.PropTypes.bool, primary: React.PropTypes.bool, scrollTop: React.PropTypes.bool }, + getDefaultProps: function () { + return { + flush: true + }; + }, + _updateState: function () { this.setState({scrolled: this._scrollable.scrollTop > 0}); }, @@ -489,12 +644,15 @@ var Grommet = }, render: function() { - var classes = ["footer"]; + var classes = [CLASS_ROOT]; if (this.props.primary) { - classes.push("footer--primary"); + classes.push(CLASS_ROOT + "--primary"); } if (this.props.centered) { - classes.push("footer--centered"); + classes.push(CLASS_ROOT + "--centered"); + } + if (this.props.flush) { + classes.push(CLASS_ROOT + "--flush"); } if (this.props.colorIndex) { classes.push("background-color-index-" + this.props.colorIndex); @@ -506,7 +664,7 @@ var Grommet = var top = null; if (this.props.scrollTop && this.state.scrolled) { top = ( - React.createElement("div", {className: "footer__top control-icon", + React.createElement("div", {className: CLASS_ROOT + "__top control-icon", onClick: this._onClickTop}, React.createElement(Top, null) ) @@ -515,7 +673,7 @@ var Grommet = return ( React.createElement("div", {ref: "footer", className: classes.join(' ')}, - React.createElement("div", {className: "footer__content"}, + React.createElement("div", {className: CLASS_ROOT + "__content"}, this.props.children, top ) @@ -536,18 +694,36 @@ var Grommet = var React = __webpack_require__(42); + var CLASS_ROOT = "form"; + var Form = React.createClass({displayName: "Form", propTypes: { compact: React.PropTypes.bool, + fill: React.PropTypes.bool, + flush: React.PropTypes.bool, onSubmit: React.PropTypes.func, className: React.PropTypes.string }, + getDefaultProps: function () { + return { + compact: false, + fill: false, + flush: true + }; + }, + render: function () { - var classes = ["form"]; + var classes = [CLASS_ROOT]; if (this.props.compact) { - classes.push("form--compact"); + classes.push(CLASS_ROOT + "--compact"); + } + if (this.props.fill) { + classes.push(CLASS_ROOT + "--fill"); + } + if (this.props.flush) { + classes.push(CLASS_ROOT + "--flush"); } if (this.props.className) { classes.push(this.props.className); @@ -584,8 +760,47 @@ var Grommet = required: React.PropTypes.bool }, + _onFocus: function () { + this.setState({focus: true}); + }, + + _onBlur: function () { + this.setState({focus: false}); + }, + + _onClick: function () { + if (this._inputElement) { + this._inputElement.focus(); + } + }, + + getInitialState: function () { + return {focus: false}; + }, + + componentDidMount: function () { + var contentsElement = this.refs.contents.getDOMNode(); + var inputElements = contentsElement.querySelectorAll('input, textarea, select'); + if (inputElements.length === 1) { + this._inputElement = inputElements[0]; + this._inputElement.addEventListener('focus', this._onFocus); + this._inputElement.addEventListener('blur', this._onBlur); + } + }, + + componentWillUnmount: function () { + if (this._inputElement) { + this._inputElement.removeEventListener('focus', this._onFocus); + this._inputElement.removeEventListener('blur', this._onBlur); + delete this._inputElement; + } + }, + render: function () { var classes = [CLASS_ROOT]; + if (this.state.focus) { + classes.push(CLASS_ROOT + "--focus"); + } if (this.props.required) { classes.push(CLASS_ROOT + "--required"); } @@ -604,17 +819,15 @@ var Grommet = } return ( - React.createElement("div", {className: classes.join(' ')}, + React.createElement("div", {className: classes.join(' '), onClick: this._onClick}, + error, React.createElement("label", {className: CLASS_ROOT + "__label", htmlFor: this.props.htmlFor}, this.props.label ), - React.createElement("span", {className: CLASS_ROOT + "__container"}, - React.createElement("span", {className: CLASS_ROOT + "__contents"}, - this.props.children - ), - help, - error - ) + React.createElement("span", {ref: "contents", className: CLASS_ROOT + "__contents"}, + this.props.children + ), + help ) ); } @@ -650,7 +863,8 @@ var Grommet = flush: true, large: false, primary: false, - small: false}; + small: false + }; }, _onResize: function () { @@ -863,11 +1077,13 @@ var Grommet = var Form = __webpack_require__(6); var FormField = __webpack_require__(7); var CheckBox = __webpack_require__(2); - + var IntlMixin = __webpack_require__(43); var CLASS_ROOT = "login-form"; var LoginForm = React.createClass({displayName: "LoginForm", + mixins: [IntlMixin], + propTypes: { logo: React.PropTypes.node, title: React.PropTypes.string, @@ -900,8 +1116,8 @@ var Grommet = var classes = [CLASS_ROOT]; var errors = this.props.errors.map(function (error, index) { - return (React.createElement("div", {key: index, className: CLASS_ROOT + "__error"}, error)); - }); + return (React.createElement("div", {key: index, className: CLASS_ROOT + "__error"}, this.getGrommetIntlMessage(error))); + }.bind(this)); var logo = null; if (this.props.logo) { @@ -927,7 +1143,7 @@ var Grommet = if (this.props.rememberMe) { rememberMe = ( React.createElement(CheckBox, {className: CLASS_ROOT + "__remember-me", - id: "remember-me", label: "Remember me"}) + id: "remember-me", label: this.getGrommetIntlMessage('Remember me')}) ); } footer = ( @@ -943,15 +1159,15 @@ var Grommet = logo, title, React.createElement("fieldset", null, - React.createElement(FormField, {htmlFor: "username", label: "Username"}, - React.createElement("input", {id: "username", ref: "username", type: "text"}) + React.createElement(FormField, {htmlFor: "username", label: this.getGrommetIntlMessage('Username')}, + React.createElement("input", {id: "username", ref: "username", type: "email"}) ), - React.createElement(FormField, {htmlFor: "password", label: "Password"}, + React.createElement(FormField, {htmlFor: "password", label: this.getGrommetIntlMessage('Password')}, React.createElement("input", {id: "password", ref: "password", type: "password"}) ) ), errors, - React.createElement("input", {type: "submit", className: CLASS_ROOT + "__submit primary call-to-action", value: 'Log in'}), + React.createElement("input", {type: "submit", className: CLASS_ROOT + "__submit primary call-to-action", value: this.getGrommetIntlMessage('Log In')}), footer ) ); @@ -971,9 +1187,9 @@ var Grommet = var React = __webpack_require__(42); var ReactLayeredComponent = __webpack_require__(38); var KeyboardAccelerators = __webpack_require__(37); - var Overlay = __webpack_require__(44); - var MoreIcon = __webpack_require__(30); - var DropCaretIcon = __webpack_require__(45); + var Overlay = __webpack_require__(46); + var MoreIcon = __webpack_require__(31); + var DropCaretIcon = __webpack_require__(47); var ROOT_CLASS = "menu"; @@ -981,7 +1197,7 @@ var Grommet = propTypes: { align: React.PropTypes.oneOf(['top', 'bottom', 'left', 'right']), - direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right']), + direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right', 'center']), onClick: React.PropTypes.func.isRequired, router: React.PropTypes.func }, @@ -1017,7 +1233,7 @@ var Grommet = propTypes: { align: React.PropTypes.oneOf(['top', 'bottom', 'left', 'right']), collapse: React.PropTypes.bool, - direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right']), + direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right', 'center']), icon: React.PropTypes.node, label: React.PropTypes.string, primary: React.PropTypes.bool, @@ -1138,7 +1354,7 @@ var Grommet = classes.push(controlClassName + "--labelled"); icon = this.props.icon; } else { - classes.push(controlClassName +"--fixed-label"); + classes.push(controlClassName + "--fixed-label"); icon = React.createElement(MoreIcon, null); } @@ -1262,75 +1478,519 @@ var Grommet = // (C) Copyright 2014 Hewlett-Packard Development Company, L.P. var React = __webpack_require__(42); + var Legend = __webpack_require__(44); + + var CLASS_ROOT = "meter"; + + var BAR_LENGTH = 192; + var BAR_THICKNESS = 24; + var MID_BAR_THICKNESS = BAR_THICKNESS / 2; + + var CIRCLE_WIDTH = 192; + var CIRCLE_RADIUS = 84; + + var ARC_HEIGHT = 144; + + function polarToCartesian (centerX, centerY, radius, angleInDegrees) { + var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0; + return { + x: centerX + (radius * Math.cos(angleInRadians)), + y: centerY + (radius * Math.sin(angleInRadians)) + }; + } - var BASE_WIDTH = 192; - var BASE_HEIGHT = 24; - var MID_HEIGHT = BASE_HEIGHT / 2; + function arcCommands (x, y, radius, startAngle, endAngle) { + var start = polarToCartesian(x, y, radius, endAngle); + var end = polarToCartesian(x, y, radius, startAngle); + var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"; + var d = [ + "M", start.x, start.y, + "A", radius, radius, 0, arcSweep, 0, end.x, end.y + ].join(" "); + return d; + } - // TODO: multi-value meter + function activeIndicatorCommands (x, y, radius, startAngle, endAngle) { + var midAngle = endAngle - ((endAngle - startAngle) / 2); + var point = polarToCartesian(x, y, radius - 24, midAngle); + var start = polarToCartesian(x, y, radius, midAngle - 10); + var end = polarToCartesian(x, y, radius, midAngle + 10); + var d = ["M", point.x, point.y, + "L", start.x, start.y, + "A", radius, radius, 0, 0, 0, end.x, end.y, + "Z" + ].join(" "); + return d; + } var Meter = React.createClass({displayName: "Meter", propTypes: { - max: React.PropTypes.number, - min: React.PropTypes.number, + important: React.PropTypes.number, + large: React.PropTypes.bool, + legend: React.PropTypes.bool, + legendTotal: React.PropTypes.bool, + max: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + value: React.PropTypes.number.isRequired, + label: React.PropTypes.string + }), + React.PropTypes.number + ]), + min: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + value: React.PropTypes.number.isRequired, + label: React.PropTypes.string + }), + React.PropTypes.number + ]), + series: React.PropTypes.arrayOf(React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.number.isRequired, + colorIndex: React.PropTypes.string, + important: React.PropTypes.bool, + onClick: React.PropTypes.func + })), + small: React.PropTypes.bool, threshold: React.PropTypes.number, + type: React.PropTypes.oneOf(['bar', 'arc', 'circle']), units: React.PropTypes.string, - value: React.PropTypes.number + value: React.PropTypes.number, + vertical: React.PropTypes.bool }, getDefaultProps: function () { return { - max: 100, - min: 0 + type: 'bar' }; }, - render: function() { - var classes = ["meter"]; - if (this.props.className) { - classes.push(this.props.className); - } - var scale = BASE_WIDTH / (this.props.max - this.props.min); - var distance = scale * (this.props.value - this.props.min); - var commands = "M0," + MID_HEIGHT + " L" + distance + "," + MID_HEIGHT; - - var threshold = null; - if (this.props.threshold) { - distance = scale * (this.props.threshold - this.props.min); - threshold = ( - React.createElement("path", {className: "meter__threshold", - d: "M" + distance + ",0 L" + distance + "," + BASE_HEIGHT}) - ); - } - return ( - React.createElement("div", {className: classes.join(' ')}, - React.createElement("svg", {className: "meter__graphic", - viewBox: "0 0 " + BASE_WIDTH + " " + BASE_HEIGHT, - preserveAspectRatio: "xMidYMid meet"}, - React.createElement("g", null, - React.createElement("path", {className: "meter__value", d: commands}), - threshold - ) - ), - React.createElement("span", {className: "meter__label"}, - React.createElement("span", {className: "meter__label-value"}, this.props.value), - React.createElement("span", {className: "meter__label-units"}, this.props.units) - ) - ) - ); - } + _initialTimeout: function () { + this.setState({ + initial: false, + activeIndex: this.state.importantIndex + }); + clearTimeout(this._timeout); + }, - }); + _onActivate: function (index) { + this.setState({initial: false, activeIndex: index}); + }, - module.exports = Meter; + _onResize: function() { + // debounce + clearTimeout(this._resizeTimer); + this._resizeTimer = setTimeout(this._layout, 50); + }, + _layout: function () { + // legendPosition based on available window orientation + var ratio = window.innerWidth / window.innerHeight; + if (ratio < 0.8) { + this.setState({legendPosition: 'bottom'}); + } else if (ratio > 1.2) { + this.setState({legendPosition: 'right'}); + } + /* + // content based on available real estate + var parentElement = this.refs.donut.getDOMNode().parentNode; + var width = parentElement.offsetWidth; + var height = parentElement.offsetHeight; + var donutHeight = BASE_SIZE; + if (this.props.partial) { + donutHeight = PARTIAL_SIZE; + } + if (height < donutHeight || width < BASE_SIZE || + (width < (BASE_SIZE * 2) && height < (donutHeight * 2))) { + this.setState({size: 'small'}); + } else { + this.setState({size: null}); + } + */ + }, -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { + _generateSeries: function (props, min, max) { + var remaining = max.value - props.value; + return [ + {value: props.value, important: true}, + {value: remaining, colorIndex: 'unset'} + ]; + }, - // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. + _importantIndex: function (series) { + var result = series.length - 1; + if (this.props.hasOwnProperty('important')) { + result = this.props.important; + } + series.some(function (data, index) { + if (data.important) { + result = index; + return true; + } + }); + return result; + }, + + // Normalize min or max to an object. + _terminal: function (terminal) { + if (typeof terminal === 'number') { + terminal = {value: terminal}; + } + return terminal; + }, + + _seriesTotal: function (series) { + var total = 0; + series.some(function (item) { + total += item.value; + }); + return total; + }, + + // Generates state based on the provided props. + _stateFromProps: function (props) { + var total; + if (props.series && props.series.length > 1) { + total = this._seriesTotal(props.series); + } else { + total = 100; + } + // Normalize min and max + var min = this._terminal(props.min || 0); + // Max could be provided in props or come from the total of + // a multi-value series. + var max = this._terminal(props.max || total); + // Normalize simple value prop to a series, if needed. + var series = props.series || this._generateSeries(props, min, max); + // Determine important index. + var importantIndex = this._importantIndex(series); + total = this._seriesTotal(series); + + var state = { + importantIndex: importantIndex, + activeIndex: importantIndex, + legendPosition: 'bottom', + series: series, + min: min, + max: max, + total: total + }; + + if ('arc' === this.props.type) { + state.startAngle = 60; + state.anglePer = 240.0 / total; + if (this.props.vertical) { + state.angleOffset = 90; + } else { + state.angleOffset = 180; + } + } else if ('circle' === this.props.type) { + state.startAngle = 1; + state.anglePer = 358.0 / total; + state.angleOffset = 180; + } else if ('bar' === this.props.type) { + state.scale = BAR_LENGTH / (max.value - min.value); + } + + return state; + }, + + getInitialState: function() { + var state = this._stateFromProps(this.props); + state.initial = true; + return state; + }, + + componentDidMount: function() { + this._initialTimer = setTimeout(this._initialTimeout, 10); + window.addEventListener('resize', this._onResize); + this._onResize(); + }, + + componentWillReceiveProps: function (newProps) { + var state = this._stateFromProps(newProps); + this.setState(state); + }, + + componentWillUnmount: function() { + clearTimeout(this._initialTimer); + clearTimeout(this._resizeTimer); + window.removeEventListener('resize', this._onResize); + }, + + _itemColorIndex: function (item, index) { + return item.colorIndex || ('graph-' + (index + 1)); + }, + + _translateBarWidth: function (value) { + return Math.round(this.state.scale * value); + }, + + _renderBar: function () { + var start = 0; + var minRemaining = this.state.min.value; + var bars = this.state.series.map(function (item, index) { + var colorIndex = this._itemColorIndex(item, index); + var barClasses = [CLASS_ROOT + "__bar"]; + if (index === this.state.activeIndex) { + barClasses.push(CLASS_ROOT + "__bar--active"); + } + barClasses.push("color-index-" + colorIndex); + + var value = item.value - minRemaining; + minRemaining = Math.max(0, minRemaining - item.value); + var distance = this._translateBarWidth(value); + var commands; + if (this.props.vertical) { + commands = "M" + MID_BAR_THICKNESS + "," + (BAR_LENGTH - start) + + " L" + MID_BAR_THICKNESS + "," + (BAR_LENGTH - (start + distance)); + } else { + commands = "M" + start + "," + MID_BAR_THICKNESS + + " L" + (start + distance) + "," + MID_BAR_THICKNESS; + } + start += distance; + + return ( + React.createElement("path", {key: index, className: barClasses.join(' '), d: commands, + onMouseOver: this._onActivate.bind(this, index), + onMouseOut: this._onActivate.bind(this, this.state.importantIndex), + onClick: item.onClick}) + ); + }, this); + + return bars; + }, + + _renderArcOrCircle: function () { + var startAngle = this.state.startAngle; + var activeIndicator = null; + + var paths = this.state.series.map(function (item, index) { + var sliceClasses = [CLASS_ROOT + "__slice"]; + if (index === this.state.activeIndex) { + sliceClasses.push(CLASS_ROOT + "__slice--active"); + } + var colorIndex = this._itemColorIndex(item, index); + sliceClasses.push("color-index-" + colorIndex); + + var endAngle = Math.min(360, Math.max(0, + startAngle + (this.state.anglePer * item.value))); + // start from the bottom + var commands = arcCommands(CIRCLE_WIDTH / 2, CIRCLE_WIDTH / 2, CIRCLE_RADIUS, + startAngle + this.state.angleOffset, + endAngle + this.state.angleOffset); + + if (index === this.state.activeIndex) { + var indicatorCommands = + activeIndicatorCommands(CIRCLE_WIDTH / 2, CIRCLE_WIDTH / 2, CIRCLE_RADIUS, + startAngle + this.state.angleOffset, + endAngle + this.state.angleOffset); + activeIndicator = ( + React.createElement("path", {stroke: "none", + className: CLASS_ROOT + "__slice-indicator color-index-" + colorIndex, + d: indicatorCommands}) + ); + } + + startAngle = endAngle; + + return ( + React.createElement("path", {key: item.label, fill: "none", + className: sliceClasses.join(' '), d: commands, + onMouseOver: this._onActivate.bind(this, index), + onMouseOut: this._onActivate.bind(this, this.state.importantIndex), + onClick: item.onClick}) + ); + }, this); + + return ( + React.createElement("g", null, + activeIndicator, + paths + ) + ); + }, + + _renderCurrent: function () { + var current; + var active = this.state.series[this.state.activeIndex]; + if ('arc' === this.props.type || 'circle' === this.props.type) { + current = ( + React.createElement("div", {className: CLASS_ROOT + "__active"}, + React.createElement("div", {className: CLASS_ROOT + "__active-value large-number-font"}, + active.value, + React.createElement("span", {className: CLASS_ROOT + "__active-units large-number-font"}, + this.props.units + ) + ), + React.createElement("div", {className: CLASS_ROOT + "__active-label"}, + active.label + ) + ) + ); + } else if ('bar' === this.props.type) { + current = ( + React.createElement("span", {className: CLASS_ROOT + "__active"}, + React.createElement("span", {className: CLASS_ROOT + "__active-value large-number-font"}, + active.value + ), + React.createElement("span", {className: CLASS_ROOT + "__active-units large-number-font"}, + this.props.units + ) + ) + ); + } + return current; + }, + + _renderBarThreshold: function () { + var distance = + this._translateBarWidth(this.props.threshold - this.state.min.value); + var commands; + if (this.props.vertical) { + commands = "M0," + (BAR_LENGTH - distance) + + " L" + BAR_THICKNESS + "," + (BAR_LENGTH - distance); + } else { + commands = "M" + distance + ",0 L" + distance + "," + BAR_THICKNESS; + } + return React.createElement("path", {className: CLASS_ROOT + "__threshold", d: commands}); + }, + + _renderCircleOrArcThreshold: function () { + var startAngle = this.state.startAngle + + (this.state.anglePer * this.props.threshold); + var endAngle = Math.min(360, Math.max(0, startAngle + 1)); + // start from the bottom + var commands = arcCommands(CIRCLE_WIDTH / 2, CIRCLE_WIDTH / 2, CIRCLE_RADIUS, + startAngle + 180, endAngle + 180); + return ( + React.createElement("path", {className: CLASS_ROOT + "__threshold", d: commands}) + ); + }, + + _renderLegend: function () { + return ( + React.createElement(Legend, {className: CLASS_ROOT + "__legend", + series: this.state.series, + units: this.props.units, + activeIndex: this.state.activeIndex, + onActive: this._onActive}) + ); + }, + + render: function() { + var classes = [CLASS_ROOT]; + classes.push(CLASS_ROOT + "--" + this.props.type); + classes.push(CLASS_ROOT + "--legend-" + this.state.legendPosition); + if (this.props.vertical) { + classes.push(CLASS_ROOT + "--vertical"); + } + if (this.props.small) { + classes.push(CLASS_ROOT + "--small"); + } + if (this.props.large) { + classes.push(CLASS_ROOT + "--large"); + } + if (this.props.className) { + classes.push(this.props.className); + } + + var viewBoxHeight; + var viewBoxWidth; + if ('arc' === this.props.type) { + if (this.props.vertical) { + viewBoxWidth = ARC_HEIGHT; + viewBoxHeight = CIRCLE_WIDTH; + } else { + viewBoxWidth = CIRCLE_WIDTH; + viewBoxHeight = ARC_HEIGHT; + } + } else if ('circle' === this.props.type) { + viewBoxWidth = CIRCLE_WIDTH; + viewBoxHeight = CIRCLE_WIDTH; + } else if ('bar' === this.props.type) { + if (this.props.vertical) { + viewBoxWidth = BAR_THICKNESS; + viewBoxHeight = BAR_LENGTH; + } else { + viewBoxWidth = BAR_LENGTH; + viewBoxHeight = BAR_THICKNESS; + } + } + + var values = null; + if ('arc' === this.props.type || 'circle' === this.props.type) { + values = this._renderArcOrCircle(); + } else if ('bar' === this.props.type) { + values = this._renderBar(); + } + + var threshold = null; + if (this.props.threshold) { + if ('arc' === this.props.type || 'circle' === this.props.type) { + threshold = this._renderCircleOrArcThreshold(); + } else if ('bar' === this.props.type) { + threshold = this._renderBarThreshold(); + } + } + + var minLabel = null; + if (this.state.min.label) { + minLabel = ( + React.createElement("div", {className: CLASS_ROOT + "__label-min"}, + this.state.min.label + ) + ); + } + var maxLabel = null; + if (this.state.max.label) { + maxLabel = ( + React.createElement("div", {className: CLASS_ROOT + "__label-max"}, + this.state.max.label + ) + ); + } + + var current = null; + if (this.state.activeIndex >= 0) { + current = this._renderCurrent(); + } + + var legend = null; + if (this.props.legend) { + legend = this._renderLegend(); + } + + return ( + React.createElement("div", {className: classes.join(' ')}, + React.createElement("svg", {className: CLASS_ROOT + "__graphic", + viewBox: "0 0 " + viewBoxWidth + " " + viewBoxHeight, + preserveAspectRatio: "xMidYMid meet"}, + React.createElement("g", null, + values, + threshold + ) + ), + current, + React.createElement("div", {className: CLASS_ROOT + "__labels"}, + minLabel, + maxLabel + ), + legend + ) + ); + } + + }); + + module.exports = Meter; + + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. var React = __webpack_require__(42); var Panel = React.createClass({displayName: "Panel", @@ -1374,6 +2034,8 @@ var Grommet = var React = __webpack_require__(42); + var CLASS_ROOT = "radio-button"; + var RadioButton = React.createClass({displayName: "RadioButton", propTypes: { @@ -1386,18 +2048,19 @@ var Grommet = }, render: function () { - var classes = ["radio-button"]; + var classes = [CLASS_ROOT]; if (this.props.className) { classes.push(this.props.className); } return ( - React.createElement("span", {className: classes.join(' ')}, - React.createElement("input", {className: "radio-button__input", + React.createElement("label", {className: classes.join(' ')}, + React.createElement("input", {className: CLASS_ROOT + "__input", id: this.props.id, name: this.props.name, type: "radio", checked: this.props.checked, defaultChecked: this.props.defaultChecked, onChange: this.props.onChange}), - React.createElement("label", {className: "radio-button__label radio", htmlFor: this.props.id}, + React.createElement("span", {className: CLASS_ROOT + "__control"}), + React.createElement("span", {className: CLASS_ROOT + "__label"}, this.props.label ) ) @@ -1418,8 +2081,9 @@ var Grommet = var React = __webpack_require__(42); var ReactLayeredComponent = __webpack_require__(38); var KeyboardAccelerators = __webpack_require__(37); - var Overlay = __webpack_require__(44); + var Overlay = __webpack_require__(46); var SearchIcon = __webpack_require__(33); + var IntlMixin = __webpack_require__(43); var CLASS_ROOT = "search"; @@ -1442,7 +2106,7 @@ var Grommet = }; }, - mixins: [ReactLayeredComponent, KeyboardAccelerators, Overlay], + mixins: [ReactLayeredComponent, KeyboardAccelerators, Overlay, IntlMixin], _onAddLayer: function (event) { event.preventDefault(); @@ -1468,7 +2132,7 @@ var Grommet = _onFocusInput: function () { this.refs.input.getDOMNode().select(); this.setState({ - layer: (! this.props.inline || this.props.suggestions), + layer: (! this.state.inline || this.props.suggestions), activeSuggestionIndex: -1 }); }, @@ -1518,15 +2182,35 @@ var Grommet = event.nativeEvent.stopImmediatePropagation(); }, + _layout: function () { + if (window.innerWidth < 600) { + this.setState({inline: false}); + } else { + this.setState({inline: this.props.inline}); + } + }, + + _onResize: function () { + // debounce + clearTimeout(this._resizeTimer); + this._resizeTimer = setTimeout(this._layout, 50); + }, + getInitialState: function () { return { align: 'left', controlFocused: false, + inline: this.props.inline, layer: false, activeSuggestionIndex: -1 }; }, + componentDidMount: function () { + window.addEventListener('resize', this._onResize); + this._layout(); + }, + componentDidUpdate: function (prevProps, prevState) { // Set up keyboard listeners appropriate to the current state. @@ -1583,13 +2267,14 @@ var Grommet = layerControlElement.style.lineHeight = height + 'px'; } - this.startOverlay(baseElement,layerElement, this.props.align); + this.startOverlay(baseElement, layerElement, this.props.align); inputElement.focus(); } }, componentWillUnmount: function () { document.removeEventListener('click', this._onRemoveLayer); + window.removeEventListener('resize', this._onResize); }, focus: function () { @@ -1611,7 +2296,7 @@ var Grommet = _classes: function (prefix) { var classes = [prefix]; - if (this.props.inline) { + if (this.state.inline) { classes.push(prefix + "--inline"); } else { classes.push(prefix + "--controlled"); @@ -1624,19 +2309,20 @@ var Grommet = }, render: function () { + var classes = this._classes(CLASS_ROOT); if (this.props.className) { classes.push(this.props.className); } - if (this.props.inline) { + if (this.state.inline) { var readOnly = this.props.suggestions ? true : false; return ( React.createElement("div", {className: classes.join(' ')}, React.createElement("input", {ref: "input", type: "search", - placeholder: this.props.placeHolder, + placeholder: this.getGrommetIntlMessage(this.props.placeHolder), value: this.props.defaultValue, className: CLASS_ROOT + "__input", readOnly: readOnly, @@ -1696,7 +2382,7 @@ var Grommet = ) ); - if (! this.props.inline) { + if (! this.state.inline) { var control = this._createControl(); var rightAlign = ('right' === this.props.align); var first = rightAlign ? contents : control; @@ -1735,7 +2421,7 @@ var Grommet = var React = __webpack_require__(42); var ReactLayeredComponent = __webpack_require__(38); var KeyboardAccelerators = __webpack_require__(37); - var Overlay = __webpack_require__(44); + var Overlay = __webpack_require__(46); var SearchIcon = __webpack_require__(33); var CLASS_ROOT = "search-input"; @@ -1743,13 +2429,33 @@ var Grommet = var SearchInput = React.createClass({displayName: "SearchInput", propTypes: { - defaultValue: React.PropTypes.string, + defaultValue: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.string + }), + React.PropTypes.string + ]), id: React.PropTypes.string, name: React.PropTypes.string, onChange: React.PropTypes.func, onSearch: React.PropTypes.func, - suggestions: React.PropTypes.arrayOf(React.PropTypes.string), - value: React.PropTypes.string + suggestions: React.PropTypes.arrayOf( + React.PropTypes.oneOfType([ + React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.string + }), + React.PropTypes.string + ]) + ), + value: React.PropTypes.oneOfType([ + React.PropTypes.shape({ + label: React.PropTypes.string, + value: React.PropTypes.string + }), + React.PropTypes.string + ]) }, mixins: [ReactLayeredComponent, KeyboardAccelerators, Overlay], @@ -1788,16 +2494,16 @@ var Grommet = this.setState({active: false}); this._activation(false); if (this.state.activeSuggestionIndex >= 0) { - var text = this.props.suggestions[this.state.activeSuggestionIndex]; - this.setState({value: text}); - this.props.onChange(text); + var suggestion = this.props.suggestions[this.state.activeSuggestionIndex]; + this.setState({value: suggestion}); + this.props.onChange(suggestion); } }, - _onClickSuggestion: function (text) { - this.setState({value: text}); + _onClickSuggestion: function (suggestion) { + this.setState({value: suggestion}); this._activation(false); - this.props.onChange(text); + this.props.onChange(suggestion); }, _activation: function (active) { @@ -1861,6 +2567,18 @@ var Grommet = this._activation(false); }, + _valueText: function (value) { + var text = ''; + if (value) { + if ('string' === typeof value) { + text = value; + } else { + text = value.label || value.value; + } + } + return text; + }, + render: function() { var classes = [CLASS_ROOT]; if (this.state.active) { @@ -1874,7 +2592,8 @@ var Grommet = React.createElement("div", {ref: "component", className: classes.join(' ')}, React.createElement("input", {className: CLASS_ROOT + "__input", id: this.props.id, name: this.props.name, - value: this.props.value, defaultValue: this.props.defaultValue, + value: this._valueText(this.props.value), + defaultValue: this._valueText(this.props.defaultValue), onChange: this._onInputChange}), React.createElement("div", {className: CLASS_ROOT + "__control", onClick: this._onOpen}, React.createElement(SearchIcon, null) @@ -1888,16 +2607,16 @@ var Grommet = var suggestions = null; if (this.props.suggestions) { - suggestions = this.props.suggestions.map(function (text, index) { + suggestions = this.props.suggestions.map(function (suggestion, index) { var classes = [CLASS_ROOT + "__layer-suggestion"]; if (index === this.state.activeSuggestionIndex) { classes.push(CLASS_ROOT + "__layer-suggestion--active"); } return ( - React.createElement("div", {key: text, + React.createElement("div", {key: this._valueText(suggestion), className: classes.join(' '), - onClick: this._onClickSuggestion.bind(this, text)}, - text + onClick: this._onClickSuggestion.bind(this, suggestion)}, + this._valueText(suggestion) ) ); }, this); @@ -1934,13 +2653,16 @@ var Grommet = var React = __webpack_require__(42); + var CLASS_ROOT = "section"; + var Section = React.createClass({displayName: "Section", propTypes: { + centered: React.PropTypes.bool, compact: React.PropTypes.bool, colorIndex: React.PropTypes.string, direction: React.PropTypes.oneOf(['up', 'down', 'left', 'right']), - centered: React.PropTypes.bool, + flush: React.PropTypes.bool, texture: React.PropTypes.string }, @@ -1948,22 +2670,26 @@ var Grommet = return { colored: false, direction: 'down', + flush: true, small: false }; }, render: function() { - var classes = ["section"]; - var contentClasses = ["section__content"]; + var classes = [CLASS_ROOT]; + var contentClasses = [CLASS_ROOT + "__content"]; if (this.props.compact) { - classes.push("section--compact"); + classes.push(CLASS_ROOT + "--compact"); } if (this.props.centered) { - classes.push("section--centered"); + classes.push(CLASS_ROOT + "--centered"); + } + if (this.props.flush) { + classes.push(CLASS_ROOT + "--flush"); } if (this.props.direction) { - classes.push("section--" + this.props.direction); + classes.push(CLASS_ROOT + "--" + this.props.direction); } if (this.props.colorIndex) { classes.push("background-color-index-" + this.props.colorIndex); @@ -1999,7 +2725,7 @@ var Grommet = var React = __webpack_require__(42); var SpinningIcon = __webpack_require__(35); - var InfiniteScroll = __webpack_require__(46); + var InfiniteScroll = __webpack_require__(48); var CLASS_ROOT = "table"; @@ -2025,7 +2751,7 @@ var Grommet = _clearSelection: function () { var rows = this.refs.table.getDOMNode() .querySelectorAll("." + CLASS_ROOT + "__row--selected"); - for (var i=0; i 1) { + // The built-in sort() sorts by ASCII order, so use that + match.sort(); + + // Replace all extensions with the joined, sorted array + locale = locale.replace( + RegExp('(?:' + expExtSequences.source + ')+', 'i'), + arrJoin.call(match, '') + ); + } - /** - * Provides the set of created actions and stores for introspection - */ - exports.__keep = __webpack_require__(71); + // 2. Redundant or grandfathered tags are replaced by their 'Preferred- + // Value', if there is one. + if (hop.call(redundantTags.tags, locale)) + locale = redundantTags.tags[locale]; + + // 3. Subtags are replaced by their 'Preferred-Value', if there is one. + // For extlangs, the original primary language subtag is also + // replaced if there is a primary language subtag in the 'Preferred- + // Value'. + parts = locale.split('-'); + + for (var i = 1, max = parts.length; i < max; i++) { + if (hop.call(redundantTags.subtags, parts[i])) + parts[i] = redundantTags.subtags[parts[i]]; + + else if (hop.call(redundantTags.extLang, parts[i])) { + parts[i] = redundantTags.extLang[parts[i]][0]; + + // For extlang tags, the prefix needs to be removed if it is redundant + if (i === 1 && redundantTags.extLang[parts[1]][1] === parts[0]) { + parts = arrSlice.call(parts, i++); + max -= 1; + } + } + } + + return arrJoin.call(parts, '-'); + } /** - * Warn if Function.prototype.bind not available + * The DefaultLocale abstract operation returns a String value representing the + * structurally valid (6.2.2) and canonicalized (6.2.3) BCP 47 language tag for the + * host environment’s current locale. */ - if (!Function.prototype.bind) { - console.error( - 'Function.prototype.bind not available. ' + - 'ES5 shim required. ' + - 'https://github.com/spoike/refluxjs#es5' - ); + function /* 6.2.4 */DefaultLocale () { + return defaultLocale; } - -/***/ }, -/* 58 */ -/***/ function(module, exports, __webpack_require__) { + // Sect 6.3 Currency Codes + // ======================= /** - * A module of methods that you want to include in all actions. - * This module is consumed by `createAction`. + * The IsWellFormedCurrencyCode abstract operation verifies that the currency argument + * (after conversion to a String value) represents a well-formed 3-letter ISO currency + * code. The following steps are taken: */ - module.exports = { - }; + function /* 6.3.1 */IsWellFormedCurrencyCode(currency) { + var + // 1. Let `c` be ToString(currency) + c = String(currency), + + // 2. Let `normalized` be the result of mapping c to upper case as described + // in 6.1. + normalized = toLatinUpperCase(c); + + // 3. If the string length of normalized is not 3, return false. + // 4. If normalized contains any character that is not in the range "A" to "Z" + // (U+0041 to U+005A), return false. + if (expCurrencyCode.test(normalized) === false) + return false; + // 5. Return true + return true; + } -/***/ }, -/* 59 */ -/***/ function(module, exports, __webpack_require__) { + // Sect 9.2 Abstract Operations + // ============================ + function /* 9.2.1 */CanonicalizeLocaleList (locales) { + // The abstract operation CanonicalizeLocaleList takes the following steps: + + // 1. If locales is undefined, then a. Return a new empty List + if (locales === undefined) + return new List(); + + var + // 2. Let seen be a new empty List. + seen = new List(), + + // 3. If locales is a String value, then + // a. Let locales be a new array created as if by the expression new + // Array(locales) where Array is the standard built-in constructor with + // that name and locales is the value of locales. + locales = typeof locales === 'string' ? [ locales ] : locales, + + // 4. Let O be ToObject(locales). + O = toObject(locales), + + // 5. Let lenValue be the result of calling the [[Get]] internal method of + // O with the argument "length". + // 6. Let len be ToUint32(lenValue). + len = O.length, + + // 7. Let k be 0. + k = 0; + + // 8. Repeat, while k < len + while (k < len) { + var + // a. Let Pk be ToString(k). + Pk = String(k), + + // b. Let kPresent be the result of calling the [[HasProperty]] internal + // method of O with argument Pk. + kPresent = Pk in O; + + // c. If kPresent is true, then + if (kPresent) { + var + // i. Let kValue be the result of calling the [[Get]] internal + // method of O with argument Pk. + kValue = O[Pk]; + + // ii. If the type of kValue is not String or Object, then throw a + // TypeError exception. + if (kValue == null || (typeof kValue !== 'string' && typeof kValue !== 'object')) + throw new TypeError('String or Object type expected'); + + var + // iii. Let tag be ToString(kValue). + tag = String(kValue); + + // iv. If the result of calling the abstract operation + // IsStructurallyValidLanguageTag (defined in 6.2.2), passing tag as + // the argument, is false, then throw a RangeError exception. + if (!IsStructurallyValidLanguageTag(tag)) + throw new RangeError("'" + tag + "' is not a structurally valid language tag"); + + // v. Let tag be the result of calling the abstract operation + // CanonicalizeLanguageTag (defined in 6.2.3), passing tag as the + // argument. + tag = CanonicalizeLanguageTag(tag); + + // vi. If tag is not an element of seen, then append tag as the last + // element of seen. + if (arrIndexOf.call(seen, tag) === -1) + arrPush.call(seen, tag); + } + + // d. Increase k by 1. + k++; + } - var _ = __webpack_require__(70), - maker = __webpack_require__(69).instanceJoinCreator; + // 9. Return seen. + return seen; + } /** - * Extract child listenables from a parent from their - * children property and return them in a keyed Object - * - * @param {Object} listenable The parent listenable + * The BestAvailableLocale abstract operation compares the provided argument + * locale, which must be a String value with a structurally valid and + * canonicalized BCP 47 language tag, against the locales in availableLocales and + * returns either the longest non-empty prefix of locale that is an element of + * availableLocales, or undefined if there is no such element. It uses the + * fallback mechanism of RFC 4647, section 3.4. The following steps are taken: */ - var mapChildListenables = function(listenable) { - var i = 0, children = {}, childName; - for (;i < (listenable.children||[]).length; ++i) { - childName = listenable.children[i]; - if(listenable[childName]){ - children[childName] = listenable[childName]; - } + function /* 9.2.2 */BestAvailableLocale (availableLocales, locale) { + var + // 1. Let candidate be locale + candidate = locale; + + // 2. Repeat + while (true) { + // a. If availableLocales contains an element equal to candidate, then return + // candidate. + if (arrIndexOf.call(availableLocales, candidate) > -1) + return candidate; + + var + // b. Let pos be the character index of the last occurrence of "-" + // (U+002D) within candidate. If that character does not occur, return + // undefined. + pos = candidate.lastIndexOf('-'); + + if (pos < 0) + return; + + // c. If pos ≥ 2 and the character "-" occurs at index pos-2 of candidate, + // then decrease pos by 2. + if (pos >= 2 && candidate.charAt(pos - 2) == '-') + pos -= 2; + + // d. Let candidate be the substring of candidate from position 0, inclusive, + // to position pos, exclusive. + candidate = candidate.substring(0, pos); } - return children; - }; + } /** - * Make a flat dictionary of all listenables including their - * possible children (recursively), concatenating names in camelCase. - * - * @param {Object} listenables The top-level listenables + * The LookupMatcher abstract operation compares requestedLocales, which must be + * a List as returned by CanonicalizeLocaleList, against the locales in + * availableLocales and determines the best available language to meet the + * request. The following steps are taken: */ - var flattenListenables = function(listenables) { - var flattened = {}; - for(var key in listenables){ - var listenable = listenables[key]; - var childMap = mapChildListenables(listenable); - - // recursively flatten children - var children = flattenListenables(childMap); - - // add the primary listenable and chilren - flattened[key] = listenable; - for(var childKey in children){ - var childListenable = children[childKey]; - flattened[key + _.capitalize(childKey)] = childListenable; + function /* 9.2.3 */LookupMatcher (availableLocales, requestedLocales) { + var + // 1. Let i be 0. + i = 0, + + // 2. Let len be the number of elements in requestedLocales. + len = requestedLocales.length, + + // 3. Let availableLocale be undefined. + availableLocale; + + // 4. Repeat while i < len and availableLocale is undefined: + while (i < len && !availableLocale) { + var + // a. Let locale be the element of requestedLocales at 0-origined list + // position i. + locale = requestedLocales[i], + + // b. Let noExtensionsLocale be the String value that is locale with all + // Unicode locale extension sequences removed. + noExtensionsLocale = String(locale).replace(expUnicodeExSeq, ''), + + // c. Let availableLocale be the result of calling the + // BestAvailableLocale abstract operation (defined in 9.2.2) with + // arguments availableLocales and noExtensionsLocale. + availableLocale = BestAvailableLocale(availableLocales, noExtensionsLocale); + + // d. Increase i by 1. + i++; + } + + var + // 5. Let result be a new Record. + result = new Record(); + + // 6. If availableLocale is not undefined, then + if (availableLocale !== undefined) { + // a. Set result.[[locale]] to availableLocale. + result['[[locale]]'] = availableLocale; + + // b. If locale and noExtensionsLocale are not the same String value, then + if (String(locale) !== String(noExtensionsLocale)) { + var + // i. Let extension be the String value consisting of the first + // substring of locale that is a Unicode locale extension sequence. + extension = locale.match(expUnicodeExSeq)[0], + + // ii. Let extensionIndex be the character position of the initial + // "-" of the first Unicode locale extension sequence within locale. + extensionIndex = locale.indexOf('-u-'); + + // iii. Set result.[[extension]] to extension. + result['[[extension]]'] = extension; + + // iv. Set result.[[extensionIndex]] to extensionIndex. + result['[[extensionIndex]]'] = extensionIndex; } } + // 7. Else + else + // a. Set result.[[locale]] to the value returned by the DefaultLocale abstract + // operation (defined in 6.2.4). + result['[[locale]]'] = DefaultLocale(); - return flattened; - }; + // 8. Return result + return result; + } /** - * A module of methods related to listening. + * The BestFitMatcher abstract operation compares requestedLocales, which must be + * a List as returned by CanonicalizeLocaleList, against the locales in + * availableLocales and determines the best available language to meet the + * request. The algorithm is implementation dependent, but should produce results + * that a typical user of the requested locales would perceive as at least as + * good as those produced by the LookupMatcher abstract operation. Options + * specified through Unicode locale extension sequences must be ignored by the + * algorithm. Information about such subsequences is returned separately. + * The abstract operation returns a record with a [[locale]] field, whose value + * is the language tag of the selected locale, which must be an element of + * availableLocales. If the language tag of the request locale that led to the + * selected locale contained a Unicode locale extension sequence, then the + * returned record also contains an [[extension]] field whose value is the first + * Unicode locale extension sequence, and an [[extensionIndex]] field whose value + * is the index of the first Unicode locale extension sequence within the request + * locale language tag. */ - module.exports = { + function /* 9.2.4 */BestFitMatcher (availableLocales, requestedLocales) { + return LookupMatcher(availableLocales, requestedLocales); + } - /** - * An internal utility function used by `validateListening` - * - * @param {Action|Store} listenable The listenable we want to search for - * @returns {Boolean} The result of a recursive search among `this.subscriptions` - */ - hasListener: function(listenable) { - var i = 0, j, listener, listenables; - for (;i < (this.subscriptions||[]).length; ++i) { - listenables = [].concat(this.subscriptions[i].listenable); - for (j = 0; j < listenables.length; j++){ - listener = listenables[j]; - if (listener === listenable || listener.hasListener && listener.hasListener(listenable)) { - return true; + /** + * The ResolveLocale abstract operation compares a BCP 47 language priority list + * requestedLocales against the locales in availableLocales and determines the + * best available language to meet the request. availableLocales and + * requestedLocales must be provided as List values, options as a Record. + */ + function /* 9.2.5 */ResolveLocale (availableLocales, requestedLocales, options, relevantExtensionKeys, localeData) { + if (availableLocales.length === 0) { + throw new ReferenceError('No locale data has been provided for this object yet.'); + } + + // The following steps are taken: + var + // 1. Let matcher be the value of options.[[localeMatcher]]. + matcher = options['[[localeMatcher]]']; + + // 2. If matcher is "lookup", then + if (matcher === 'lookup') + var + // a. Let r be the result of calling the LookupMatcher abstract operation + // (defined in 9.2.3) with arguments availableLocales and + // requestedLocales. + r = LookupMatcher(availableLocales, requestedLocales); + + // 3. Else + else + var + // a. Let r be the result of calling the BestFitMatcher abstract + // operation (defined in 9.2.4) with arguments availableLocales and + // requestedLocales. + r = BestFitMatcher(availableLocales, requestedLocales); + + var + // 4. Let foundLocale be the value of r.[[locale]]. + foundLocale = r['[[locale]]']; + + // 5. If r has an [[extension]] field, then + if (hop.call(r, '[[extension]]')) + var + // a. Let extension be the value of r.[[extension]]. + extension = r['[[extension]]'], + // b. Let extensionIndex be the value of r.[[extensionIndex]]. + extensionIndex = r['[[extensionIndex]]'], + // c. Let split be the standard built-in function object defined in ES5, + // 15.5.4.14. + split = String.prototype.split, + // d. Let extensionSubtags be the result of calling the [[Call]] internal + // method of split with extension as the this value and an argument + // list containing the single item "-". + extensionSubtags = split.call(extension, '-'), + // e. Let extensionSubtagsLength be the result of calling the [[Get]] + // internal method of extensionSubtags with argument "length". + extensionSubtagsLength = extensionSubtags.length; + + var + // 6. Let result be a new Record. + result = new Record(); + + // 7. Set result.[[dataLocale]] to foundLocale. + result['[[dataLocale]]'] = foundLocale; + + var + // 8. Let supportedExtension be "-u". + supportedExtension = '-u', + // 9. Let i be 0. + i = 0, + // 10. Let len be the result of calling the [[Get]] internal method of + // relevantExtensionKeys with argument "length". + len = relevantExtensionKeys.length; + + // 11 Repeat while i < len: + while (i < len) { + var + // a. Let key be the result of calling the [[Get]] internal method of + // relevantExtensionKeys with argument ToString(i). + key = relevantExtensionKeys[i], + // b. Let foundLocaleData be the result of calling the [[Get]] internal + // method of localeData with the argument foundLocale. + foundLocaleData = localeData[foundLocale], + // c. Let keyLocaleData be the result of calling the [[Get]] internal + // method of foundLocaleData with the argument key. + keyLocaleData = foundLocaleData[key], + // d. Let value be the result of calling the [[Get]] internal method of + // keyLocaleData with argument "0". + value = keyLocaleData['0'], + // e. Let supportedExtensionAddition be "". + supportedExtensionAddition = '', + // f. Let indexOf be the standard built-in function object defined in + // ES5, 15.4.4.14. + indexOf = arrIndexOf; + + // g. If extensionSubtags is not undefined, then + if (extensionSubtags !== undefined) { + var + // i. Let keyPos be the result of calling the [[Call]] internal + // method of indexOf with extensionSubtags as the this value and + // an argument list containing the single item key. + keyPos = indexOf.call(extensionSubtags, key); + + // ii. If keyPos ≠ -1, then + if (keyPos !== -1) { + // 1. If keyPos + 1 < extensionSubtagsLength and the length of the + // result of calling the [[Get]] internal method of + // extensionSubtags with argument ToString(keyPos +1) is greater + // than 2, then + if (keyPos + 1 < extensionSubtagsLength + && extensionSubtags[keyPos + 1].length > 2) { + var + // a. Let requestedValue be the result of calling the [[Get]] + // internal method of extensionSubtags with argument + // ToString(keyPos + 1). + requestedValue = extensionSubtags[keyPos + 1], + // b. Let valuePos be the result of calling the [[Call]] + // internal method of indexOf with keyLocaleData as the + // this value and an argument list containing the single + // item requestedValue. + valuePos = indexOf.call(keyLocaleData, requestedValue); + + // c. If valuePos ≠ -1, then + if (valuePos !== -1) + var + // i. Let value be requestedValue. + value = requestedValue, + // ii. Let supportedExtensionAddition be the + // concatenation of "-", key, "-", and value. + supportedExtensionAddition = '-' + key + '-' + value; + } + // 2. Else + else { + var + // a. Let valuePos be the result of calling the [[Call]] + // internal method of indexOf with keyLocaleData as the this + // value and an argument list containing the single item + // "true". + valuePos = indexOf(keyLocaleData, 'true'); + + // b. If valuePos ≠ -1, then + if (valuePos !== -1) + var + // i. Let value be "true". + value = 'true'; } } } - return false; - }, - - /** - * A convenience method that listens to all listenables in the given object. - * - * @param {Object} listenables An object of listenables. Keys will be used as callback method names. - */ - listenToMany: function(listenables){ - var allListenables = flattenListenables(listenables); - for(var key in allListenables){ - var cbname = _.callbackName(key), - localname = this[cbname] ? cbname : this[key] ? key : undefined; - if (localname){ - this.listenTo(allListenables[key],localname,this[cbname+"Default"]||this[localname+"Default"]||localname); + // h. If options has a field [[]], then + if (hop.call(options, '[[' + key + ']]')) { + var + // i. Let optionsValue be the value of options.[[]]. + optionsValue = options['[[' + key + ']]']; + + // ii. If the result of calling the [[Call]] internal method of indexOf + // with keyLocaleData as the this value and an argument list + // containing the single item optionsValue is not -1, then + if (indexOf.call(keyLocaleData, optionsValue) !== -1) { + // 1. If optionsValue is not equal to value, then + if (optionsValue !== value) { + // a. Let value be optionsValue. + value = optionsValue; + // b. Let supportedExtensionAddition be "". + supportedExtensionAddition = ''; + } } } - }, + // i. Set result.[[]] to value. + result['[[' + key + ']]'] = value; + + // j. Append supportedExtensionAddition to supportedExtension. + supportedExtension += supportedExtensionAddition; + + // k. Increase i by 1. + i++; + } + // 12. If the length of supportedExtension is greater than 2, then + if (supportedExtension.length > 2) { + var + // a. Let preExtension be the substring of foundLocale from position 0, + // inclusive, to position extensionIndex, exclusive. + preExtension = foundLocale.substring(0, extensionIndex), + // b. Let postExtension be the substring of foundLocale from position + // extensionIndex to the end of the string. + postExtension = foundLocale.substring(extensionIndex), + // c. Let foundLocale be the concatenation of preExtension, + // supportedExtension, and postExtension. + foundLocale = preExtension + supportedExtension + postExtension; + } + // 13. Set result.[[locale]] to foundLocale. + result['[[locale]]'] = foundLocale; + + // 14. Return result. + return result; + } - /** - * Checks if the current context can listen to the supplied listenable - * - * @param {Action|Store} listenable An Action or Store that should be - * listened to. - * @returns {String|Undefined} An error message, or undefined if there was no problem. - */ - validateListening: function(listenable){ - if (listenable === this) { - return "Listener is not able to listen to itself"; - } - if (!_.isFunction(listenable.listen)) { - return listenable + " is missing a listen method"; - } - if (listenable.hasListener && listenable.hasListener(this)) { - return "Listener cannot listen to this listenable because of circular loop"; - } - }, + /** + * The LookupSupportedLocales abstract operation returns the subset of the + * provided BCP 47 language priority list requestedLocales for which + * availableLocales has a matching locale when using the BCP 47 Lookup algorithm. + * Locales appear in the same order in the returned list as in requestedLocales. + * The following steps are taken: + */ + function /* 9.2.6 */LookupSupportedLocales (availableLocales, requestedLocales) { + var + // 1. Let len be the number of elements in requestedLocales. + len = requestedLocales.length, + // 2. Let subset be a new empty List. + subset = new List(), + // 3. Let k be 0. + k = 0; + + // 4. Repeat while k < len + while (k < len) { + var + // a. Let locale be the element of requestedLocales at 0-origined list + // position k. + locale = requestedLocales[k], + // b. Let noExtensionsLocale be the String value that is locale with all + // Unicode locale extension sequences removed. + noExtensionsLocale = String(locale).replace(expUnicodeExSeq, ''), + // c. Let availableLocale be the result of calling the + // BestAvailableLocale abstract operation (defined in 9.2.2) with + // arguments availableLocales and noExtensionsLocale. + availableLocale = BestAvailableLocale(availableLocales, noExtensionsLocale); + + // d. If availableLocale is not undefined, then append locale to the end of + // subset. + if (availableLocale !== undefined) + arrPush.call(subset, locale); + + // e. Increment k by 1. + k++; + } + + var + // 5. Let subsetArray be a new Array object whose elements are the same + // values in the same order as the elements of subset. + subsetArray = arrSlice.call(subset); + + // 6. Return subsetArray. + return subsetArray; + } - /** - * Sets up a subscription to the given listenable for the context object - * - * @param {Action|Store} listenable An Action or Store that should be - * listened to. - * @param {Function|String} callback The callback to register as event handler - * @param {Function|String} defaultCallback The callback to register as default handler - * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is the object being listened to - */ - listenTo: function(listenable, callback, defaultCallback) { - var desub, unsubscriber, subscriptionobj, subs = this.subscriptions = this.subscriptions || []; - _.throwIf(this.validateListening(listenable)); - this.fetchInitialState(listenable, defaultCallback); - desub = listenable.listen(this[callback]||callback, this); - unsubscriber = function() { - var index = subs.indexOf(subscriptionobj); - _.throwIf(index === -1,'Tried to remove listen already gone from subscriptions list!'); - subs.splice(index, 1); - desub(); - }; - subscriptionobj = { - stop: unsubscriber, - listenable: listenable - }; - subs.push(subscriptionobj); - return subscriptionobj; - }, + /** + * The BestFitSupportedLocales abstract operation returns the subset of the + * provided BCP 47 language priority list requestedLocales for which + * availableLocales has a matching locale when using the Best Fit Matcher + * algorithm. Locales appear in the same order in the returned list as in + * requestedLocales. The steps taken are implementation dependent. + */ + function /*9.2.7 */BestFitSupportedLocales (availableLocales, requestedLocales) { + // ###TODO: implement this function as described by the specification### + return LookupSupportedLocales(availableLocales, requestedLocales); + } - /** - * Stops listening to a single listenable - * - * @param {Action|Store} listenable The action or store we no longer want to listen to - * @returns {Boolean} True if a subscription was found and removed, otherwise false. - */ - stopListeningTo: function(listenable){ - var sub, i = 0, subs = this.subscriptions || []; - for(;i < subs.length; i++){ - sub = subs[i]; - if (sub.listenable === listenable){ - sub.stop(); - _.throwIf(subs.indexOf(sub)!==-1,'Failed to remove listen from subscriptions list!'); - return true; - } + /** + * The SupportedLocales abstract operation returns the subset of the provided BCP + * 47 language priority list requestedLocales for which availableLocales has a + * matching locale. Two algorithms are available to match the locales: the Lookup + * algorithm described in RFC 4647 section 3.4, and an implementation dependent + * best-fit algorithm. Locales appear in the same order in the returned list as + * in requestedLocales. The following steps are taken: + */ + function /*9.2.8 */SupportedLocales (availableLocales, requestedLocales, options) { + // 1. If options is not undefined, then + if (options !== undefined) { + var + // a. Let options be ToObject(options). + options = new Record(toObject(options)), + // b. Let matcher be the result of calling the [[Get]] internal method of + // options with argument "localeMatcher". + matcher = options.localeMatcher; + + // c. If matcher is not undefined, then + if (matcher !== undefined) { + // i. Let matcher be ToString(matcher). + matcher = String(matcher); + + // ii. If matcher is not "lookup" or "best fit", then throw a RangeError + // exception. + if (matcher !== 'lookup' && matcher !== 'best fit') + throw new RangeError('matcher should be "lookup" or "best fit"'); } - return false; - }, + } + // 2. If matcher is undefined or "best fit", then + if (matcher === undefined || matcher === 'best fit') + var + // a. Let subset be the result of calling the BestFitSupportedLocales + // abstract operation (defined in 9.2.7) with arguments + // availableLocales and requestedLocales. + subset = BestFitSupportedLocales(availableLocales, requestedLocales); + // 3. Else + else + var + // a. Let subset be the result of calling the LookupSupportedLocales + // abstract operation (defined in 9.2.6) with arguments + // availableLocales and requestedLocales. + subset = LookupSupportedLocales(availableLocales, requestedLocales); + + // 4. For each named own property name P of subset, + for (var P in subset) { + if (!hop.call(subset, P)) + continue; - /** - * Stops all subscriptions and empties subscriptions array - */ - stopListeningToAll: function(){ - var remaining, subs = this.subscriptions || []; - while((remaining=subs.length)){ - subs[0].stop(); - _.throwIf(subs.length!==remaining-1,'Failed to remove listen from subscriptions list!'); - } - }, + // a. Let desc be the result of calling the [[GetOwnProperty]] internal + // method of subset with P. + // b. Set desc.[[Writable]] to false. + // c. Set desc.[[Configurable]] to false. + // d. Call the [[DefineOwnProperty]] internal method of subset with P, desc, + // and true as arguments. + defineProperty(subset, P, { + writable: false, configurable: false, value: subset[P] + }); + } + // "Freeze" the array so no new elements can be added + defineProperty(subset, 'length', { writable: false }); - /** - * Used in `listenTo`. Fetches initial data from a publisher if it has a `getInitialState` method. - * @param {Action|Store} listenable The publisher we want to get initial state from - * @param {Function|String} defaultCallback The method to receive the data - */ - fetchInitialState: function (listenable, defaultCallback) { - defaultCallback = (defaultCallback && this[defaultCallback]) || defaultCallback; - var me = this; - if (_.isFunction(defaultCallback) && _.isFunction(listenable.getInitialState)) { - var data = listenable.getInitialState(); - if (data && _.isFunction(data.then)) { - data.then(function() { - defaultCallback.apply(me, arguments); - }); - } else { - defaultCallback.call(this, data); - } + // 5. Return subset + return subset; + } + + /** + * The GetOption abstract operation extracts the value of the property named + * property from the provided options object, converts it to the required type, + * checks whether it is one of a List of allowed values, and fills in a fallback + * value if necessary. + */ + function /*9.2.9 */GetOption (options, property, type, values, fallback) { + var + // 1. Let value be the result of calling the [[Get]] internal method of + // options with argument property. + value = options[property]; + + // 2. If value is not undefined, then + if (value !== undefined) { + // a. Assert: type is "boolean" or "string". + // b. If type is "boolean", then let value be ToBoolean(value). + // c. If type is "string", then let value be ToString(value). + value = type === 'boolean' ? Boolean(value) + : (type === 'string' ? String(value) : value); + + // d. If values is not undefined, then + if (values !== undefined) { + // i. If values does not contain an element equal to value, then throw a + // RangeError exception. + if (arrIndexOf.call(values, value) === -1) + throw new RangeError("'" + value + "' is not an allowed value for `" + property +'`'); } - }, - /** - * The callback will be called once all listenables have triggered at least once. - * It will be invoked with the last emission from each listenable. - * @param {...Publishers} publishers Publishers that should be tracked. - * @param {Function|String} callback The method to call when all publishers have emitted - * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables - */ - joinTrailing: maker("last"), + // e. Return value. + return value; + } + // Else return fallback. + return fallback; + } - /** - * The callback will be called once all listenables have triggered at least once. - * It will be invoked with the first emission from each listenable. - * @param {...Publishers} publishers Publishers that should be tracked. - * @param {Function|String} callback The method to call when all publishers have emitted - * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables - */ - joinLeading: maker("first"), + /** + * The GetNumberOption abstract operation extracts a property value from the + * provided options object, converts it to a Number value, checks whether it is + * in the allowed range, and fills in a fallback value if necessary. + */ + function /* 9.2.10 */GetNumberOption (options, property, minimum, maximum, fallback) { + var + // 1. Let value be the result of calling the [[Get]] internal method of + // options with argument property. + value = options[property]; + + // 2. If value is not undefined, then + if (value !== undefined) { + // a. Let value be ToNumber(value). + value = Number(value); + + // b. If value is NaN or less than minimum or greater than maximum, throw a + // RangeError exception. + if (isNaN(value) || value < minimum || value > maximum) + throw new RangeError('Value is not a number or outside accepted range'); + + // c. Return floor(value). + return Math.floor(value); + } + // 3. Else return fallback. + return fallback; + } - /** - * The callback will be called once all listenables have triggered at least once. - * It will be invoked with all emission from each listenable. - * @param {...Publishers} publishers Publishers that should be tracked. - * @param {Function|String} callback The method to call when all publishers have emitted - * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables - */ - joinConcat: maker("all"), + // 11.1 The Intl.NumberFormat constructor + // ====================================== - /** - * The callback will be called once all listenables have triggered. - * If a callback triggers twice before that happens, an error is thrown. - * @param {...Publishers} publishers Publishers that should be tracked. - * @param {Function|String} callback The method to call when all publishers have emitted - * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables - */ - joinStrict: maker("strict") - }; + // Define the NumberFormat constructor internally so it cannot be tainted + function NumberFormatConstructor () { + var locales = arguments[0]; + var options = arguments[1]; + if (!this || this === Intl) { + return new Intl.NumberFormat(locales, options); + } -/***/ }, -/* 60 */ -/***/ function(module, exports, __webpack_require__) { + return InitializeNumberFormat(toObject(this), locales, options); + } + + defineProperty(Intl, 'NumberFormat', { + configurable: true, + writable: true, + value: NumberFormatConstructor + }); - var _ = __webpack_require__(70); + // Must explicitly set prototypes as unwritable + defineProperty(Intl.NumberFormat, 'prototype', { + writable: false + }); /** - * A module of methods for object that you want to be able to listen to. - * This module is consumed by `createStore` and `createAction` + * The abstract operation InitializeNumberFormat accepts the arguments + * numberFormat (which must be an object), locales, and options. It initializes + * numberFormat as a NumberFormat object. */ - module.exports = { + function /*11.1.1.1 */InitializeNumberFormat (numberFormat, locales, options) { + var + // This will be a internal properties object if we're not already initialized + internal = getInternalProperties(numberFormat), + + // Create an object whose props can be used to restore the values of RegExp props + regexpState = createRegExpRestore(); + + // 1. If numberFormat has an [[initializedIntlObject]] internal property with + // value true, throw a TypeError exception. + if (internal['[[initializedIntlObject]]'] === true) + throw new TypeError('`this` object has already been initialized as an Intl object'); + + // Need this to access the `internal` object + defineProperty(numberFormat, '__getInternalProperties', { + value: function () { + // NOTE: Non-standard, for internal use only + if (arguments[0] === secret) + return internal; + } + }); - /** - * Hook used by the publisher that is invoked before emitting - * and before `shouldEmit`. The arguments are the ones that the action - * is invoked with. If this function returns something other than - * undefined, that will be passed on as arguments for shouldEmit and - * emission. - */ - preEmit: function() {}, + // 2. Set the [[initializedIntlObject]] internal property of numberFormat to true. + internal['[[initializedIntlObject]]'] = true; + + var + // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList + // abstract operation (defined in 9.2.1) with argument locales. + requestedLocales = CanonicalizeLocaleList(locales); + + // 4. If options is undefined, then + if (options === undefined) + // a. Let options be the result of creating a new object as if by the + // expression new Object() where Object is the standard built-in constructor + // with that name. + options = {}; + + // 5. Else + else + // a. Let options be ToObject(options). + options = toObject(options); + + var + // 6. Let opt be a new Record. + opt = new Record(), + + // 7. Let matcher be the result of calling the GetOption abstract operation + // (defined in 9.2.9) with the arguments options, "localeMatcher", "string", + // a List containing the two String values "lookup" and "best fit", and + // "best fit". + matcher = GetOption(options, 'localeMatcher', 'string', new List('lookup', 'best fit'), 'best fit'); + + // 8. Set opt.[[localeMatcher]] to matcher. + opt['[[localeMatcher]]'] = matcher; + + var + // 9. Let NumberFormat be the standard built-in object that is the initial value + // of Intl.NumberFormat. + // 10. Let localeData be the value of the [[localeData]] internal property of + // NumberFormat. + localeData = internals.NumberFormat['[[localeData]]'], + + // 11. Let r be the result of calling the ResolveLocale abstract operation + // (defined in 9.2.5) with the [[availableLocales]] internal property of + // NumberFormat, requestedLocales, opt, the [[relevantExtensionKeys]] + // internal property of NumberFormat, and localeData. + r = ResolveLocale( + internals.NumberFormat['[[availableLocales]]'], requestedLocales, + opt, internals.NumberFormat['[[relevantExtensionKeys]]'], localeData + ); - /** - * Hook used by the publisher after `preEmit` to determine if the - * event should be emitted with given arguments. This may be overridden - * in your application, default implementation always returns true. - * - * @returns {Boolean} true if event should be emitted - */ - shouldEmit: function() { return true; }, + // 12. Set the [[locale]] internal property of numberFormat to the value of + // r.[[locale]]. + internal['[[locale]]'] = r['[[locale]]']; + + // 13. Set the [[numberingSystem]] internal property of numberFormat to the value + // of r.[[nu]]. + internal['[[numberingSystem]]'] = r['[[nu]]']; + + // The specification doesn't tell us to do this, but it's helpful later on + internal['[[dataLocale]]'] = r['[[dataLocale]]']; + + var + // 14. Let dataLocale be the value of r.[[dataLocale]]. + dataLocale = r['[[dataLocale]]'], + + // 15. Let s be the result of calling the GetOption abstract operation with the + // arguments options, "style", "string", a List containing the three String + // values "decimal", "percent", and "currency", and "decimal". + s = GetOption(options, 'style', 'string', new List('decimal', 'percent', 'currency'), 'decimal'); + + // 16. Set the [[style]] internal property of numberFormat to s. + internal['[[style]]'] = s; + + var + // 17. Let c be the result of calling the GetOption abstract operation with the + // arguments options, "currency", "string", undefined, and undefined. + c = GetOption(options, 'currency', 'string'); + + // 18. If c is not undefined and the result of calling the + // IsWellFormedCurrencyCode abstract operation (defined in 6.3.1) with + // argument c is false, then throw a RangeError exception. + if (c !== undefined && !IsWellFormedCurrencyCode(c)) + throw new RangeError("'" + c + "' is not a valid currency code"); + + // 19. If s is "currency" and c is undefined, throw a TypeError exception. + if (s === 'currency' && c === undefined) + throw new TypeError('Currency code is required when style is currency'); + + // 20. If s is "currency", then + if (s === 'currency') { + // a. Let c be the result of converting c to upper case as specified in 6.1. + c = c.toUpperCase(); + + // b. Set the [[currency]] internal property of numberFormat to c. + internal['[[currency]]'] = c; + + var + // c. Let cDigits be the result of calling the CurrencyDigits abstract + // operation (defined below) with argument c. + cDigits = CurrencyDigits(c); + } + + var + // 21. Let cd be the result of calling the GetOption abstract operation with the + // arguments options, "currencyDisplay", "string", a List containing the + // three String values "code", "symbol", and "name", and "symbol". + cd = GetOption(options, 'currencyDisplay', 'string', new List('code', 'symbol', 'name'), 'symbol'); + + // 22. If s is "currency", then set the [[currencyDisplay]] internal property of + // numberFormat to cd. + if (s === 'currency') + internal['[[currencyDisplay]]'] = cd; + + var + // 23. Let mnid be the result of calling the GetNumberOption abstract operation + // (defined in 9.2.10) with arguments options, "minimumIntegerDigits", 1, 21, + // and 1. + mnid = GetNumberOption(options, 'minimumIntegerDigits', 1, 21, 1); + + // 24. Set the [[minimumIntegerDigits]] internal property of numberFormat to mnid. + internal['[[minimumIntegerDigits]]'] = mnid; + + var + // 25. If s is "currency", then let mnfdDefault be cDigits; else let mnfdDefault + // be 0. + mnfdDefault = s === 'currency' ? cDigits : 0, + + // 26. Let mnfd be the result of calling the GetNumberOption abstract operation + // with arguments options, "minimumFractionDigits", 0, 20, and mnfdDefault. + mnfd = GetNumberOption(options, 'minimumFractionDigits', 0, 20, mnfdDefault); + + // 27. Set the [[minimumFractionDigits]] internal property of numberFormat to mnfd. + internal['[[minimumFractionDigits]]'] = mnfd; + + var + // 28. If s is "currency", then let mxfdDefault be max(mnfd, cDigits); else if s + // is "percent", then let mxfdDefault be max(mnfd, 0); else let mxfdDefault + // be max(mnfd, 3). + mxfdDefault = s === 'currency' ? Math.max(mnfd, cDigits) + : (s === 'percent' ? Math.max(mnfd, 0) : Math.max(mnfd, 3)), + + // 29. Let mxfd be the result of calling the GetNumberOption abstract operation + // with arguments options, "maximumFractionDigits", mnfd, 20, and mxfdDefault. + mxfd = GetNumberOption(options, 'maximumFractionDigits', mnfd, 20, mxfdDefault); + + // 30. Set the [[maximumFractionDigits]] internal property of numberFormat to mxfd. + internal['[[maximumFractionDigits]]'] = mxfd; + + var + // 31. Let mnsd be the result of calling the [[Get]] internal method of options + // with argument "minimumSignificantDigits". + mnsd = options.minimumSignificantDigits, + + // 32. Let mxsd be the result of calling the [[Get]] internal method of options + // with argument "maximumSignificantDigits". + mxsd = options.maximumSignificantDigits; + + // 33. If mnsd is not undefined or mxsd is not undefined, then: + if (mnsd !== undefined || mxsd !== undefined) { + // a. Let mnsd be the result of calling the GetNumberOption abstract + // operation with arguments options, "minimumSignificantDigits", 1, 21, + // and 1. + mnsd = GetNumberOption(options, 'minimumSignificantDigits', 1, 21, 1); + + // b. Let mxsd be the result of calling the GetNumberOption abstract + // operation with arguments options, "maximumSignificantDigits", mnsd, + // 21, and 21. + mxsd = GetNumberOption(options, 'maximumSignificantDigits', mnsd, 21, 21); + + // c. Set the [[minimumSignificantDigits]] internal property of numberFormat + // to mnsd, and the [[maximumSignificantDigits]] internal property of + // numberFormat to mxsd. + internal['[[minimumSignificantDigits]]'] = mnsd; + internal['[[maximumSignificantDigits]]'] = mxsd; + } + var + // 34. Let g be the result of calling the GetOption abstract operation with the + // arguments options, "useGrouping", "boolean", undefined, and true. + g = GetOption(options, 'useGrouping', 'boolean', undefined, true); + + // 35. Set the [[useGrouping]] internal property of numberFormat to g. + internal['[[useGrouping]]'] = g; + + var + // 36. Let dataLocaleData be the result of calling the [[Get]] internal method of + // localeData with argument dataLocale. + dataLocaleData = localeData[dataLocale], + + // 37. Let patterns be the result of calling the [[Get]] internal method of + // dataLocaleData with argument "patterns". + patterns = dataLocaleData.patterns; + + // 38. Assert: patterns is an object (see 11.2.3) + + var + // 39. Let stylePatterns be the result of calling the [[Get]] internal method of + // patterns with argument s. + stylePatterns = patterns[s]; + + // 40. Set the [[positivePattern]] internal property of numberFormat to the + // result of calling the [[Get]] internal method of stylePatterns with the + // argument "positivePattern". + internal['[[positivePattern]]'] = stylePatterns.positivePattern; + + // 41. Set the [[negativePattern]] internal property of numberFormat to the + // result of calling the [[Get]] internal method of stylePatterns with the + // argument "negativePattern". + internal['[[negativePattern]]'] = stylePatterns.negativePattern; + + // 42. Set the [[boundFormat]] internal property of numberFormat to undefined. + internal['[[boundFormat]]'] = undefined; + + // 43. Set the [[initializedNumberFormat]] internal property of numberFormat to + // true. + internal['[[initializedNumberFormat]]'] = true; + + // In ES3, we need to pre-bind the format() function + if (es3) + numberFormat.format = GetFormatNumber.call(numberFormat); + + // Restore the RegExp properties + regexpState.exp.test(regexpState.input); + + // Return the newly initialised object + return numberFormat; + } - /** - * Subscribes the given callback for action triggered - * - * @param {Function} callback The callback to register as event handler - * @param {Mixed} [optional] bindContext The context to bind the callback with - * @returns {Function} Callback that unsubscribes the registered event handler - */ - listen: function(callback, bindContext) { - bindContext = bindContext || this; - var eventHandler = function(args) { - if (aborted){ - return; - } - callback.apply(bindContext, args); - }, me = this, aborted = false; - this.emitter.addListener(this.eventLabel, eventHandler); - return function() { - aborted = true; - me.emitter.removeListener(me.eventLabel, eventHandler); - }; - }, + function CurrencyDigits(currency) { + // When the CurrencyDigits abstract operation is called with an argument currency + // (which must be an upper case String value), the following steps are taken: - /** - * Attach handlers to promise that trigger the completed and failed - * child publishers, if available. - * - * @param {Object} The promise to attach to - */ - promise: function(promise) { - var me = this; + // 1. If the ISO 4217 currency and funds code list contains currency as an + // alphabetic code, then return the minor unit value corresponding to the + // currency from the list; else return 2. + return currencyMinorUnits[currency] !== undefined + ? currencyMinorUnits[currency] + : 2; + } - var canHandlePromise = - this.children.indexOf('completed') >= 0 && - this.children.indexOf('failed') >= 0; + /* 11.2.3 */internals.NumberFormat = { + '[[availableLocales]]': [], + '[[relevantExtensionKeys]]': ['nu'], + '[[localeData]]': {} + }; - if (!canHandlePromise){ - throw new Error('Publisher must have "completed" and "failed" child publishers'); + /** + * When the supportedLocalesOf method of Intl.NumberFormat is called, the + * following steps are taken: + */ + /* 11.2.2 */defineProperty(Intl.NumberFormat, 'supportedLocalesOf', { + configurable: true, + writable: true, + value: fnBind.call(supportedLocalesOf, internals.NumberFormat) + }); + + /** + * This named accessor property returns a function that formats a number + * according to the effective locale and the formatting options of this + * NumberFormat object. + */ + /* 11.3.2 */defineProperty(Intl.NumberFormat.prototype, 'format', { + configurable: true, + get: GetFormatNumber + }); + + function GetFormatNumber() { + var internal = this != null && typeof this === 'object' && getInternalProperties(this); + + // Satisfy test 11.3_b + if (!internal || !internal['[[initializedNumberFormat]]']) + throw new TypeError('`this` value for format() is not an initialized Intl.NumberFormat object.'); + + // The value of the [[Get]] attribute is a function that takes the following + // steps: + + // 1. If the [[boundFormat]] internal property of this NumberFormat object + // is undefined, then: + if (internal['[[boundFormat]]'] === undefined) { + var + // a. Let F be a Function object, with internal properties set as + // specified for built-in functions in ES5, 15, or successor, and the + // length property set to 1, that takes the argument value and + // performs the following steps: + F = function (value) { + // i. If value is not provided, then let value be undefined. + // ii. Let x be ToNumber(value). + // iii. Return the result of calling the FormatNumber abstract + // operation (defined below) with arguments this and x. + return FormatNumber(this, /* x = */Number(value)); + }, + + // b. Let bind be the standard built-in function object defined in ES5, + // 15.3.4.5. + // c. Let bf be the result of calling the [[Call]] internal method of + // bind with F as the this value and an argument list containing + // the single item this. + bf = fnBind.call(F, this); + + // d. Set the [[boundFormat]] internal property of this NumberFormat + // object to bf. + internal['[[boundFormat]]'] = bf; } + // Return the value of the [[boundFormat]] internal property of this + // NumberFormat object. + return internal['[[boundFormat]]']; + } - promise.then(function(response) { - return me.completed(response); - }, function(error) { - return me.failed(error); - }); - }, + /** + * When the FormatNumber abstract operation is called with arguments numberFormat + * (which must be an object initialized as a NumberFormat) and x (which must be a + * Number value), it returns a String value representing x according to the + * effective locale and the formatting options of numberFormat. + */ + function FormatNumber (numberFormat, x) { + var n, + + // Create an object whose props can be used to restore the values of RegExp props + regexpState = createRegExpRestore(), + + internal = getInternalProperties(numberFormat), + locale = internal['[[dataLocale]]'], + nums = internal['[[numberingSystem]]'], + data = internals.NumberFormat['[[localeData]]'][locale], + ild = data.symbols[nums] || data.symbols.latn, + + // 1. Let negative be false. + negative = false; + + // 2. If the result of isFinite(x) is false, then + if (isFinite(x) === false) { + // a. If x is NaN, then let n be an ILD String value indicating the NaN value. + if (isNaN(x)) + n = ild.nan; + + // b. Else + else { + // a. Let n be an ILD String value indicating infinity. + n = ild.infinity; + // b. If x < 0, then let negative be true. + if (x < 0) + negative = true; + } + } + // 3. Else + else { + // a. If x < 0, then + if (x < 0) { + // i. Let negative be true. + negative = true; + // ii. Let x be -x. + x = -x; + } - /** - * Subscribes the given callback for action triggered, which should - * return a promise that in turn is passed to `this.promise` - * - * @param {Function} callback The callback to register as event handler - */ - listenAndPromise: function(callback, bindContext) { - var me = this; - bindContext = bindContext || this; - this.willCallPromise = (this.willCallPromise || 0) + 1; + // b. If the value of the [[style]] internal property of numberFormat is + // "percent", let x be 100 × x. + if (internal['[[style]]'] === 'percent') + x *= 100; + + // c. If the [[minimumSignificantDigits]] and [[maximumSignificantDigits]] + // internal properties of numberFormat are present, then + if (hop.call(internal, '[[minimumSignificantDigits]]') && + hop.call(internal, '[[maximumSignificantDigits]]')) + // i. Let n be the result of calling the ToRawPrecision abstract operation + // (defined below), passing as arguments x and the values of the + // [[minimumSignificantDigits]] and [[maximumSignificantDigits]] + // internal properties of numberFormat. + n = ToRawPrecision(x, + internal['[[minimumSignificantDigits]]'], + internal['[[maximumSignificantDigits]]']); + // d. Else + else + // i. Let n be the result of calling the ToRawFixed abstract operation + // (defined below), passing as arguments x and the values of the + // [[minimumIntegerDigits]], [[minimumFractionDigits]], and + // [[maximumFractionDigits]] internal properties of numberFormat. + n = ToRawFixed(x, + internal['[[minimumIntegerDigits]]'], + internal['[[minimumFractionDigits]]'], + internal['[[maximumFractionDigits]]']); + + // e. If the value of the [[numberingSystem]] internal property of + // numberFormat matches one of the values in the “Numbering System” column + // of Table 2 below, then + if (numSys[nums]) { + // i. Let digits be an array whose 10 String valued elements are the + // UTF-16 string representations of the 10 digits specified in the + // “Digits” column of Table 2 in the row containing the value of the + // [[numberingSystem]] internal property. + var digits = numSys[internal['[[numberingSystem]]']]; + // ii. Replace each digit in n with the value of digits[digit]. + n = String(n).replace(/\d/g, function (digit) { + return digits[digit]; + }); + } + // f. Else use an implementation dependent algorithm to map n to the + // appropriate representation of n in the given numbering system. + else + n = String(n); // ###TODO### - var removeListen = this.listen(function() { + // g. If n contains the character ".", then replace it with an ILND String + // representing the decimal separator. + n = n.replace(/\./g, ild.decimal); - if (!callback) { - throw new Error('Expected a function returning a promise but got ' + callback); - } + // h. If the value of the [[useGrouping]] internal property of numberFormat + // is true, then insert an ILND String representing a grouping separator + // into an ILND set of locations within the integer part of n. + if (internal['[[useGrouping]]'] === true) { + var + parts = n.split(ild.decimal), + igr = parts[0], - var args = arguments, - promise = callback.apply(bindContext, args); - return me.promise.call(me, promise); - }, bindContext); + // Primary group represents the group closest to the decimal + pgSize = data.patterns.primaryGroupSize || 3, - return function () { - me.willCallPromise--; - removeListen.call(me); - }; + // Secondary group is every other group + sgSize = data.patterns.secondaryGroupSize || pgSize; - }, + // Group only if necessary + if (igr.length > pgSize) { + var + groups = new List(), - /** - * Publishes an event using `this.emitter` (if `shouldEmit` agrees) - */ - trigger: function() { - var args = arguments, - pre = this.preEmit.apply(this, args); - args = pre === undefined ? args : _.isArguments(pre) ? pre : [].concat(pre); - if (this.shouldEmit.apply(this, args)) { - this.emitter.emit(this.eventLabel, args); - } - }, + // Index of the primary grouping separator + end = igr.length - pgSize, - /** - * Tries to publish the event on the next tick - */ - triggerAsync: function(){ - var args = arguments,me = this; - _.nextTick(function() { - me.trigger.apply(me, args); - }); - }, + // Starting index for our loop + idx = end % sgSize, - /** - * Returns a Promise for the triggered action - * - * @return {Promise} - * Resolved by completed child action. - * Rejected by failed child action. - * If listenAndPromise'd, then promise associated to this trigger. - * Otherwise, the promise is for next child action completion. - */ - triggerPromise: function(){ - var me = this; - var args = arguments; + start = igr.slice(0, idx); - var canHandlePromise = - this.children.indexOf('completed') >= 0 && - this.children.indexOf('failed') >= 0; + if (start.length) + arrPush.call(groups, start); - var promise = _.createPromise(function(resolve, reject) { - // If `listenAndPromise` is listening - // patch `promise` w/ context-loaded resolve/reject - if (me.willCallPromise) { - _.nextTick(function() { - var old_promise_method = me.promise; - me.promise = function (promise) { - promise.then(resolve, reject); - // Back to your regularly schedule programming. - me.promise = old_promise_method; - return me.promise.apply(me, arguments); - }; - me.trigger.apply(me, args); - }); - return; - } + // Loop to separate into secondary grouping digits + while (idx < end) { + arrPush.call(groups, igr.slice(idx, idx + sgSize)); + idx += sgSize; + } - if (canHandlePromise) { - var removeSuccess = me.completed.listen(function(args) { - removeSuccess(); - removeFailed(); - resolve(args); - }); + // Add the primary grouping digits + arrPush.call(groups, igr.slice(end)); - var removeFailed = me.failed.listen(function(args) { - removeSuccess(); - removeFailed(); - reject(args); - }); + parts[0] = arrJoin.call(groups, ild.group); } - me.triggerAsync.apply(me, args); + n = arrJoin.call(parts, ild.decimal); + } + } - if (!canHandlePromise) { - resolve(); - } - }); + var + // 4. If negative is true, then let result be the value of the [[negativePattern]] + // internal property of numberFormat; else let result be the value of the + // [[positivePattern]] internal property of numberFormat. + result = internal[negative === true ? '[[negativePattern]]' : '[[positivePattern]]']; + + // 5. Replace the substring "{number}" within result with n. + result = result.replace('{number}', n); + + // 6. If the value of the [[style]] internal property of numberFormat is + // "currency", then: + if (internal['[[style]]'] === 'currency') { + var cd, + // a. Let currency be the value of the [[currency]] internal property of + // numberFormat. + currency = internal['[[currency]]'], + + // Shorthand for the currency data + cData = data.currencies[currency]; + + // b. If the value of the [[currencyDisplay]] internal property of + // numberFormat is "code", then let cd be currency. + // c. Else if the value of the [[currencyDisplay]] internal property of + // numberFormat is "symbol", then let cd be an ILD string representing + // currency in short form. If the implementation does not have such a + // representation of currency, then use currency itself. + // d. Else if the value of the [[currencyDisplay]] internal property of + // numberFormat is "name", then let cd be an ILD string representing + // currency in long form. If the implementation does not have such a + // representation of currency, then use currency itself. + switch (internal['[[currencyDisplay]]']) { + case 'symbol': + cd = cData || currency; + break; + + default: + case 'code': + case 'name': + cd = currency; + } - return promise; + // e. Replace the substring "{currency}" within result with cd. + result = result.replace('{currency}', cd); } - }; + // Restore the RegExp properties + regexpState.exp.test(regexpState.input); -/***/ }, -/* 61 */ -/***/ function(module, exports, __webpack_require__) { + // 7. Return result. + return result; + } /** - * A module of methods that you want to include in all stores. - * This module is consumed by `createStore`. + * When the ToRawPrecision abstract operation is called with arguments x (which + * must be a finite non-negative number), minPrecision, and maxPrecision (both + * must be integers between 1 and 21) the following steps are taken: */ - module.exports = { - }; - - -/***/ }, -/* 62 */ -/***/ function(module, exports, __webpack_require__) { + function ToRawPrecision (x, minPrecision, maxPrecision) { + var + // 1. Let p be maxPrecision. + p = maxPrecision; + + // 2. If x = 0, then + if (x === 0) { + var + // a. Let m be the String consisting of p occurrences of the character "0". + m = arrJoin.call(Array (p + 1), '0'), + // b. Let e be 0. + e = 0; + } + // 3. Else + else { + // a. Let e and n be integers such that 10ᵖ⁻¹ ≤ n < 10ᵖ and for which the + // exact mathematical value of n × 10ᵉ⁻ᵖ⁺¹ – x is as close to zero as + // possible. If there are two such sets of e and n, pick the e and n for + // which n × 10ᵉ⁻ᵖ⁺¹ is larger. + var + e = log10Floor(Math.abs(x)), + + // Easier to get to m from here + f = Math.round(Math.exp((Math.abs(e - p + 1)) * Math.LN10)), + + // b. Let m be the String consisting of the digits of the decimal + // representation of n (in order, with no leading zeroes) + m = String(Math.round(e - p + 1 < 0 ? x * f : x / f)); + } + + // 4. If e ≥ p, then + if (e >= p) + // a. Return the concatenation of m and e-p+1 occurrences of the character "0". + return m + arrJoin.call(Array(e-p+1 + 1), '0'); + + // 5. If e = p-1, then + else if (e === p - 1) + // a. Return m. + return m; + + // 6. If e ≥ 0, then + else if (e >= 0) + // a. Let m be the concatenation of the first e+1 characters of m, the character + // ".", and the remaining p–(e+1) characters of m. + m = m.slice(0, e + 1) + '.' + m.slice(e + 1); + + // 7. If e < 0, then + else if (e < 0) + // a. Let m be the concatenation of the String "0.", –(e+1) occurrences of the + // character "0", and the string m. + m = '0.' + arrJoin.call(Array (-(e+1) + 1), '0') + m; + + // 8. If m contains the character ".", and maxPrecision > minPrecision, then + if (m.indexOf(".") >= 0 && maxPrecision > minPrecision) { + var + // a. Let cut be maxPrecision – minPrecision. + cut = maxPrecision - minPrecision; + + // b. Repeat while cut > 0 and the last character of m is "0": + while (cut > 0 && m.charAt(m.length-1) === '0') { + // i. Remove the last character from m. + m = m.slice(0, -1); + + // ii. Decrease cut by 1. + cut--; + } - var _ = __webpack_require__(70), - Reflux = __webpack_require__(57), - Keep = __webpack_require__(71), - allowed = {preEmit:1,shouldEmit:1}; + // c. If the last character of m is ".", then + if (m.charAt(m.length-1) === '.') + // i. Remove the last character from m. + m = m.slice(0, -1); + } + // 9. Return m. + return m; + } /** - * Creates an action functor object. It is mixed in with functions - * from the `PublisherMethods` mixin. `preEmit` and `shouldEmit` may - * be overridden in the definition object. - * - * @param {Object} definition The action object definition + * When the ToRawFixed abstract operation is called with arguments x (which must + * be a finite non-negative number), minInteger (which must be an integer between + * 1 and 21), minFraction, and maxFraction (which must be integers between 0 and + * 20) the following steps are taken: */ - var createAction = function(definition) { + function ToRawFixed (x, minInteger, minFraction, maxFraction) { + // (or not because Number.toPrototype.toFixed does a lot of it for us) + var idx, - definition = definition || {}; - if (!_.isObject(definition)){ - definition = {actionName: definition}; - } + // We can pick up after the fixed formatted string (m) is created + m = Number.prototype.toFixed.call(x, maxFraction), - for(var a in Reflux.ActionMethods){ - if (!allowed[a] && Reflux.PublisherMethods[a]) { - throw new Error("Cannot override API method " + a + - " in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead." - ); - } - } + // 4. If [maxFraction] ≠ 0, then + // ... + // e. Let int be the number of characters in a. + // + // 5. Else let int be the number of characters in m. + igr = m.split(".")[0].length, // int is a reserved word - for(var d in definition){ - if (!allowed[d] && Reflux.PublisherMethods[d]) { - throw new Error("Cannot override API method " + d + - " in action creation. Use another method name or override it on Reflux.PublisherMethods instead." - ); - } - } + // 6. Let cut be maxFraction – minFraction. + cut = maxFraction - minFraction, - definition.children = definition.children || []; - if (definition.asyncResult){ - definition.children = definition.children.concat(["completed","failed"]); - } + exp = (idx = m.indexOf('e')) > -1 ? m.slice(idx + 1) : 0; - var i = 0, childActions = {}; - for (; i < definition.children.length; i++) { - var name = definition.children[i]; - childActions[name] = createAction(name); + if (exp) { + m = m.slice(0, idx).replace('.', ''); + m += arrJoin.call(Array(exp - (m.length - 1) + 1), '0') + + '.' + arrJoin.call(Array(maxFraction + 1), '0'); + + igr = m.length; } - var context = _.extend({ - eventLabel: "action", - emitter: new _.EventEmitter(), - _isAction: true - }, Reflux.PublisherMethods, Reflux.ActionMethods, definition); + // 7. Repeat while cut > 0 and the last character of m is "0": + while (cut > 0 && m.slice(-1) === "0") { + // a. Remove the last character from m. + m = m.slice(0, -1); - var functor = function() { - return functor[functor.sync?"trigger":"triggerPromise"].apply(functor, arguments); - }; + // b. Decrease cut by 1. + cut--; + } - _.extend(functor,childActions,context); + // 8. If the last character of m is ".", then + if (m.slice(-1) === ".") + // a. Remove the last character from m. + m = m.slice(0, -1); - Keep.createdActions.push(functor); + // 9. If int < minInteger, then + if (igr < minInteger) + // a. Let z be the String consisting of minInteger–int occurrences of the + // character "0". + var z = arrJoin.call(Array(minInteger - igr + 1), '0'); - return functor; + // 10. Let m be the concatenation of Strings z and m. + // 11. Return m. + return (z ? z : '') + m; + } + // Sect 11.3.2 Table 2, Numbering systems + // ====================================== + var numSys = { + arab: [ '\u0660', '\u0661', '\u0662', '\u0663', '\u0664', '\u0665', '\u0666', '\u0667', '\u0668', '\u0669' ], + arabext: [ '\u06F0', '\u06F1', '\u06F2', '\u06F3', '\u06F4', '\u06F5', '\u06F6', '\u06F7', '\u06F8', '\u06F9' ], + bali: [ '\u1B50', '\u1B51', '\u1B52', '\u1B53', '\u1B54', '\u1B55', '\u1B56', '\u1B57', '\u1B58', '\u1B59' ], + beng: [ '\u09E6', '\u09E7', '\u09E8', '\u09E9', '\u09EA', '\u09EB', '\u09EC', '\u09ED', '\u09EE', '\u09EF' ], + deva: [ '\u0966', '\u0967', '\u0968', '\u0969', '\u096A', '\u096B', '\u096C', '\u096D', '\u096E', '\u096F' ], + fullwide:[ '\uFF10', '\uFF11', '\uFF12', '\uFF13', '\uFF14', '\uFF15', '\uFF16', '\uFF17', '\uFF18', '\uFF19' ], + gujr: [ '\u0AE6', '\u0AE7', '\u0AE8', '\u0AE9', '\u0AEA', '\u0AEB', '\u0AEC', '\u0AED', '\u0AEE', '\u0AEF' ], + guru: [ '\u0A66', '\u0A67', '\u0A68', '\u0A69', '\u0A6A', '\u0A6B', '\u0A6C', '\u0A6D', '\u0A6E', '\u0A6F' ], + hanidec: [ '\u3007', '\u4E00', '\u4E8C', '\u4E09', '\u56DB', '\u4E94', '\u516D', '\u4E03', '\u516B', '\u4E5D' ], + khmr: [ '\u17E0', '\u17E1', '\u17E2', '\u17E3', '\u17E4', '\u17E5', '\u17E6', '\u17E7', '\u17E8', '\u17E9' ], + knda: [ '\u0CE6', '\u0CE7', '\u0CE8', '\u0CE9', '\u0CEA', '\u0CEB', '\u0CEC', '\u0CED', '\u0CEE', '\u0CEF' ], + laoo: [ '\u0ED0', '\u0ED1', '\u0ED2', '\u0ED3', '\u0ED4', '\u0ED5', '\u0ED6', '\u0ED7', '\u0ED8', '\u0ED9' ], + latn: [ '\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037', '\u0038', '\u0039' ], + limb: [ '\u1946', '\u1947', '\u1948', '\u1949', '\u194A', '\u194B', '\u194C', '\u194D', '\u194E', '\u194F' ], + mlym: [ '\u0D66', '\u0D67', '\u0D68', '\u0D69', '\u0D6A', '\u0D6B', '\u0D6C', '\u0D6D', '\u0D6E', '\u0D6F' ], + mong: [ '\u1810', '\u1811', '\u1812', '\u1813', '\u1814', '\u1815', '\u1816', '\u1817', '\u1818', '\u1819' ], + mymr: [ '\u1040', '\u1041', '\u1042', '\u1043', '\u1044', '\u1045', '\u1046', '\u1047', '\u1048', '\u1049' ], + orya: [ '\u0B66', '\u0B67', '\u0B68', '\u0B69', '\u0B6A', '\u0B6B', '\u0B6C', '\u0B6D', '\u0B6E', '\u0B6F' ], + tamldec: [ '\u0BE6', '\u0BE7', '\u0BE8', '\u0BE9', '\u0BEA', '\u0BEB', '\u0BEC', '\u0BED', '\u0BEE', '\u0BEF' ], + telu: [ '\u0C66', '\u0C67', '\u0C68', '\u0C69', '\u0C6A', '\u0C6B', '\u0C6C', '\u0C6D', '\u0C6E', '\u0C6F' ], + thai: [ '\u0E50', '\u0E51', '\u0E52', '\u0E53', '\u0E54', '\u0E55', '\u0E56', '\u0E57', '\u0E58', '\u0E59' ], + tibt: [ '\u0F20', '\u0F21', '\u0F22', '\u0F23', '\u0F24', '\u0F25', '\u0F26', '\u0F27', '\u0F28', '\u0F29' ] }; - module.exports = createAction; + /** + * This function provides access to the locale and formatting options computed + * during initialization of the object. + * + * The function returns a new object whose properties and attributes are set as + * if constructed by an object literal assigning to each of the following + * properties the value of the corresponding internal property of this + * NumberFormat object (see 11.4): locale, numberingSystem, style, currency, + * currencyDisplay, minimumIntegerDigits, minimumFractionDigits, + * maximumFractionDigits, minimumSignificantDigits, maximumSignificantDigits, and + * useGrouping. Properties whose corresponding internal properties are not present + * are not assigned. + */ + /* 11.3.3 */defineProperty(Intl.NumberFormat.prototype, 'resolvedOptions', { + configurable: true, + writable: true, + value: function () { + var prop, + descs = new Record(), + props = [ + 'locale', 'numberingSystem', 'style', 'currency', 'currencyDisplay', + 'minimumIntegerDigits', 'minimumFractionDigits', 'maximumFractionDigits', + 'minimumSignificantDigits', 'maximumSignificantDigits', 'useGrouping' + ], + internal = this != null && typeof this === 'object' && getInternalProperties(this); + + // Satisfy test 11.3_b + if (!internal || !internal['[[initializedNumberFormat]]']) + throw new TypeError('`this` value for resolvedOptions() is not an initialized Intl.NumberFormat object.'); + + for (var i = 0, max = props.length; i < max; i++) { + if (hop.call(internal, prop = '[['+ props[i] +']]')) + descs[props[i]] = { value: internal[prop], writable: true, configurable: true, enumerable: true }; + } + return objCreate({}, descs); + } + }); -/***/ }, -/* 63 */ -/***/ function(module, exports, __webpack_require__) { + // 12.1 The Intl.DateTimeFormat constructor + // ================================== - var _ = __webpack_require__(70), - Reflux = __webpack_require__(57), - Keep = __webpack_require__(71), - mixer = __webpack_require__(74), - allowed = {preEmit:1,shouldEmit:1}, - bindMethods = __webpack_require__(75); + // Define the DateTimeFormat constructor internally so it cannot be tainted + function DateTimeFormatConstructor () { + var locales = arguments[0]; + var options = arguments[1]; + + if (!this || this === Intl) { + return new Intl.DateTimeFormat(locales, options); + } + return InitializeDateTimeFormat(toObject(this), locales, options); + } + + defineProperty(Intl, 'DateTimeFormat', { + configurable: true, + writable: true, + value: DateTimeFormatConstructor + }); + + // Must explicitly set prototypes as unwritable + defineProperty(DateTimeFormatConstructor, 'prototype', { + writable: false + }); /** - * Creates an event emitting Data Store. It is mixed in with functions - * from the `ListenerMethods` and `PublisherMethods` mixins. `preEmit` - * and `shouldEmit` may be overridden in the definition object. - * - * @param {Object} definition The data store object definition - * @returns {Store} A data store instance + * The abstract operation InitializeDateTimeFormat accepts the arguments dateTimeFormat + * (which must be an object), locales, and options. It initializes dateTimeFormat as a + * DateTimeFormat object. */ - module.exports = function(definition) { + function/* 12.1.1.1 */InitializeDateTimeFormat (dateTimeFormat, locales, options) { + var + // This will be a internal properties object if we're not already initialized + internal = getInternalProperties(dateTimeFormat), + + // Create an object whose props can be used to restore the values of RegExp props + regexpState = createRegExpRestore(); + + // 1. If dateTimeFormat has an [[initializedIntlObject]] internal property with + // value true, throw a TypeError exception. + if (internal['[[initializedIntlObject]]'] === true) + throw new TypeError('`this` object has already been initialized as an Intl object'); + + // Need this to access the `internal` object + defineProperty(dateTimeFormat, '__getInternalProperties', { + value: function () { + // NOTE: Non-standard, for internal use only + if (arguments[0] === secret) + return internal; + } + }); - definition = definition || {}; + // 2. Set the [[initializedIntlObject]] internal property of numberFormat to true. + internal['[[initializedIntlObject]]'] = true; - for(var a in Reflux.StoreMethods){ - if (!allowed[a] && (Reflux.PublisherMethods[a] || Reflux.ListenerMethods[a])){ - throw new Error("Cannot override API method " + a + - " in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead." - ); - } - } + var + // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList + // abstract operation (defined in 9.2.1) with argument locales. + requestedLocales = CanonicalizeLocaleList(locales), - for(var d in definition){ - if (!allowed[d] && (Reflux.PublisherMethods[d] || Reflux.ListenerMethods[d])){ - throw new Error("Cannot override API method " + d + - " in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead." - ); - } - } + // 4. Let options be the result of calling the ToDateTimeOptions abstract + // operation (defined below) with arguments options, "any", and "date". + options = ToDateTimeOptions(options, 'any', 'date'), - definition = mixer(definition); + // 5. Let opt be a new Record. + opt = new Record(); - function Store() { - var i=0, arr; - this.subscriptions = []; - this.emitter = new _.EventEmitter(); - this.eventLabel = "change"; - bindMethods(this, definition); - if (this.init && _.isFunction(this.init)) { - this.init(); - } - if (this.listenables){ - arr = [].concat(this.listenables); - for(;i < arr.length;i++){ - this.listenToMany(arr[i]); - } - } - } + // 6. Let matcher be the result of calling the GetOption abstract operation + // (defined in 9.2.9) with arguments options, "localeMatcher", "string", a List + // containing the two String values "lookup" and "best fit", and "best fit". + matcher = GetOption(options, 'localeMatcher', 'string', new List('lookup', 'best fit'), 'best fit'); - _.extend(Store.prototype, Reflux.ListenerMethods, Reflux.PublisherMethods, Reflux.StoreMethods, definition); + // 7. Set opt.[[localeMatcher]] to matcher. + opt['[[localeMatcher]]'] = matcher; - var store = new Store(); - Keep.createdStores.push(store); + var + // 8. Let DateTimeFormat be the standard built-in object that is the initial + // value of Intl.DateTimeFormat. + DateTimeFormat = internals.DateTimeFormat, // This is what we *really* need - return store; - }; + // 9. Let localeData be the value of the [[localeData]] internal property of + // DateTimeFormat. + localeData = DateTimeFormat['[[localeData]]'], + // 10. Let r be the result of calling the ResolveLocale abstract operation + // (defined in 9.2.5) with the [[availableLocales]] internal property of + // DateTimeFormat, requestedLocales, opt, the [[relevantExtensionKeys]] + // internal property of DateTimeFormat, and localeData. + r = ResolveLocale(DateTimeFormat['[[availableLocales]]'], requestedLocales, + opt, DateTimeFormat['[[relevantExtensionKeys]]'], localeData); -/***/ }, -/* 64 */ -/***/ function(module, exports, __webpack_require__) { + // 11. Set the [[locale]] internal property of dateTimeFormat to the value of + // r.[[locale]]. + internal['[[locale]]'] = r['[[locale]]']; - var Reflux = __webpack_require__(57), - _ = __webpack_require__(70); + // 12. Set the [[calendar]] internal property of dateTimeFormat to the value of + // r.[[ca]]. + internal['[[calendar]]'] = r['[[ca]]']; - module.exports = function(listenable,key){ - return { - getInitialState: function(){ - if (!_.isFunction(listenable.getInitialState)) { - return {}; - } else if (key === undefined) { - return listenable.getInitialState(); - } else { - return _.object([key],[listenable.getInitialState()]); - } - }, - componentDidMount: function(){ - _.extend(this,Reflux.ListenerMethods); - var me = this, cb = (key === undefined ? this.setState : function(v){me.setState(_.object([key],[v]));}); - this.listenTo(listenable,cb); - }, - componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount - }; - }; + // 13. Set the [[numberingSystem]] internal property of dateTimeFormat to the value of + // r.[[nu]]. + internal['[[numberingSystem]]'] = r['[[nu]]']; + // The specification doesn't tell us to do this, but it's helpful later on + internal['[[dataLocale]]'] = r['[[dataLocale]]']; -/***/ }, -/* 65 */ -/***/ function(module, exports, __webpack_require__) { + var + // 14. Let dataLocale be the value of r.[[dataLocale]]. + dataLocale = r['[[dataLocale]]'], - var Reflux = __webpack_require__(57), - _ = __webpack_require__(70); + // 15. Let tz be the result of calling the [[Get]] internal method of options with + // argument "timeZone". + tz = options.timeZone; - module.exports = function(listenable, key, filterFunc) { - filterFunc = _.isFunction(key) ? key : filterFunc; - return { - getInitialState: function() { - if (!_.isFunction(listenable.getInitialState)) { - return {}; - } else if (_.isFunction(key)) { - return filterFunc.call(this, listenable.getInitialState()); - } else { - // Filter initial payload from store. - var result = filterFunc.call(this, listenable.getInitialState()); - if (result) { - return _.object([key], [result]); - } else { - return {}; - } - } - }, - componentDidMount: function() { - _.extend(this, Reflux.ListenerMethods); - var me = this; - var cb = function(value) { - if (_.isFunction(key)) { - me.setState(filterFunc.call(me, value)); - } else { - var result = filterFunc.call(me, value); - me.setState(_.object([key], [result])); - } - }; + // 16. If tz is not undefined, then + if (tz !== undefined) { + // a. Let tz be ToString(tz). + // b. Convert tz to upper case as described in 6.1. + // NOTE: If an implementation accepts additional time zone values, as permitted + // under certain conditions by the Conformance clause, different casing + // rules apply. + tz = toLatinUpperCase(tz); - this.listenTo(listenable, cb); - }, - componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount - }; - }; + // c. If tz is not "UTC", then throw a RangeError exception. + // ###TODO: accept more time zones### + if (tz !== 'UTC') + throw new RangeError('timeZone is not supported.'); + } + // 17. Set the [[timeZone]] internal property of dateTimeFormat to tz. + internal['[[timeZone]]'] = tz; + // 18. Let opt be a new Record. + opt = new Record(); -/***/ }, -/* 66 */ -/***/ function(module, exports, __webpack_require__) { + // 19. For each row of Table 3, except the header row, do: + for (var prop in dateTimeComponents) { + if (!hop.call(dateTimeComponents, prop)) + continue; - var _ = __webpack_require__(70), - ListenerMethods = __webpack_require__(59); + var + // 20. Let prop be the name given in the Property column of the row. + // 21. Let value be the result of calling the GetOption abstract operation, + // passing as argument options, the name given in the Property column of the + // row, "string", a List containing the strings given in the Values column of + // the row, and undefined. + value = GetOption(options, prop, 'string', dateTimeComponents[prop]); + + // 22. Set opt.[[]] to value. + opt['[['+prop+']]'] = value; + } + + var + // Assigned a value below + bestFormat, + + // 23. Let dataLocaleData be the result of calling the [[Get]] internal method of + // localeData with argument dataLocale. + dataLocaleData = localeData[dataLocale], + + // 24. Let formats be the result of calling the [[Get]] internal method of + // dataLocaleData with argument "formats". + formats = dataLocaleData.formats, + // 25. Let matcher be the result of calling the GetOption abstract operation with + // arguments options, "formatMatcher", "string", a List containing the two String + // values "basic" and "best fit", and "best fit". + matcher = GetOption(options, 'formatMatcher', 'string', new List('basic', 'best fit'), 'best fit'); + + // 26. If matcher is "basic", then + if (matcher === 'basic') + // 27. Let bestFormat be the result of calling the BasicFormatMatcher abstract + // operation (defined below) with opt and formats. + bestFormat = BasicFormatMatcher(opt, formats); + + // 28. Else + else + // 29. Let bestFormat be the result of calling the BestFitFormatMatcher + // abstract operation (defined below) with opt and formats. + bestFormat = BestFitFormatMatcher(opt, formats); + + // 30. For each row in Table 3, except the header row, do + for (var prop in dateTimeComponents) { + if (!hop.call(dateTimeComponents, prop)) + continue; - /** - * A module meant to be consumed as a mixin by a React component. Supplies the methods from - * `ListenerMethods` mixin and takes care of teardown of subscriptions. - * Note that if you're using the `connect` mixin you don't need this mixin, as connect will - * import everything this mixin contains! - */ - module.exports = _.extend({ + // a. Let prop be the name given in the Property column of the row. + // b. Let pDesc be the result of calling the [[GetOwnProperty]] internal method of + // bestFormat with argument prop. + // c. If pDesc is not undefined, then + if (hop.call(bestFormat, prop)) { + var + // i. Let p be the result of calling the [[Get]] internal method of bestFormat + // with argument prop. + p = bestFormat[prop]; + + // ii. Set the [[]] internal property of dateTimeFormat to p. + internal['[['+prop+']]'] = p; + } + } - /** - * Cleans up all listener previously registered. - */ - componentWillUnmount: ListenerMethods.stopListeningToAll + var + // Assigned a value below + pattern, - }, ListenerMethods); + // 31. Let hr12 be the result of calling the GetOption abstract operation with + // arguments options, "hour12", "boolean", undefined, and undefined. + hr12 = GetOption(options, 'hour12', 'boolean'/*, undefined, undefined*/); + // 32. If dateTimeFormat has an internal property [[hour]], then + if (internal['[[hour]]']) { + // a. If hr12 is undefined, then let hr12 be the result of calling the [[Get]] + // internal method of dataLocaleData with argument "hour12". + hr12 = hr12 === undefined ? dataLocaleData.hour12 : hr12; -/***/ }, -/* 67 */ -/***/ function(module, exports, __webpack_require__) { + // b. Set the [[hour12]] internal property of dateTimeFormat to hr12. + internal['[[hour12]]'] = hr12; - var Reflux = __webpack_require__(57); + // c. If hr12 is true, then + if (hr12 === true) { + var + // i. Let hourNo0 be the result of calling the [[Get]] internal method of + // dataLocaleData with argument "hourNo0". + hourNo0 = dataLocaleData.hourNo0; + // ii. Set the [[hourNo0]] internal property of dateTimeFormat to hourNo0. + internal['[[hourNo0]]'] = hourNo0; - /** - * A mixin factory for a React component. Meant as a more convenient way of using the `ListenerMixin`, - * without having to manually set listeners in the `componentDidMount` method. - * - * @param {Action|Store} listenable An Action or Store that should be - * listened to. - * @param {Function|String} callback The callback to register as event handler - * @param {Function|String} defaultCallback The callback to register as default handler - * @returns {Object} An object to be used as a mixin, which sets up the listener for the given listenable. - */ - module.exports = function(listenable,callback,initial){ - return { - /** - * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods` - * and then make the call to `listenTo` with the arguments provided to the factory function - */ - componentDidMount: function() { - for(var m in Reflux.ListenerMethods){ - if (this[m] !== Reflux.ListenerMethods[m]){ - if (this[m]){ - throw "Can't have other property '"+m+"' when using Reflux.listenTo!"; - } - this[m] = Reflux.ListenerMethods[m]; - } - } - this.listenTo(listenable,callback,initial); - }, - /** - * Cleans up all listener previously registered. - */ - componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll - }; - }; + // iii. Let pattern be the result of calling the [[Get]] internal method of + // bestFormat with argument "pattern12". + pattern = bestFormat.pattern12; + } + // d. Else + else + // i. Let pattern be the result of calling the [[Get]] internal method of + // bestFormat with argument "pattern". + pattern = bestFormat.pattern; + } -/***/ }, -/* 68 */ -/***/ function(module, exports, __webpack_require__) { + // 33. Else + else + // a. Let pattern be the result of calling the [[Get]] internal method of + // bestFormat with argument "pattern". + pattern = bestFormat.pattern; - var Reflux = __webpack_require__(57); + // 34. Set the [[pattern]] internal property of dateTimeFormat to pattern. + internal['[[pattern]]'] = pattern; - /** - * A mixin factory for a React component. Meant as a more convenient way of using the `listenerMixin`, - * without having to manually set listeners in the `componentDidMount` method. This version is used - * to automatically set up a `listenToMany` call. - * - * @param {Object} listenables An object of listenables - * @returns {Object} An object to be used as a mixin, which sets up the listeners for the given listenables. - */ - module.exports = function(listenables){ - return { - /** - * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods` - * and then make the call to `listenTo` with the arguments provided to the factory function - */ - componentDidMount: function() { - for(var m in Reflux.ListenerMethods){ - if (this[m] !== Reflux.ListenerMethods[m]){ - if (this[m]){ - throw "Can't have other property '"+m+"' when using Reflux.listenToMany!"; - } - this[m] = Reflux.ListenerMethods[m]; - } - } - this.listenToMany(listenables); - }, - /** - * Cleans up all listener previously registered. - */ - componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll - }; - }; + // 35. Set the [[boundFormat]] internal property of dateTimeFormat to undefined. + internal['[[boundFormat]]'] = undefined; + // 36. Set the [[initializedDateTimeFormat]] internal property of dateTimeFormat to + // true. + internal['[[initializedDateTimeFormat]]'] = true; -/***/ }, -/* 69 */ -/***/ function(module, exports, __webpack_require__) { + // In ES3, we need to pre-bind the format() function + if (es3) + dateTimeFormat.format = GetFormatDateTime.call(dateTimeFormat); + + // Restore the RegExp properties + regexpState.exp.test(regexpState.input); + + // Return the newly initialised object + return dateTimeFormat; + } /** - * Internal module used to create static and instance join methods + * Several DateTimeFormat algorithms use values from the following table, which provides + * property names and allowable values for the components of date and time formats: */ + var dateTimeComponents = { + weekday: [ "narrow", "short", "long" ], + era: [ "narrow", "short", "long" ], + year: [ "2-digit", "numeric" ], + month: [ "2-digit", "numeric", "narrow", "short", "long" ], + day: [ "2-digit", "numeric" ], + hour: [ "2-digit", "numeric" ], + minute: [ "2-digit", "numeric" ], + second: [ "2-digit", "numeric" ], + timeZoneName: [ "short", "long" ] + }; - var slice = Array.prototype.slice, - _ = __webpack_require__(70), - createStore = __webpack_require__(63), - strategyMethodNames = { - strict: "joinStrict", - first: "joinLeading", - last: "joinTrailing", - all: "joinConcat" - }; + /** + * When the ToDateTimeOptions abstract operation is called with arguments options, + * required, and defaults, the following steps are taken: + */ + function ToDateTimeOptions (options, required, defaults) { + // 1. If options is undefined, then let options be null, else let options be + // ToObject(options). + if (options === undefined) + options = null; + + else { + // (#12) options needs to be a Record, but it also needs to inherit properties + var opt2 = toObject(options); + options = new Record(); + + for (var k in opt2) + options[k] = opt2[k]; + } + + var + // 2. Let create be the standard built-in function object defined in ES5, 15.2.3.5. + create = objCreate, + + // 3. Let options be the result of calling the [[Call]] internal method of create with + // undefined as the this value and an argument list containing the single item + // options. + options = create(options), + + // 4. Let needDefaults be true. + needDefaults = true; + + // 5. If required is "date" or "any", then + if (required === 'date' || required === 'any') { + // a. For each of the property names "weekday", "year", "month", "day": + // i. If the result of calling the [[Get]] internal method of options with the + // property name is not undefined, then let needDefaults be false. + if (options.weekday !== undefined || options.year !== undefined + || options.month !== undefined || options.day !== undefined) + needDefaults = false; + } + + // 6. If required is "time" or "any", then + if (required === 'time' || required === 'any') { + // a. For each of the property names "hour", "minute", "second": + // i. If the result of calling the [[Get]] internal method of options with the + // property name is not undefined, then let needDefaults be false. + if (options.hour !== undefined || options.minute !== undefined || options.second !== undefined) + needDefaults = false; + } + + // 7. If needDefaults is true and defaults is either "date" or "all", then + if (needDefaults && (defaults === 'date' || defaults === 'all')) + // a. For each of the property names "year", "month", "day": + // i. Call the [[DefineOwnProperty]] internal method of options with the + // property name, Property Descriptor {[[Value]]: "numeric", [[Writable]]: + // true, [[Enumerable]]: true, [[Configurable]]: true}, and false. + options.year = options.month = options.day = 'numeric'; + + // 8. If needDefaults is true and defaults is either "time" or "all", then + if (needDefaults && (defaults === 'time' || defaults === 'all')) + // a. For each of the property names "hour", "minute", "second": + // i. Call the [[DefineOwnProperty]] internal method of options with the + // property name, Property Descriptor {[[Value]]: "numeric", [[Writable]]: + // true, [[Enumerable]]: true, [[Configurable]]: true}, and false. + options.hour = options.minute = options.second = 'numeric'; + + // 9. Return options. + return options; + } /** - * Used in `index.js` to create the static join methods - * @param {String} strategy Which strategy to use when tracking listenable trigger arguments - * @returns {Function} A static function which returns a store with a join listen on the given listenables using the given strategy + * When the BasicFormatMatcher abstract operation is called with two arguments options and + * formats, the following steps are taken: */ - exports.staticJoinCreator = function(strategy){ - return function(/* listenables... */) { - var listenables = slice.call(arguments); - return createStore({ - init: function(){ - this[strategyMethodNames[strategy]].apply(this,listenables.concat("triggerAsync")); - } - }); - }; - }; + function BasicFormatMatcher (options, formats) { + return calculateScore(options, formats); + } /** - * Used in `ListenerMethods.js` to create the instance join methods - * @param {String} strategy Which strategy to use when tracking listenable trigger arguments - * @returns {Function} An instance method which sets up a join listen on the given listenables using the given strategy + * Calculates score for BestFitFormatMatcher and BasicFormatMatcher. + * Abstracted from BasicFormatMatcher section. */ - exports.instanceJoinCreator = function(strategy){ - return function(/* listenables..., callback*/){ - _.throwIf(arguments.length < 3,'Cannot create a join with less than 2 listenables!'); - var listenables = slice.call(arguments), - callback = listenables.pop(), - numberOfListenables = listenables.length, - join = { - numberOfListenables: numberOfListenables, - callback: this[callback]||callback, - listener: this, - strategy: strategy - }, i, cancels = [], subobj; - for (i = 0; i < numberOfListenables; i++) { - _.throwIf(this.validateListening(listenables[i])); - } - for (i = 0; i < numberOfListenables; i++) { - cancels.push(listenables[i].listen(newListener(i,join),this)); - } - reset(join); - subobj = {listenable: listenables}; - subobj.stop = makeStopper(subobj,cancels,this); - this.subscriptions = (this.subscriptions || []).concat(subobj); - return subobj; - }; - }; + function calculateScore (options, formats, bestFit) { + var + // Additional penalty type when bestFit === true + diffDataTypePenalty = 8, - // ---- internal join functions ---- + // 1. Let removalPenalty be 120. + removalPenalty = 120, - function makeStopper(subobj,cancels,context){ - return function() { - var i, subs = context.subscriptions, - index = (subs ? subs.indexOf(subobj) : -1); - _.throwIf(index === -1,'Tried to remove join already gone from subscriptions list!'); - for(i=0;i < cancels.length; i++){ - cancels[i](); - } - subs.splice(index, 1); - }; - } + // 2. Let additionPenalty be 20. + additionPenalty = 20, - function reset(join) { - join.listenablesEmitted = new Array(join.numberOfListenables); - join.args = new Array(join.numberOfListenables); - } + // 3. Let longLessPenalty be 8. + longLessPenalty = 8, - function newListener(i,join) { - return function() { - var callargs = slice.call(arguments); - if (join.listenablesEmitted[i]){ - switch(join.strategy){ - case "strict": throw new Error("Strict join failed because listener triggered twice."); - case "last": join.args[i] = callargs; break; - case "all": join.args[i].push(callargs); + // 4. Let longMorePenalty be 6. + longMorePenalty = 6, + + // 5. Let shortLessPenalty be 6. + shortLessPenalty = 6, + + // 6. Let shortMorePenalty be 3. + shortMorePenalty = 3, + + // 7. Let bestScore be -Infinity. + bestScore = -Infinity, + + // 8. Let bestFormat be undefined. + bestFormat, + + // 9. Let i be 0. + i = 0, + + // 10. Let len be the result of calling the [[Get]] internal method of formats with argument "length". + len = formats.length; + + // 11. Repeat while i < len: + while (i < len) { + var + // a. Let format be the result of calling the [[Get]] internal method of formats with argument ToString(i). + format = formats[i], + + // b. Let score be 0. + score = 0; + + // c. For each property shown in Table 3: + for (var property in dateTimeComponents) { + if (!hop.call(dateTimeComponents, property)) + continue; + + var + // i. Let optionsProp be options.[[]]. + optionsProp = options['[['+ property +']]'], + + // ii. Let formatPropDesc be the result of calling the [[GetOwnProperty]] internal method of format + // with argument property. + // iii. If formatPropDesc is not undefined, then + // 1. Let formatProp be the result of calling the [[Get]] internal method of format with argument property. + formatProp = hop.call(format, property) ? format[property] : undefined; + + // iv. If optionsProp is undefined and formatProp is not undefined, then decrease score by + // additionPenalty. + if (optionsProp === undefined && formatProp !== undefined) + score -= additionPenalty; + + // v. Else if optionsProp is not undefined and formatProp is undefined, then decrease score by + // removalPenalty. + else if (optionsProp !== undefined && formatProp === undefined) + score -= removalPenalty; + + // vi. Else + else { + var + // 1. Let values be the array ["2-digit", "numeric", "narrow", "short", + // "long"]. + values = [ '2-digit', 'numeric', 'narrow', 'short', 'long' ], + + // 2. Let optionsPropIndex be the index of optionsProp within values. + optionsPropIndex = arrIndexOf.call(values, optionsProp), + + // 3. Let formatPropIndex be the index of formatProp within values. + formatPropIndex = arrIndexOf.call(values, formatProp), + + // 4. Let delta be max(min(formatPropIndex - optionsPropIndex, 2), -2). + delta = Math.max(Math.min(formatPropIndex - optionsPropIndex, 2), -2); + + // When the bestFit argument is true, subtract additional penalty where data types are not the same + if (bestFit && ( + ((optionsProp === 'numeric' || optionsProp === '2-digit') && (formatProp !== 'numeric' && formatProp !== '2-digit')) + || ((optionsProp !== 'numeric' && optionsProp !== '2-digit') && (formatProp === '2-digit' || formatProp === 'numeric')) + )) + score -= diffDataTypePenalty; + + // 5. If delta = 2, decrease score by longMorePenalty. + if (delta === 2) + score -= longMorePenalty; + + // 6. Else if delta = 1, decrease score by shortMorePenalty. + else if (delta === 1) + score -= shortMorePenalty; + + // 7. Else if delta = -1, decrease score by shortLessPenalty. + else if (delta === -1) + score -= shortLessPenalty; + + // 8. Else if delta = -2, decrease score by longLessPenalty. + else if (delta === -2) + score -= longLessPenalty; } - } else { - join.listenablesEmitted[i] = true; - join.args[i] = (join.strategy==="all"?[callargs]:callargs); } - emitIfAllListenablesEmitted(join); - }; - } - function emitIfAllListenablesEmitted(join) { - for (var i = 0; i < join.numberOfListenables; i++) { - if (!join.listenablesEmitted[i]) { - return; + // d. If score > bestScore, then + if (score > bestScore) { + // i. Let bestScore be score. + bestScore = score; + + // ii. Let bestFormat be format. + bestFormat = format; } + + // e. Increase i by 1. + i++; } - join.callback.apply(join.listener,join.args); - reset(join); + + // 12. Return bestFormat. + return bestFormat; } + /** + * When the BestFitFormatMatcher abstract operation is called with two arguments options + * and formats, it performs implementation dependent steps, which should return a set of + * component representations that a typical user of the selected locale would perceive as + * at least as good as the one returned by BasicFormatMatcher. + * + * This polyfill defines the algorithm to be the same as BasicFormatMatcher, + * with the addition of bonus points awarded where the requested format is of + * the same data type as the potentially matching format. + * + * For example, + * + * { month: 'numeric', day: 'numeric' } + * + * should match + * + * { month: '2-digit', day: '2-digit' } + * + * rather than + * + * { month: 'short', day: 'numeric' } + * + * This makes sense because a user requesting a formatted date with numeric parts would + * not expect to see the returned format containing narrow, short or long part names + */ + function BestFitFormatMatcher (options, formats) { + return calculateScore(options, formats, true); + } -/***/ }, -/* 70 */ -/***/ function(module, exports, __webpack_require__) { + /* 12.2.3 */internals.DateTimeFormat = { + '[[availableLocales]]': [], + '[[relevantExtensionKeys]]': ['ca', 'nu'], + '[[localeData]]': {} + }; - /* - * isObject, extend, isFunction, isArguments are taken from undescore/lodash in - * order to remove the dependency + /** + * When the supportedLocalesOf method of Intl.DateTimeFormat is called, the + * following steps are taken: */ - var isObject = exports.isObject = function(obj) { - var type = typeof obj; - return type === 'function' || type === 'object' && !!obj; - }; + /* 12.2.2 */defineProperty(Intl.DateTimeFormat, 'supportedLocalesOf', { + configurable: true, + writable: true, + value: fnBind.call(supportedLocalesOf, internals.DateTimeFormat) + }); - exports.extend = function(obj) { - if (!isObject(obj)) { - return obj; - } - var source, prop; - for (var i = 1, length = arguments.length; i < length; i++) { - source = arguments[i]; - for (prop in source) { - if (Object.getOwnPropertyDescriptor && Object.defineProperty) { - var propertyDescriptor = Object.getOwnPropertyDescriptor(source, prop); - Object.defineProperty(obj, prop, propertyDescriptor); - } else { - obj[prop] = source[prop]; + /** + * This named accessor property returns a function that formats a number + * according to the effective locale and the formatting options of this + * DateTimeFormat object. + */ + /* 12.3.2 */defineProperty(Intl.DateTimeFormat.prototype, 'format', { + configurable: true, + get: GetFormatDateTime + }); + + function GetFormatDateTime() { + var internal = this != null && typeof this === 'object' && getInternalProperties(this); + + // Satisfy test 12.3_b + if (!internal || !internal['[[initializedDateTimeFormat]]']) + throw new TypeError('`this` value for format() is not an initialized Intl.DateTimeFormat object.'); + + // The value of the [[Get]] attribute is a function that takes the following + // steps: + + // 1. If the [[boundFormat]] internal property of this DateTimeFormat object + // is undefined, then: + if (internal['[[boundFormat]]'] === undefined) { + var + // a. Let F be a Function object, with internal properties set as + // specified for built-in functions in ES5, 15, or successor, and the + // length property set to 0, that takes the argument date and + // performs the following steps: + F = function () { + // i. If date is not provided or is undefined, then let x be the + // result as if by the expression Date.now() where Date.now is + // the standard built-in function defined in ES5, 15.9.4.4. + // ii. Else let x be ToNumber(date). + // iii. Return the result of calling the FormatDateTime abstract + // operation (defined below) with arguments this and x. + var x = Number(arguments.length === 0 ? Date.now() : arguments[0]); + return FormatDateTime(this, x); + }, + // b. Let bind be the standard built-in function object defined in ES5, + // 15.3.4.5. + // c. Let bf be the result of calling the [[Call]] internal method of + // bind with F as the this value and an argument list containing + // the single item this. + bf = fnBind.call(F, this); + // d. Set the [[boundFormat]] internal property of this NumberFormat + // object to bf. + internal['[[boundFormat]]'] = bf; + } + // Return the value of the [[boundFormat]] internal property of this + // NumberFormat object. + return internal['[[boundFormat]]']; + } + + /** + * When the FormatDateTime abstract operation is called with arguments dateTimeFormat + * (which must be an object initialized as a DateTimeFormat) and x (which must be a Number + * value), it returns a String value representing x (interpreted as a time value as + * specified in ES5, 15.9.1.1) according to the effective locale and the formatting + * options of dateTimeFormat. + */ + function FormatDateTime(dateTimeFormat, x) { + // 1. If x is not a finite Number, then throw a RangeError exception. + if (!isFinite(x)) + throw new RangeError('Invalid valid date passed to format'); + + var + internal = dateTimeFormat.__getInternalProperties(secret), + + // Creating restore point for properties on the RegExp object... please wait + regexpState = createRegExpRestore(), + + // 2. Let locale be the value of the [[locale]] internal property of dateTimeFormat. + locale = internal['[[locale]]'], + + // 3. Let nf be the result of creating a new NumberFormat object as if by the + // expression new Intl.NumberFormat([locale], {useGrouping: false}) where + // Intl.NumberFormat is the standard built-in constructor defined in 11.1.3. + nf = new Intl.NumberFormat([locale], {useGrouping: false}), + + // 4. Let nf2 be the result of creating a new NumberFormat object as if by the + // expression new Intl.NumberFormat([locale], {minimumIntegerDigits: 2, useGrouping: + // false}) where Intl.NumberFormat is the standard built-in constructor defined in + // 11.1.3. + nf2 = new Intl.NumberFormat([locale], {minimumIntegerDigits: 2, useGrouping: false}), + + // 5. Let tm be the result of calling the ToLocalTime abstract operation (defined + // below) with x, the value of the [[calendar]] internal property of dateTimeFormat, + // and the value of the [[timeZone]] internal property of dateTimeFormat. + tm = ToLocalTime(x, internal['[[calendar]]'], internal['[[timeZone]]']), + + // 6. Let result be the value of the [[pattern]] internal property of dateTimeFormat. + result = internal['[[pattern]]'], + + // Need the locale minus any extensions + dataLocale = internal['[[dataLocale]]'], + + // Need the calendar data from CLDR + localeData = internals.DateTimeFormat['[[localeData]]'][dataLocale].calendars, + ca = internal['[[calendar]]']; + + // 7. For each row of Table 3, except the header row, do: + for (var p in dateTimeComponents) { + // a. If dateTimeFormat has an internal property with the name given in the + // Property column of the row, then: + if (hop.call(internal, '[['+ p +']]')) { + var + // Assigned values below + pm, fv, + + // i. Let p be the name given in the Property column of the row. + // ii. Let f be the value of the [[

]] internal property of dateTimeFormat. + f = internal['[['+ p +']]'], + + // iii. Let v be the value of tm.[[

]]. + v = tm['[['+ p +']]']; + + // iv. If p is "year" and v ≤ 0, then let v be 1 - v. + if (p === 'year' && v <= 0) + v = 1 - v; + + // v. If p is "month", then increase v by 1. + else if (p === 'month') + v++; + + // vi. If p is "hour" and the value of the [[hour12]] internal property of + // dateTimeFormat is true, then + else if (p === 'hour' && internal['[[hour12]]'] === true) { + // 1. Let v be v modulo 12. + v = v % 12; + + // 2. If v is equal to the value of tm.[[

]], then let pm be false; else + // let pm be true. + pm = v !== tm['[['+ p +']]']; + + // 3. If v is 0 and the value of the [[hourNo0]] internal property of + // dateTimeFormat is true, then let v be 12. + if (v === 0 && internal['[[hourNo0]]'] === true) + v = 12; + } + + // vii. If f is "numeric", then + if (f === 'numeric') + // 1. Let fv be the result of calling the FormatNumber abstract operation + // (defined in 11.3.2) with arguments nf and v. + fv = FormatNumber(nf, v); + + // viii. Else if f is "2-digit", then + else if (f === '2-digit') { + // 1. Let fv be the result of calling the FormatNumber abstract operation + // with arguments nf2 and v. + fv = FormatNumber(nf2, v); + + // 2. If the length of fv is greater than 2, let fv be the substring of fv + // containing the last two characters. + if (fv.length > 2) + fv = fv.slice(-2); } + + // ix. Else if f is "narrow", "short", or "long", then let fv be a String + // value representing f in the desired form; the String value depends upon + // the implementation and the effective locale and calendar of + // dateTimeFormat. If p is "month", then the String value may also depend + // on whether dateTimeFormat has a [[day]] internal property. If p is + // "timeZoneName", then the String value may also depend on the value of + // the [[inDST]] field of tm. + else if (f in dateWidths) { + switch (p) { + case 'month': + fv = resolveDateString(localeData, ca, 'months', f, tm['[['+ p +']]']); + break; + + case 'weekday': + try { + fv = resolveDateString(localeData, ca, 'days', f, tm['[['+ p +']]']); + // fv = resolveDateString(ca.days, f)[tm['[['+ p +']]']]; + } catch (e) { + throw new Error('Could not find weekday data for locale '+locale); + } + break; + + case 'timeZoneName': + fv = ''; // TODO + break; + + // TODO: Era + default: + fv = tm['[['+ p +']]']; + } + } + + // x. Replace the substring of result that consists of "{", p, and "}", with + // fv. + result = result.replace('{'+ p +'}', fv); } } - return obj; - }; + // 8. If dateTimeFormat has an internal property [[hour12]] whose value is true, then + if (internal['[[hour12]]'] === true) { + // a. If pm is true, then let fv be an implementation and locale dependent String + // value representing “post meridiem”; else let fv be an implementation and + // locale dependent String value representing “ante meridiem”. + fv = resolveDateString(localeData, ca, 'dayPeriods', pm ? 'pm' : 'am'); - exports.isFunction = function(value) { - return typeof value === 'function'; - }; + // b. Replace the substring of result that consists of "{ampm}", with fv. + result = result.replace('{ampm}', fv); + } - exports.EventEmitter = __webpack_require__(76); + // Restore properties of the RegExp object + regexpState.exp.test(regexpState.input); - exports.nextTick = function(callback) { - setTimeout(callback, 0); - }; + // 9. Return result. + return result; + } - exports.capitalize = function(string){ - return string.charAt(0).toUpperCase()+string.slice(1); - }; + /** + * When the ToLocalTime abstract operation is called with arguments date, calendar, and + * timeZone, the following steps are taken: + */ + function ToLocalTime(date, calendar, timeZone) { + // 1. Apply calendrical calculations on date for the given calendar and time zone to + // produce weekday, era, year, month, day, hour, minute, second, and inDST values. + // The calculations should use best available information about the specified + // calendar and time zone. If the calendar is "gregory", then the calculations must + // match the algorithms specified in ES5, 15.9.1, except that calculations are not + // bound by the restrictions on the use of best available information on time zones + // for local time zone adjustment and daylight saving time adjustment imposed by + // ES5, 15.9.1.7 and 15.9.1.8. + // ###TODO### + var d = new Date(date), + m = 'get' + (timeZone || ''); + + // 2. Return a Record with fields [[weekday]], [[era]], [[year]], [[month]], [[day]], + // [[hour]], [[minute]], [[second]], and [[inDST]], each with the corresponding + // calculated value. + return new Record({ + '[[weekday]]': d[m + 'Day'](), + '[[era]]' : +(d[m + 'FullYear']() >= 0), + '[[year]]' : d[m + 'FullYear'](), + '[[month]]' : d[m + 'Month'](), + '[[day]]' : d[m + 'Date'](), + '[[hour]]' : d[m + 'Hours'](), + '[[minute]]' : d[m + 'Minutes'](), + '[[second]]' : d[m + 'Seconds'](), + '[[inDST]]' : false // ###TODO### + }); + } - exports.callbackName = function(string){ - return "on"+exports.capitalize(string); - }; + /** + * The function returns a new object whose properties and attributes are set as if + * constructed by an object literal assigning to each of the following properties the + * value of the corresponding internal property of this DateTimeFormat object (see 12.4): + * locale, calendar, numberingSystem, timeZone, hour12, weekday, era, year, month, day, + * hour, minute, second, and timeZoneName. Properties whose corresponding internal + * properties are not present are not assigned. + */ + /* 12.3.3 */defineProperty(Intl.DateTimeFormat.prototype, 'resolvedOptions', { + writable: true, + configurable: true, + value: function () { + var prop, + descs = new Record(), + props = [ + 'locale', 'calendar', 'numberingSystem', 'timeZone', 'hour12', 'weekday', + 'era', 'year', 'month', 'day', 'hour', 'minute', 'second', 'timeZoneName' + ], + internal = this != null && typeof this === 'object' && getInternalProperties(this); + + // Satisfy test 12.3_b + if (!internal || !internal['[[initializedDateTimeFormat]]']) + throw new TypeError('`this` value for resolvedOptions() is not an initialized Intl.DateTimeFormat object.'); + + for (var i = 0, max = props.length; i < max; i++) { + if (hop.call(internal, prop = '[[' + props[i] + ']]')) + descs[props[i]] = { value: internal[prop], writable: true, configurable: true, enumerable: true }; + } - exports.object = function(keys,vals){ - var o={}, i=0; - for(;i 2 && parts[1].length == 4) + arrPush.call(locales, parts[0] + '-' + parts[2]); + + while (locale = arrShift.call(locales)) { + // Add to NumberFormat internal properties as per 11.2.3 + arrPush.call(internals.NumberFormat['[[availableLocales]]'], locale); + internals.NumberFormat['[[localeData]]'][locale] = data.number; + + // ...and DateTimeFormat internal properties as per 12.2.3 + if (data.date) { + data.date.nu = data.number.nu; + arrPush.call(internals.DateTimeFormat['[[availableLocales]]'], locale); + internals.DateTimeFormat['[[localeData]]'][locale] = data.date; + } } - while(exports.createdActions.length) { - exports.createdActions.pop(); + + // If this is the first set of locale data added, make it the default + if (defaultLocale === undefined) + defaultLocale = tag; + + // 11.3 (the NumberFormat prototype object is an Intl.NumberFormat instance) + if (!numberFormatProtoInitialised) { + InitializeNumberFormat(Intl.NumberFormat.prototype); + numberFormatProtoInitialised = true; } - }; + // 11.3 (the NumberFormat prototype object is an Intl.NumberFormat instance) + if (data.date && !dateTimeFormatProtoInitialised) { + InitializeDateTimeFormat(Intl.DateTimeFormat.prototype); + dateTimeFormatProtoInitialised = true; + } + } -/***/ }, -/* 72 */ -/***/ function(module, exports, __webpack_require__) { + // Helper functions + // ================ - /** - * Expose `Emitter`. + * A function to deal with the inaccuracy of calculating log10 in pre-ES6 + * JavaScript environments. Math.log(num) / Math.LN10 was responsible for + * causing issue #62. */ + function log10Floor (n) { + // ES6 provides the more accurate Math.log10 + if (typeof Math.log10 === 'function') + return Math.floor(Math.log10(n)); - module.exports = Emitter; + var x = Math.round(Math.log(n) * Math.LOG10E); + return x - (Number('1e' + x) > n); + } /** - * Initialize a new `Emitter`. - * - * @api public + * A merge of the Intl.{Constructor}.supportedLocalesOf functions + * To make life easier, the function should be bound to the constructor's internal + * properties object. */ + function supportedLocalesOf(locales) { + /*jshint validthis:true */ - function Emitter(obj) { - if (obj) return mixin(obj); - }; + // Bound functions only have the `this` value altered if being used as a constructor, + // this lets us imitate a native function that has no constructor + if (!hop.call(this, '[[availableLocales]]')) + throw new TypeError('supportedLocalesOf() is not a constructor'); + + var + // Create an object whose props can be used to restore the values of RegExp props + regexpState = createRegExpRestore(), + + // 1. If options is not provided, then let options be undefined. + options = arguments[1], + + // 2. Let availableLocales be the value of the [[availableLocales]] internal + // property of the standard built-in object that is the initial value of + // Intl.NumberFormat. + + availableLocales = this['[[availableLocales]]'], + + // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList + // abstract operation (defined in 9.2.1) with argument locales. + requestedLocales = CanonicalizeLocaleList(locales); + + // Restore the RegExp properties + regexpState.exp.test(regexpState.input); + + // 4. Return the result of calling the SupportedLocales abstract operation + // (defined in 9.2.8) with arguments availableLocales, requestedLocales, + // and options. + return SupportedLocales(availableLocales, requestedLocales, options); + } /** - * Mixin the emitter properties. - * - * @param {Object} obj - * @return {Object} - * @api private + * Returns a string for a date component, resolved using multiple inheritance as specified + * as specified in the Unicode Technical Standard 35. */ + function resolveDateString(data, ca, component, width, key) { + // From http://www.unicode.org/reports/tr35/tr35.html#Multiple_Inheritance: + // 'In clearly specified instances, resources may inherit from within the same locale. + // For example, ... the Buddhist calendar inherits from the Gregorian calendar.' + var obj = data[ca] && data[ca][component] + ? data[ca][component] + : data.gregory[component], + + // "sideways" inheritance resolves strings when a key doesn't exist + alts = { + narrow: ['short', 'long'], + short: ['long', 'narrow'], + long: ['short', 'narrow'] + }, - function mixin(obj) { - for (var key in Emitter.prototype) { - obj[key] = Emitter.prototype[key]; - } - return obj; + // + resolved = hop.call(obj, width) + ? obj[width] + : hop.call(obj, alts[width][0]) + ? obj[alts[width][0]] + : obj[alts[width][1]]; + + // `key` wouldn't be specified for components 'dayPeriods' + return key != null ? resolved[key] : resolved; } /** - * Listen on the given `event` with `fn`. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public + * A map that doesn't contain Object in its prototype chain */ - - Emitter.prototype.on = - Emitter.prototype.addEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - (this._callbacks[event] = this._callbacks[event] || []) - .push(fn); - return this; - }; + Record.prototype = objCreate(null); + function Record (obj) { + // Copy only own properties over unless this object is already a Record instance + for (var k in obj) { + if (obj instanceof Record || hop.call(obj, k)) + defineProperty(this, k, { value: obj[k], enumerable: true, writable: true, configurable: true }); + } + } /** - * Adds an `event` listener that will be invoked a single - * time then automatically removed. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public + * An ordered list */ + List.prototype = objCreate(null); + function List() { + defineProperty(this, 'length', { writable:true, value: 0 }); - Emitter.prototype.once = function(event, fn){ - var self = this; - this._callbacks = this._callbacks || {}; - - function on() { - self.off(event, on); - fn.apply(this, arguments); - } - - on.fn = fn; - this.on(event, on); - return this; - }; + if (arguments.length) + arrPush.apply(this, arrSlice.call(arguments)); + } /** - * Remove the given callback for `event` or all - * registered callbacks. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public + * Constructs a regular expression to restore tainted RegExp properties */ + function createRegExpRestore () { + var esc = /[.?*+^$[\]\\(){}|-]/g, + lm = RegExp.lastMatch, + ml = RegExp.multiline ? 'm' : '', + ret = { input: RegExp.input }, + reg = new List(), + has = false, + cap = {}; + + // Create a snapshot of all the 'captured' properties + for (var i = 1; i <= 9; i++) + has = (cap['$'+i] = RegExp['$'+i]) || has; + + // Now we've snapshotted some properties, escape the lastMatch string + lm = lm.replace(esc, '\\$&'); + + // If any of the captured strings were non-empty, iterate over them all + if (has) { + for (var i = 1; i <= 9; i++) { + var m = cap['$'+i]; + + // If it's empty, add an empty capturing group + if (!m) + lm = '()' + lm; + + // Else find the string in lm and escape & wrap it to capture it + else { + m = m.replace(esc, '\\$&'); + lm = lm.replace(m, '(' + m + ')'); + } - Emitter.prototype.off = - Emitter.prototype.removeListener = - Emitter.prototype.removeAllListeners = - Emitter.prototype.removeEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - - // all - if (0 == arguments.length) { - this._callbacks = {}; - return this; - } - - // specific event - var callbacks = this._callbacks[event]; - if (!callbacks) return this; + // Push it to the reg and chop lm to make sure further groups come after + arrPush.call(reg, lm.slice(0, lm.indexOf('(') + 1)); + lm = lm.slice(lm.indexOf('(') + 1); + } + } - // remove all handlers - if (1 == arguments.length) { - delete this._callbacks[event]; - return this; - } + // Create the regular expression that will reconstruct the RegExp properties + ret.exp = new RegExp(arrJoin.call(reg, '') + lm, ml); - // remove specific handler - var cb; - for (var i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - if (cb === fn || cb.fn === fn) { - callbacks.splice(i, 1); - break; - } - } - return this; - }; + return ret; + } /** - * Emit `event` with the given args. - * - * @param {String} event - * @param {Mixed} ... - * @return {Emitter} + * Convert only a-z to uppercase as per section 6.1 of the spec */ + function toLatinUpperCase (str) { + var i = str.length; - Emitter.prototype.emit = function(event){ - this._callbacks = this._callbacks || {}; - var args = [].slice.call(arguments, 1) - , callbacks = this._callbacks[event]; + while (i--) { + var ch = str.charAt(i); - if (callbacks) { - callbacks = callbacks.slice(0); - for (var i = 0, len = callbacks.length; i < len; ++i) { - callbacks[i].apply(this, args); + if (ch >= "a" && ch <= "z") + str = str.slice(0, i) + ch.toUpperCase() + str.slice(i+1); } - } - return this; - }; + return str; + } /** - * Return array of callbacks for `event`. - * - * @param {String} event - * @return {Array} - * @api public + * Mimics ES5's abstract ToObject() function */ + function toObject (arg) { + if (arg == null) + throw new TypeError('Cannot convert null or undefined to object'); - Emitter.prototype.listeners = function(event){ - this._callbacks = this._callbacks || {}; - return this._callbacks[event] || []; - }; + return Object(arg); + } /** - * Check if this emitter has `event` handlers. - * - * @param {String} event - * @return {Boolean} - * @api public + * Returns "internal" properties for an object */ + function getInternalProperties (obj) { + if (hop.call(obj, '__getInternalProperties')) + return obj.__getInternalProperties(secret); + else + return objCreate(null); + } - Emitter.prototype.hasListeners = function(event){ - return !! this.listeners(event).length; - }; + return Intl; + }); + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 73 */ +/* 64 */ /***/ function(module, exports, __webpack_require__) { - - /** - * Reduce `arr` with `fn`. - * - * @param {Array} arr - * @param {Function} fn - * @param {Mixed} initial - * - * TODO: combatible error handling? - */ + exports.ActionMethods = __webpack_require__(69); - module.exports = function(arr, fn, initial){ - var idx = 0; - var len = arr.length; - var curr = arguments.length == 3 - ? initial - : arr[idx++]; + exports.ListenerMethods = __webpack_require__(70); - while (idx < len) { - curr = fn.call(null, curr, arr[idx], ++idx, arr); - } - - return curr; - }; + exports.PublisherMethods = __webpack_require__(71); -/***/ }, -/* 74 */ -/***/ function(module, exports, __webpack_require__) { + exports.StoreMethods = __webpack_require__(72); - var _ = __webpack_require__(70); + exports.createAction = __webpack_require__(73); - module.exports = function mix(def) { - var composed = { - init: [], - preEmit: [], - shouldEmit: [] - }; + exports.createStore = __webpack_require__(74); - var updated = (function mixDef(mixin) { - var mixed = {}; - if (mixin.mixins) { - mixin.mixins.forEach(function (subMixin) { - _.extend(mixed, mixDef(subMixin)); - }); - } - _.extend(mixed, mixin); - Object.keys(composed).forEach(function (composable) { - if (mixin.hasOwnProperty(composable)) { - composed[composable].push(mixin[composable]); - } - }); - return mixed; - }(def)); + exports.connect = __webpack_require__(75); - if (composed.init.length > 1) { - updated.init = function () { - var args = arguments; - composed.init.forEach(function (init) { - init.apply(this, args); - }, this); - }; - } - if (composed.preEmit.length > 1) { - updated.preEmit = function () { - return composed.preEmit.reduce(function (args, preEmit) { - var newValue = preEmit.apply(this, args); - return newValue === undefined ? args : [newValue]; - }.bind(this), arguments); - }; - } - if (composed.shouldEmit.length > 1) { - updated.shouldEmit = function () { - var args = arguments; - return !composed.shouldEmit.some(function (shouldEmit) { - return !shouldEmit.apply(this, args); - }, this); - }; - } - Object.keys(composed).forEach(function (composable) { - if (composed[composable].length === 1) { - updated[composable] = composed[composable][0]; - } - }); + exports.connectFilter = __webpack_require__(76); - return updated; - }; + exports.ListenerMixin = __webpack_require__(77); + exports.listenTo = __webpack_require__(78); -/***/ }, -/* 75 */ -/***/ function(module, exports, __webpack_require__) { + exports.listenToMany = __webpack_require__(79); - module.exports = function(store, definition) { - for (var name in definition) { - if (Object.getOwnPropertyDescriptor && Object.defineProperty) { - var propertyDescriptor = Object.getOwnPropertyDescriptor(definition, name); - if (!propertyDescriptor.value || typeof propertyDescriptor.value !== 'function' || !definition.hasOwnProperty(name)) { - continue; - } + var maker = __webpack_require__(80).staticJoinCreator; - store[name] = definition[name].bind(store); - } else { - var property = definition[name]; + exports.joinTrailing = exports.all = maker("last"); // Reflux.all alias for backward compatibility - if (typeof property !== 'function' || !definition.hasOwnProperty(name)) { - continue; - } + exports.joinLeading = maker("first"); - store[name] = property.bind(store); - } - } + exports.joinStrict = maker("strict"); - return store; - }; + exports.joinConcat = maker("all"); + var _ = __webpack_require__(81); -/***/ }, -/* 76 */ -/***/ function(module, exports, __webpack_require__) { + exports.EventEmitter = _.EventEmitter; - 'use strict'; + exports.Promise = _.Promise; /** - * Representation of a single EventEmitter function. + * Convenience function for creating a set of actions * - * @param {Function} fn Event handler to be called. - * @param {Mixed} context Context for function execution. - * @param {Boolean} once Only emit once - * @api private + * @param definitions the definitions for the actions to be created + * @returns an object with actions of corresponding action names */ - function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; - } + exports.createActions = function(definitions) { + var actions = {}; + for (var k in definitions){ + if (definitions.hasOwnProperty(k)) { + var val = definitions[k], + actionName = _.isObject(val) ? k : val; - /** - * Minimal EventEmitter interface that is molded against the Node.js - * EventEmitter interface. - * - * @constructor - * @api public - */ - function EventEmitter() { /* Nothing to set */ } + actions[actionName] = exports.createAction(val); + } + } + return actions; + }; /** - * Holds the assigned EventEmitters by name. - * - * @type {Object} - * @private + * Sets the eventmitter that Reflux uses */ - EventEmitter.prototype._events = undefined; + exports.setEventEmitter = function(ctx) { + var _ = __webpack_require__(81); + exports.EventEmitter = _.EventEmitter = ctx; + }; + /** - * Return a list of assigned event listeners. - * - * @param {String} event The events that should be listed. - * @returns {Array} - * @api public + * Sets the Promise library that Reflux uses */ - EventEmitter.prototype.listeners = function listeners(event) { - if (!this._events || !this._events[event]) return []; - if (this._events[event].fn) return [this._events[event].fn]; + exports.setPromise = function(ctx) { + var _ = __webpack_require__(81); + exports.Promise = _.Promise = ctx; + }; - for (var i = 0, l = this._events[event].length, ee = new Array(l); i < l; i++) { - ee[i] = this._events[event][i].fn; - } - return ee; + /** + * Sets the Promise factory that creates new promises + * @param {Function} factory has the signature `function(resolver) { return [new Promise]; }` + */ + exports.setPromiseFactory = function(factory) { + var _ = __webpack_require__(81); + _.createPromise = factory; }; + /** - * Emit an event to all registered event listeners. - * - * @param {String} event The name of the event. - * @returns {Boolean} Indication if we've emitted an event. - * @api public + * Sets the method used for deferring actions and stores */ - EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - if (!this._events || !this._events[event]) return false; + exports.nextTick = function(nextTick) { + var _ = __webpack_require__(81); + _.nextTick = nextTick; + }; - var listeners = this._events[event] - , len = arguments.length - , args - , i; + /** + * Provides the set of created actions and stores for introspection + */ + exports.__keep = __webpack_require__(82); - if ('function' === typeof listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, true); + /** + * Warn if Function.prototype.bind not available + */ + if (!Function.prototype.bind) { + console.error( + 'Function.prototype.bind not available. ' + + 'ES5 shim required. ' + + 'https://github.com/spoike/refluxjs#es5' + ); + } - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } +/***/ }, +/* 65 */ +/***/ function(module, exports, __webpack_require__) { - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; + module.exports = { + "locale": "en-US", + "date": { + "ca": [ + "gregory", + "buddhist", + "chinese", + "coptic", + "ethioaa", + "ethiopic", + "generic", + "hebrew", + "indian", + "islamic", + "japanese", + "persian", + "roc" + ], + "hourNo0": true, + "hour12": true, + "formats": [ + { + "weekday": "long", + "month": "long", + "day": "numeric", + "year": "numeric", + "hour": "numeric", + "minute": "2-digit", + "second": "2-digit", + "pattern": "{weekday}, {month} {day}, {year}, {hour}:{minute}:{second}", + "pattern12": "{weekday}, {month} {day}, {year}, {hour}:{minute}:{second} {ampm}" + }, + { + "weekday": "long", + "month": "long", + "day": "numeric", + "year": "numeric", + "pattern": "{weekday}, {month} {day}, {year}" + }, + { + "month": "long", + "day": "numeric", + "year": "numeric", + "pattern": "{month} {day}, {year}" + }, + { + "month": "numeric", + "day": "numeric", + "year": "numeric", + "pattern": "{month}/{day}/{year}" + }, + { + "month": "numeric", + "year": "numeric", + "pattern": "{month}/{year}" + }, + { + "month": "long", + "year": "numeric", + "pattern": "{month} {year}" + }, + { + "month": "long", + "day": "numeric", + "pattern": "{month} {day}" + }, + { + "month": "numeric", + "day": "numeric", + "pattern": "{month}/{day}" + }, + { + "hour": "numeric", + "minute": "2-digit", + "second": "2-digit", + "pattern": "{hour}:{minute}:{second}", + "pattern12": "{hour}:{minute}:{second} {ampm}" + }, + { + "hour": "numeric", + "minute": "2-digit", + "pattern": "{hour}:{minute}", + "pattern12": "{hour}:{minute} {ampm}" + } + ], + "calendars": { + "buddhist": { + "eras": { + "short": [ + "BE" + ] + } + }, + "chinese": { + "months": { + "short": [ + "Mo1", + "Mo2", + "Mo3", + "Mo4", + "Mo5", + "Mo6", + "Mo7", + "Mo8", + "Mo9", + "Mo10", + "Mo11", + "Mo12" + ], + "long": [ + "Month1", + "Month2", + "Month3", + "Month4", + "Month5", + "Month6", + "Month7", + "Month8", + "Month9", + "Month10", + "Month11", + "Month12" + ] + } + }, + "coptic": { + "months": { + "long": [ + "Tout", + "Baba", + "Hator", + "Kiahk", + "Toba", + "Amshir", + "Baramhat", + "Baramouda", + "Bashans", + "Paona", + "Epep", + "Mesra", + "Nasie" + ] + }, + "eras": { + "short": [ + "ERA0", + "ERA1" + ] + } + }, + "ethiopic": { + "months": { + "long": [ + "Meskerem", + "Tekemt", + "Hedar", + "Tahsas", + "Ter", + "Yekatit", + "Megabit", + "Miazia", + "Genbot", + "Sene", + "Hamle", + "Nehasse", + "Pagumen" + ] + }, + "eras": { + "short": [ + "ERA0", + "ERA1" + ] + } + }, + "ethioaa": { + "eras": { + "short": [ + "ERA0" + ] + } + }, + "generic": { + "months": { + "long": [ + "M01", + "M02", + "M03", + "M04", + "M05", + "M06", + "M07", + "M08", + "M09", + "M10", + "M11", + "M12" + ] + }, + "eras": { + "short": [ + "ERA0", + "ERA1" + ] + } + }, + "gregory": { + "months": { + "short": [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + "long": [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ] + }, + "days": { + "narrow": [ + "Su", + "Mo", + "Tu", + "We", + "Th", + "Fr", + "Sa" + ], + "short": [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ], + "long": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ] + }, + "eras": { + "narrow": [ + "B", + "A" + ], + "short": [ + "BC", + "AD", + "BCE", + "CE" + ], + "long": [ + "Before Christ", + "Anno Domini", + "Before Common Era", + "Common Era" + ] + }, + "dayPeriods": { + "am": "AM", + "pm": "PM" + } + }, + "hebrew": { + "months": { + "long": [ + "Tishri", + "Heshvan", + "Kislev", + "Tevet", + "Shevat", + "Adar I", + "Adar", + "Nisan", + "Iyar", + "Sivan", + "Tamuz", + "Av", + "Elul", + "Adar II" + ] + }, + "eras": { + "short": [ + "AM" + ] + } + }, + "indian": { + "months": { + "long": [ + "Chaitra", + "Vaisakha", + "Jyaistha", + "Asadha", + "Sravana", + "Bhadra", + "Asvina", + "Kartika", + "Agrahayana", + "Pausa", + "Magha", + "Phalguna" + ] + }, + "eras": { + "short": [ + "Saka" + ] + } + }, + "islamic": { + "months": { + "short": [ + "Muh.", + "Saf.", + "Rab. I", + "Rab. II", + "Jum. I", + "Jum. II", + "Raj.", + "Sha.", + "Ram.", + "Shaw.", + "Dhuʻl-Q.", + "Dhuʻl-H." + ], + "long": [ + "Muharram", + "Safar", + "Rabiʻ I", + "Rabiʻ II", + "Jumada I", + "Jumada II", + "Rajab", + "Shaʻban", + "Ramadan", + "Shawwal", + "Dhuʻl-Qiʻdah", + "Dhuʻl-Hijjah" + ] + }, + "eras": { + "short": [ + "AH" + ] + } + }, + "japanese": { + "eras": { + "narrow": [ + "Taika (645-650)", + "Hakuchi (650-671)", + "Hakuhō (672-686)", + "Shuchō (686-701)", + "Taihō (701-704)", + "Keiun (704-708)", + "Wadō (708-715)", + "Reiki (715-717)", + "Yōrō (717-724)", + "Jinki (724-729)", + "Tempyō (729-749)", + "Tempyō-kampō (749-749)", + "Tempyō-shōhō (749-757)", + "Tempyō-hōji (757-765)", + "Temphō-jingo (765-767)", + "Jingo-keiun (767-770)", + "Hōki (770-780)", + "Ten-ō (781-782)", + "Enryaku (782-806)", + "Daidō (806-810)", + "Kōnin (810-824)", + "Tenchō (824-834)", + "Jōwa (834-848)", + "Kajō (848-851)", + "Ninju (851-854)", + "Saiko (854-857)", + "Tennan (857-859)", + "Jōgan (859-877)", + "Genkei (877-885)", + "Ninna (885-889)", + "Kampyō (889-898)", + "Shōtai (898-901)", + "Engi (901-923)", + "Enchō (923-931)", + "Shōhei (931-938)", + "Tengyō (938-947)", + "Tenryaku (947-957)", + "Tentoku (957-961)", + "Ōwa (961-964)", + "Kōhō (964-968)", + "Anna (968-970)", + "Tenroku (970-973)", + "Ten-en (973-976)", + "Jōgen (976-978)", + "Tengen (978-983)", + "Eikan (983-985)", + "Kanna (985-987)", + "Ei-en (987-989)", + "Eiso (989-990)", + "Shōryaku (990-995)", + "Chōtoku (995-999)", + "Chōhō (999-1004)", + "Kankō (1004-1012)", + "Chōwa (1012-1017)", + "Kannin (1017-1021)", + "Jian (1021-1024)", + "Manju (1024-1028)", + "Chōgen (1028-1037)", + "Chōryaku (1037-1040)", + "Chōkyū (1040-1044)", + "Kantoku (1044-1046)", + "Eishō (1046-1053)", + "Tengi (1053-1058)", + "Kōhei (1058-1065)", + "Jiryaku (1065-1069)", + "Enkyū (1069-1074)", + "Shōho (1074-1077)", + "Shōryaku (1077-1081)", + "Eiho (1081-1084)", + "Ōtoku (1084-1087)", + "Kanji (1087-1094)", + "Kaho (1094-1096)", + "Eichō (1096-1097)", + "Shōtoku (1097-1099)", + "Kōwa (1099-1104)", + "Chōji (1104-1106)", + "Kashō (1106-1108)", + "Tennin (1108-1110)", + "Ten-ei (1110-1113)", + "Eikyū (1113-1118)", + "Gen-ei (1118-1120)", + "Hoan (1120-1124)", + "Tenji (1124-1126)", + "Daiji (1126-1131)", + "Tenshō (1131-1132)", + "Chōshō (1132-1135)", + "Hoen (1135-1141)", + "Eiji (1141-1142)", + "Kōji (1142-1144)", + "Tenyō (1144-1145)", + "Kyūan (1145-1151)", + "Ninpei (1151-1154)", + "Kyūju (1154-1156)", + "Hogen (1156-1159)", + "Heiji (1159-1160)", + "Eiryaku (1160-1161)", + "Ōho (1161-1163)", + "Chōkan (1163-1165)", + "Eiman (1165-1166)", + "Nin-an (1166-1169)", + "Kaō (1169-1171)", + "Shōan (1171-1175)", + "Angen (1175-1177)", + "Jishō (1177-1181)", + "Yōwa (1181-1182)", + "Juei (1182-1184)", + "Genryuku (1184-1185)", + "Bunji (1185-1190)", + "Kenkyū (1190-1199)", + "Shōji (1199-1201)", + "Kennin (1201-1204)", + "Genkyū (1204-1206)", + "Ken-ei (1206-1207)", + "Shōgen (1207-1211)", + "Kenryaku (1211-1213)", + "Kenpō (1213-1219)", + "Shōkyū (1219-1222)", + "Jōō (1222-1224)", + "Gennin (1224-1225)", + "Karoku (1225-1227)", + "Antei (1227-1229)", + "Kanki (1229-1232)", + "Jōei (1232-1233)", + "Tempuku (1233-1234)", + "Bunryaku (1234-1235)", + "Katei (1235-1238)", + "Ryakunin (1238-1239)", + "En-ō (1239-1240)", + "Ninji (1240-1243)", + "Kangen (1243-1247)", + "Hōji (1247-1249)", + "Kenchō (1249-1256)", + "Kōgen (1256-1257)", + "Shōka (1257-1259)", + "Shōgen (1259-1260)", + "Bun-ō (1260-1261)", + "Kōchō (1261-1264)", + "Bun-ei (1264-1275)", + "Kenji (1275-1278)", + "Kōan (1278-1288)", + "Shōō (1288-1293)", + "Einin (1293-1299)", + "Shōan (1299-1302)", + "Kengen (1302-1303)", + "Kagen (1303-1306)", + "Tokuji (1306-1308)", + "Enkei (1308-1311)", + "Ōchō (1311-1312)", + "Shōwa (1312-1317)", + "Bunpō (1317-1319)", + "Genō (1319-1321)", + "Genkyō (1321-1324)", + "Shōchū (1324-1326)", + "Kareki (1326-1329)", + "Gentoku (1329-1331)", + "Genkō (1331-1334)", + "Kemmu (1334-1336)", + "Engen (1336-1340)", + "Kōkoku (1340-1346)", + "Shōhei (1346-1370)", + "Kentoku (1370-1372)", + "Bunchũ (1372-1375)", + "Tenju (1375-1379)", + "Kōryaku (1379-1381)", + "Kōwa (1381-1384)", + "Genchũ (1384-1392)", + "Meitoku (1384-1387)", + "Kakei (1387-1389)", + "Kōō (1389-1390)", + "Meitoku (1390-1394)", + "Ōei (1394-1428)", + "Shōchō (1428-1429)", + "Eikyō (1429-1441)", + "Kakitsu (1441-1444)", + "Bun-an (1444-1449)", + "Hōtoku (1449-1452)", + "Kyōtoku (1452-1455)", + "Kōshō (1455-1457)", + "Chōroku (1457-1460)", + "Kanshō (1460-1466)", + "Bunshō (1466-1467)", + "Ōnin (1467-1469)", + "Bunmei (1469-1487)", + "Chōkyō (1487-1489)", + "Entoku (1489-1492)", + "Meiō (1492-1501)", + "Bunki (1501-1504)", + "Eishō (1504-1521)", + "Taiei (1521-1528)", + "Kyōroku (1528-1532)", + "Tenmon (1532-1555)", + "Kōji (1555-1558)", + "Eiroku (1558-1570)", + "Genki (1570-1573)", + "Tenshō (1573-1592)", + "Bunroku (1592-1596)", + "Keichō (1596-1615)", + "Genwa (1615-1624)", + "Kan-ei (1624-1644)", + "Shōho (1644-1648)", + "Keian (1648-1652)", + "Shōō (1652-1655)", + "Meiryaku (1655-1658)", + "Manji (1658-1661)", + "Kanbun (1661-1673)", + "Enpō (1673-1681)", + "Tenwa (1681-1684)", + "Jōkyō (1684-1688)", + "Genroku (1688-1704)", + "Hōei (1704-1711)", + "Shōtoku (1711-1716)", + "Kyōhō (1716-1736)", + "Genbun (1736-1741)", + "Kanpō (1741-1744)", + "Enkyō (1744-1748)", + "Kan-en (1748-1751)", + "Hōryaku (1751-1764)", + "Meiwa (1764-1772)", + "An-ei (1772-1781)", + "Tenmei (1781-1789)", + "Kansei (1789-1801)", + "Kyōwa (1801-1804)", + "Bunka (1804-1818)", + "Bunsei (1818-1830)", + "Tenpō (1830-1844)", + "Kōka (1844-1848)", + "Kaei (1848-1854)", + "Ansei (1854-1860)", + "Man-en (1860-1861)", + "Bunkyū (1861-1864)", + "Genji (1864-1865)", + "Keiō (1865-1868)", + "M", + "T", + "S", + "H" + ], + "short": [ + "Taika (645-650)", + "Hakuchi (650-671)", + "Hakuhō (672-686)", + "Shuchō (686-701)", + "Taihō (701-704)", + "Keiun (704-708)", + "Wadō (708-715)", + "Reiki (715-717)", + "Yōrō (717-724)", + "Jinki (724-729)", + "Tempyō (729-749)", + "Tempyō-kampō (749-749)", + "Tempyō-shōhō (749-757)", + "Tempyō-hōji (757-765)", + "Temphō-jingo (765-767)", + "Jingo-keiun (767-770)", + "Hōki (770-780)", + "Ten-ō (781-782)", + "Enryaku (782-806)", + "Daidō (806-810)", + "Kōnin (810-824)", + "Tenchō (824-834)", + "Jōwa (834-848)", + "Kajō (848-851)", + "Ninju (851-854)", + "Saiko (854-857)", + "Tennan (857-859)", + "Jōgan (859-877)", + "Genkei (877-885)", + "Ninna (885-889)", + "Kampyō (889-898)", + "Shōtai (898-901)", + "Engi (901-923)", + "Enchō (923-931)", + "Shōhei (931-938)", + "Tengyō (938-947)", + "Tenryaku (947-957)", + "Tentoku (957-961)", + "Ōwa (961-964)", + "Kōhō (964-968)", + "Anna (968-970)", + "Tenroku (970-973)", + "Ten-en (973-976)", + "Jōgen (976-978)", + "Tengen (978-983)", + "Eikan (983-985)", + "Kanna (985-987)", + "Ei-en (987-989)", + "Eiso (989-990)", + "Shōryaku (990-995)", + "Chōtoku (995-999)", + "Chōhō (999-1004)", + "Kankō (1004-1012)", + "Chōwa (1012-1017)", + "Kannin (1017-1021)", + "Jian (1021-1024)", + "Manju (1024-1028)", + "Chōgen (1028-1037)", + "Chōryaku (1037-1040)", + "Chōkyū (1040-1044)", + "Kantoku (1044-1046)", + "Eishō (1046-1053)", + "Tengi (1053-1058)", + "Kōhei (1058-1065)", + "Jiryaku (1065-1069)", + "Enkyū (1069-1074)", + "Shōho (1074-1077)", + "Shōryaku (1077-1081)", + "Eiho (1081-1084)", + "Ōtoku (1084-1087)", + "Kanji (1087-1094)", + "Kaho (1094-1096)", + "Eichō (1096-1097)", + "Shōtoku (1097-1099)", + "Kōwa (1099-1104)", + "Chōji (1104-1106)", + "Kashō (1106-1108)", + "Tennin (1108-1110)", + "Ten-ei (1110-1113)", + "Eikyū (1113-1118)", + "Gen-ei (1118-1120)", + "Hoan (1120-1124)", + "Tenji (1124-1126)", + "Daiji (1126-1131)", + "Tenshō (1131-1132)", + "Chōshō (1132-1135)", + "Hoen (1135-1141)", + "Eiji (1141-1142)", + "Kōji (1142-1144)", + "Tenyō (1144-1145)", + "Kyūan (1145-1151)", + "Ninpei (1151-1154)", + "Kyūju (1154-1156)", + "Hogen (1156-1159)", + "Heiji (1159-1160)", + "Eiryaku (1160-1161)", + "Ōho (1161-1163)", + "Chōkan (1163-1165)", + "Eiman (1165-1166)", + "Nin-an (1166-1169)", + "Kaō (1169-1171)", + "Shōan (1171-1175)", + "Angen (1175-1177)", + "Jishō (1177-1181)", + "Yōwa (1181-1182)", + "Juei (1182-1184)", + "Genryuku (1184-1185)", + "Bunji (1185-1190)", + "Kenkyū (1190-1199)", + "Shōji (1199-1201)", + "Kennin (1201-1204)", + "Genkyū (1204-1206)", + "Ken-ei (1206-1207)", + "Shōgen (1207-1211)", + "Kenryaku (1211-1213)", + "Kenpō (1213-1219)", + "Shōkyū (1219-1222)", + "Jōō (1222-1224)", + "Gennin (1224-1225)", + "Karoku (1225-1227)", + "Antei (1227-1229)", + "Kanki (1229-1232)", + "Jōei (1232-1233)", + "Tempuku (1233-1234)", + "Bunryaku (1234-1235)", + "Katei (1235-1238)", + "Ryakunin (1238-1239)", + "En-ō (1239-1240)", + "Ninji (1240-1243)", + "Kangen (1243-1247)", + "Hōji (1247-1249)", + "Kenchō (1249-1256)", + "Kōgen (1256-1257)", + "Shōka (1257-1259)", + "Shōgen (1259-1260)", + "Bun-ō (1260-1261)", + "Kōchō (1261-1264)", + "Bun-ei (1264-1275)", + "Kenji (1275-1278)", + "Kōan (1278-1288)", + "Shōō (1288-1293)", + "Einin (1293-1299)", + "Shōan (1299-1302)", + "Kengen (1302-1303)", + "Kagen (1303-1306)", + "Tokuji (1306-1308)", + "Enkei (1308-1311)", + "Ōchō (1311-1312)", + "Shōwa (1312-1317)", + "Bunpō (1317-1319)", + "Genō (1319-1321)", + "Genkyō (1321-1324)", + "Shōchū (1324-1326)", + "Kareki (1326-1329)", + "Gentoku (1329-1331)", + "Genkō (1331-1334)", + "Kemmu (1334-1336)", + "Engen (1336-1340)", + "Kōkoku (1340-1346)", + "Shōhei (1346-1370)", + "Kentoku (1370-1372)", + "Bunchū (1372-1375)", + "Tenju (1375-1379)", + "Kōryaku (1379-1381)", + "Kōwa (1381-1384)", + "Genchū (1384-1392)", + "Meitoku (1384-1387)", + "Kakei (1387-1389)", + "Kōō (1389-1390)", + "Meitoku (1390-1394)", + "Ōei (1394-1428)", + "Shōchō (1428-1429)", + "Eikyō (1429-1441)", + "Kakitsu (1441-1444)", + "Bun-an (1444-1449)", + "Hōtoku (1449-1452)", + "Kyōtoku (1452-1455)", + "Kōshō (1455-1457)", + "Chōroku (1457-1460)", + "Kanshō (1460-1466)", + "Bunshō (1466-1467)", + "Ōnin (1467-1469)", + "Bunmei (1469-1487)", + "Chōkyō (1487-1489)", + "Entoku (1489-1492)", + "Meiō (1492-1501)", + "Bunki (1501-1504)", + "Eishō (1504-1521)", + "Taiei (1521-1528)", + "Kyōroku (1528-1532)", + "Tenmon (1532-1555)", + "Kōji (1555-1558)", + "Eiroku (1558-1570)", + "Genki (1570-1573)", + "Tenshō (1573-1592)", + "Bunroku (1592-1596)", + "Keichō (1596-1615)", + "Genwa (1615-1624)", + "Kan-ei (1624-1644)", + "Shōho (1644-1648)", + "Keian (1648-1652)", + "Shōō (1652-1655)", + "Meiryaku (1655-1658)", + "Manji (1658-1661)", + "Kanbun (1661-1673)", + "Enpō (1673-1681)", + "Tenwa (1681-1684)", + "Jōkyō (1684-1688)", + "Genroku (1688-1704)", + "Hōei (1704-1711)", + "Shōtoku (1711-1716)", + "Kyōhō (1716-1736)", + "Genbun (1736-1741)", + "Kanpō (1741-1744)", + "Enkyō (1744-1748)", + "Kan-en (1748-1751)", + "Hōryaku (1751-1764)", + "Meiwa (1764-1772)", + "An-ei (1772-1781)", + "Tenmei (1781-1789)", + "Kansei (1789-1801)", + "Kyōwa (1801-1804)", + "Bunka (1804-1818)", + "Bunsei (1818-1830)", + "Tenpō (1830-1844)", + "Kōka (1844-1848)", + "Kaei (1848-1854)", + "Ansei (1854-1860)", + "Man-en (1860-1861)", + "Bunkyū (1861-1864)", + "Genji (1864-1865)", + "Keiō (1865-1868)", + "Meiji", + "Taishō", + "Shōwa", + "Heisei" + ] + } + }, + "persian": { + "months": { + "long": [ + "Farvardin", + "Ordibehesht", + "Khordad", + "Tir", + "Mordad", + "Shahrivar", + "Mehr", + "Aban", + "Azar", + "Dey", + "Bahman", + "Esfand" + ] + }, + "eras": { + "short": [ + "AP" + ] + } + }, + "roc": { + "eras": { + "short": [ + "Before R.O.C.", + "Minguo" + ] + } + } + } + }, + "number": { + "nu": [ + "latn" + ], + "patterns": { + "decimal": { + "positivePattern": "{number}", + "negativePattern": "-{number}" + }, + "currency": { + "positivePattern": "{currency}{number}", + "negativePattern": "-{currency}{number}" + }, + "percent": { + "positivePattern": "{number}%", + "negativePattern": "-{number}%" + } + }, + "symbols": { + "latn": { + "decimal": ".", + "group": ",", + "nan": "NaN", + "percent": "%", + "infinity": "∞" + } + }, + "currencies": { + "AUD": "A$", + "BRL": "R$", + "CAD": "CA$", + "CNY": "CN¥", + "EUR": "€", + "GBP": "£", + "HKD": "HK$", + "ILS": "₪", + "INR": "₹", + "JPY": "¥", + "KRW": "₩", + "MXN": "MX$", + "NZD": "NZ$", + "THB": "฿", + "TWD": "NT$", + "USD": "$", + "VND": "₫", + "XAF": "FCFA", + "XCD": "EC$", + "XOF": "CFA", + "XPF": "CFPF" + } + } + } - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, true); +/***/ }, +/* 66 */ +/***/ function(module, exports, __webpack_require__) { - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } + module.exports = { + "locale": "pt-BR", + "date": { + "ca": [ + "gregory", + "buddhist", + "chinese", + "coptic", + "ethioaa", + "ethiopic", + "generic", + "hebrew", + "indian", + "islamic", + "japanese", + "persian", + "roc" + ], + "hourNo0": true, + "hour12": false, + "formats": [ + { + "weekday": "long", + "day": "numeric", + "month": "long", + "year": "numeric", + "hour": "numeric", + "minute": "2-digit", + "second": "2-digit", + "pattern": "{weekday}, {day} de {month} de {year} {hour}:{minute}:{second}", + "pattern12": "{weekday}, {day} de {month} de {year} {hour}:{minute}:{second} {ampm}" + }, + { + "weekday": "long", + "day": "numeric", + "month": "long", + "year": "numeric", + "pattern": "{weekday}, {day} de {month} de {year}" + }, + { + "day": "numeric", + "month": "long", + "year": "numeric", + "pattern": "{day} de {month} de {year}" + }, + { + "day": "2-digit", + "month": "2-digit", + "year": "numeric", + "pattern": "{day}/{month}/{year}" + }, + { + "month": "2-digit", + "year": "numeric", + "pattern": "{month}/{year}" + }, + { + "month": "long", + "year": "numeric", + "pattern": "{month} de {year}" + }, + { + "day": "numeric", + "month": "long", + "pattern": "{day} de {month}" + }, + { + "day": "numeric", + "month": "numeric", + "pattern": "{day}/{month}" + }, + { + "hour": "numeric", + "minute": "2-digit", + "second": "2-digit", + "pattern": "{hour}:{minute}:{second}", + "pattern12": "{hour}:{minute}:{second} {ampm}" + }, + { + "hour": "numeric", + "minute": "2-digit", + "pattern": "{hour}:{minute}", + "pattern12": "{hour}:{minute} {ampm}" + } + ], + "calendars": { + "buddhist": { + "eras": { + "short": [ + "BE" + ] + } + }, + "chinese": { + "months": { + "narrow": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12" + ], + "short": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12" + ], + "long": [ + "Mês 1", + "Mês 2", + "Mês 3", + "Mês 4", + "Mês 5", + "Mês 6", + "Mês 7", + "Mês 8", + "Mês 9", + "Mês 10", + "Mês 11", + "Mês 12" + ] + } + }, + "coptic": { + "months": { + "narrow": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ], + "short": [ + "Tout", + "Baba", + "Hator", + "Kiahk", + "Toba", + "Amshir", + "Baramhat", + "Baramouda", + "Bashans", + "Paona", + "Epep", + "Mesra", + "Nasie" + ], + "long": [ + "Tout", + "Baba", + "Hator", + "Kiahk", + "Toba", + "Amshir", + "Baramhat", + "Baramouda", + "Bashans", + "Paona", + "Epep", + "Mesra", + "Nasie" + ] + }, + "eras": { + "short": [ + "ERA0", + "ERA1" + ] + } + }, + "ethiopic": { + "months": { + "narrow": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ], + "short": [ + "Meskerem", + "Tekemt", + "Hedar", + "Tahsas", + "Ter", + "Yekatit", + "Megabit", + "Miazia", + "Genbot", + "Sene", + "Hamle", + "Nehasse", + "Pagumen" + ], + "long": [ + "Meskerem", + "Tekemt", + "Hedar", + "Tahsas", + "Ter", + "Yekatit", + "Megabit", + "Miazia", + "Genbot", + "Sene", + "Hamle", + "Nehasse", + "Pagumen" + ] + }, + "eras": { + "short": [ + "ERA0", + "ERA1" + ] + } + }, + "ethioaa": { + "eras": { + "short": [ + "ERA0" + ] + } + }, + "generic": { + "months": { + "long": [ + "M01", + "M02", + "M03", + "M04", + "M05", + "M06", + "M07", + "M08", + "M09", + "M10", + "M11", + "M12" + ] + }, + "eras": { + "short": [ + "ERA0", + "ERA1" + ] + } + }, + "gregory": { + "months": { + "narrow": [ + "J", + "F", + "M", + "A", + "M", + "J", + "J", + "A", + "S", + "O", + "N", + "D" + ], + "short": [ + "jan", + "fev", + "mar", + "abr", + "mai", + "jun", + "jul", + "ago", + "set", + "out", + "nov", + "dez" + ], + "long": [ + "janeiro", + "fevereiro", + "março", + "abril", + "maio", + "junho", + "julho", + "agosto", + "setembro", + "outubro", + "novembro", + "dezembro" + ] + }, + "days": { + "narrow": [ + "dom", + "seg", + "ter", + "qua", + "qui", + "sex", + "sáb" + ], + "short": [ + "dom", + "seg", + "ter", + "qua", + "qui", + "sex", + "sáb" + ], + "long": [ + "domingo", + "segunda-feira", + "terça-feira", + "quarta-feira", + "quinta-feira", + "sexta-feira", + "sábado" + ] + }, + "eras": { + "short": [ + "a.C.", + "d.C." + ], + "long": [ + "Antes de Cristo", + "Ano do Senhor" + ] + }, + "dayPeriods": { + "am": "AM", + "pm": "PM" + } + }, + "hebrew": { + "months": { + "short": [ + "Tishri", + "Heshvan", + "Kislev", + "Tevet", + "Shevat", + "Adar I", + "Adar", + "Nisan", + "Iyar", + "Sivan", + "Tamuz", + "Av", + "Elul", + "Adar II" + ], + "long": [ + "Tishri", + "Heshvan", + "Kislev", + "Tevet", + "Shevat", + "Adar I", + "Adar", + "Nisan", + "Iyar", + "Sivan", + "Tamuz", + "Av", + "Elul", + "Adar II" + ] + }, + "eras": { + "short": [ + "AM" + ] + } + }, + "indian": { + "months": { + "narrow": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12" + ], + "short": [ + "Chaitra", + "Vaisakha", + "Jyaistha", + "Asadha", + "Sravana", + "Bhadra", + "Asvina", + "Kartika", + "Agrahayana", + "Pausa", + "Magha", + "Phalguna" + ], + "long": [ + "Chaitra", + "Vaisakha", + "Jyaistha", + "Asadha", + "Sravana", + "Bhadra", + "Asvina", + "Kartika", + "Agrahayana", + "Pausa", + "Magha", + "Phalguna" + ] + }, + "eras": { + "short": [ + "Saka" + ] + } + }, + "islamic": { + "months": { + "short": [ + "Muh.", + "Saf.", + "Rab. I", + "Rab. II", + "Jum. I", + "Jum. II", + "Raj.", + "Sha.", + "Ram.", + "Shaw.", + "Dhuʻl-Q.", + "Dhuʻl-H." + ], + "long": [ + "Muharram", + "Safar", + "Rabiʻ I", + "Rabiʻ II", + "Jumada I", + "Jumada II", + "Rajab", + "Shaʻban", + "Ramadan", + "Shawwal", + "Dhuʻl-Qiʻdah", + "Dhuʻl-Hijjah" + ] + }, + "eras": { + "short": [ + "AH" + ] + } + }, + "japanese": { + "eras": { + "narrow": [ + "Taika (645-650)", + "Hakuchi (650-671)", + "Hakuhō (672-686)", + "Shuchō (686-701)", + "Taihō (701-704)", + "Keiun (704-708)", + "Wadō (708-715)", + "Reiki (715-717)", + "Yōrō (717-724)", + "Jinki (724-729)", + "Tempyō (729-749)", + "Tempyō-kampō (749-749)", + "Tempyō-shōhō (749-757)", + "Tempyō-hōji (757-765)", + "Temphō-jingo (765-767)", + "Jingo-keiun (767-770)", + "Hōki (770-780)", + "Ten-ō (781-782)", + "Enryaku (782-806)", + "Daidō (806-810)", + "Kōnin (810-824)", + "Tenchō (824-834)", + "Jōwa (834-848)", + "Kajō (848-851)", + "Ninju (851-854)", + "Saiko (854-857)", + "Tennan (857-859)", + "Jōgan (859-877)", + "Genkei (877-885)", + "Ninna (885-889)", + "Kampyō (889-898)", + "Shōtai (898-901)", + "Engi (901-923)", + "Enchō (923-931)", + "Shōhei (931-938)", + "Tengyō (938-947)", + "Tenryaku (947-957)", + "Tentoku (957-961)", + "Ōwa (961-964)", + "Kōhō (964-968)", + "Anna (968-970)", + "Tenroku (970-973)", + "Ten-en (973-976)", + "Jōgen (976-978)", + "Tengen (978-983)", + "Eikan (983-985)", + "Kanna (985-987)", + "Ei-en (987-989)", + "Eiso (989-990)", + "Shōryaku (990-995)", + "Chōtoku (995-999)", + "Chōhō (999-1004)", + "Kankō (1004-1012)", + "Chōwa (1012-1017)", + "Kannin (1017-1021)", + "Jian (1021-1024)", + "Manju (1024-1028)", + "Chōgen (1028-1037)", + "Chōryaku (1037-1040)", + "Chōkyū (1040-1044)", + "Kantoku (1044-1046)", + "Eishō (1046-1053)", + "Tengi (1053-1058)", + "Kōhei (1058-1065)", + "Jiryaku (1065-1069)", + "Enkyū (1069-1074)", + "Shōho (1074-1077)", + "Shōryaku (1077-1081)", + "Eiho (1081-1084)", + "Ōtoku (1084-1087)", + "Kanji (1087-1094)", + "Kaho (1094-1096)", + "Eichō (1096-1097)", + "Shōtoku (1097-1099)", + "Kōwa (1099-1104)", + "Chōji (1104-1106)", + "Kashō (1106-1108)", + "Tennin (1108-1110)", + "Ten-ei (1110-1113)", + "Eikyū (1113-1118)", + "Gen-ei (1118-1120)", + "Hoan (1120-1124)", + "Tenji (1124-1126)", + "Daiji (1126-1131)", + "Tenshō (1131-1132)", + "Chōshō (1132-1135)", + "Hoen (1135-1141)", + "Eiji (1141-1142)", + "Kōji (1142-1144)", + "Tenyō (1144-1145)", + "Kyūan (1145-1151)", + "Ninpei (1151-1154)", + "Kyūju (1154-1156)", + "Hogen (1156-1159)", + "Heiji (1159-1160)", + "Eiryaku (1160-1161)", + "Ōho (1161-1163)", + "Chōkan (1163-1165)", + "Eiman (1165-1166)", + "Nin-an (1166-1169)", + "Kaō (1169-1171)", + "Shōan (1171-1175)", + "Angen (1175-1177)", + "Jishō (1177-1181)", + "Yōwa (1181-1182)", + "Juei (1182-1184)", + "Genryuku (1184-1185)", + "Bunji (1185-1190)", + "Kenkyū (1190-1199)", + "Shōji (1199-1201)", + "Kennin (1201-1204)", + "Genkyū (1204-1206)", + "Ken-ei (1206-1207)", + "Shōgen (1207-1211)", + "Kenryaku (1211-1213)", + "Kenpō (1213-1219)", + "Shōkyū (1219-1222)", + "Jōō (1222-1224)", + "Gennin (1224-1225)", + "Karoku (1225-1227)", + "Antei (1227-1229)", + "Kanki (1229-1232)", + "Jōei (1232-1233)", + "Tempuku (1233-1234)", + "Bunryaku (1234-1235)", + "Katei (1235-1238)", + "Ryakunin (1238-1239)", + "En-ō (1239-1240)", + "Ninji (1240-1243)", + "Kangen (1243-1247)", + "Hōji (1247-1249)", + "Kenchō (1249-1256)", + "Kōgen (1256-1257)", + "Shōka (1257-1259)", + "Shōgen (1259-1260)", + "Bun-ō (1260-1261)", + "Kōchō (1261-1264)", + "Bun-ei (1264-1275)", + "Kenji (1275-1278)", + "Kōan (1278-1288)", + "Shōō (1288-1293)", + "Einin (1293-1299)", + "Shōan (1299-1302)", + "Kengen (1302-1303)", + "Kagen (1303-1306)", + "Tokuji (1306-1308)", + "Enkei (1308-1311)", + "Ōchō (1311-1312)", + "Shōwa (1312-1317)", + "Bunpō (1317-1319)", + "Genō (1319-1321)", + "Genkyō (1321-1324)", + "Shōchū (1324-1326)", + "Kareki (1326-1329)", + "Gentoku (1329-1331)", + "Genkō (1331-1334)", + "Kemmu (1334-1336)", + "Engen (1336-1340)", + "Kōkoku (1340-1346)", + "Shōhei (1346-1370)", + "Kentoku (1370-1372)", + "Bunchũ (1372-1375)", + "Tenju (1375-1379)", + "Kōryaku (1379-1381)", + "Kōwa (1381-1384)", + "Genchũ (1384-1392)", + "Meitoku (1384-1387)", + "Kakei (1387-1389)", + "Kōō (1389-1390)", + "Meitoku (1390-1394)", + "Ōei (1394-1428)", + "Shōchō (1428-1429)", + "Eikyō (1429-1441)", + "Kakitsu (1441-1444)", + "Bun-an (1444-1449)", + "Hōtoku (1449-1452)", + "Kyōtoku (1452-1455)", + "Kōshō (1455-1457)", + "Chōroku (1457-1460)", + "Kanshō (1460-1466)", + "Bunshō (1466-1467)", + "Ōnin (1467-1469)", + "Bunmei (1469-1487)", + "Chōkyō (1487-1489)", + "Entoku (1489-1492)", + "Meiō (1492-1501)", + "Bunki (1501-1504)", + "Eishō (1504-1521)", + "Taiei (1521-1528)", + "Kyōroku (1528-1532)", + "Tenmon (1532-1555)", + "Kōji (1555-1558)", + "Eiroku (1558-1570)", + "Genki (1570-1573)", + "Tenshō (1573-1592)", + "Bunroku (1592-1596)", + "Keichō (1596-1615)", + "Genwa (1615-1624)", + "Kan-ei (1624-1644)", + "Shōho (1644-1648)", + "Keian (1648-1652)", + "Shōō (1652-1655)", + "Meiryaku (1655-1658)", + "Manji (1658-1661)", + "Kanbun (1661-1673)", + "Enpō (1673-1681)", + "Tenwa (1681-1684)", + "Jōkyō (1684-1688)", + "Genroku (1688-1704)", + "Hōei (1704-1711)", + "Shōtoku (1711-1716)", + "Kyōhō (1716-1736)", + "Genbun (1736-1741)", + "Kanpō (1741-1744)", + "Enkyō (1744-1748)", + "Kan-en (1748-1751)", + "Hōryaku (1751-1764)", + "Meiwa (1764-1772)", + "An-ei (1772-1781)", + "Tenmei (1781-1789)", + "Kansei (1789-1801)", + "Kyōwa (1801-1804)", + "Bunka (1804-1818)", + "Bunsei (1818-1830)", + "Tenpō (1830-1844)", + "Kōka (1844-1848)", + "Kaei (1848-1854)", + "Ansei (1854-1860)", + "Man-en (1860-1861)", + "Bunkyū (1861-1864)", + "Genji (1864-1865)", + "Keiō (1865-1868)", + "M", + "T", + "S", + "H" + ], + "short": [ + "Taika (645-650)", + "Hakuchi (650-671)", + "Hakuhō (672-686)", + "Shuchō (686-701)", + "Taihō (701-704)", + "Keiun (704-708)", + "Wadō (708-715)", + "Reiki (715-717)", + "Yōrō (717-724)", + "Jinki (724-729)", + "Tempyō (729-749)", + "Tempyō-kampō (749-749)", + "Tempyō-shōhō (749-757)", + "Tempyō-hōji (757-765)", + "Temphō-jingo (765-767)", + "Jingo-keiun (767-770)", + "Hōki (770-780)", + "Ten-ō (781-782)", + "Enryaku (782-806)", + "Daidō (806-810)", + "Kōnin (810-824)", + "Tenchō (824-834)", + "Jōwa (834-848)", + "Kajō (848-851)", + "Ninju (851-854)", + "Saiko (854-857)", + "Tennan (857-859)", + "Jōgan (859-877)", + "Genkei (877-885)", + "Ninna (885-889)", + "Kampyō (889-898)", + "Shōtai (898-901)", + "Engi (901-923)", + "Enchō (923-931)", + "Shōhei (931-938)", + "Tengyō (938-947)", + "Tenryaku (947-957)", + "Tentoku (957-961)", + "Ōwa (961-964)", + "Kōhō (964-968)", + "Anna (968-970)", + "Tenroku (970-973)", + "Ten-en (973-976)", + "Jōgen (976-978)", + "Tengen (978-983)", + "Eikan (983-985)", + "Kanna (985-987)", + "Ei-en (987-989)", + "Eiso (989-990)", + "Shōryaku (990-995)", + "Chōtoku (995-999)", + "Chōhō (999-1004)", + "Kankō (1004-1012)", + "Chōwa (1012-1017)", + "Kannin (1017-1021)", + "Jian (1021-1024)", + "Manju (1024-1028)", + "Chōgen (1028-1037)", + "Chōryaku (1037-1040)", + "Chōkyū (1040-1044)", + "Kantoku (1044-1046)", + "Eishō (1046-1053)", + "Tengi (1053-1058)", + "Kōhei (1058-1065)", + "Jiryaku (1065-1069)", + "Enkyū (1069-1074)", + "Shōho (1074-1077)", + "Shōryaku (1077-1081)", + "Eiho (1081-1084)", + "Ōtoku (1084-1087)", + "Kanji (1087-1094)", + "Kaho (1094-1096)", + "Eichō (1096-1097)", + "Shōtoku (1097-1099)", + "Kōwa (1099-1104)", + "Chōji (1104-1106)", + "Kashō (1106-1108)", + "Tennin (1108-1110)", + "Ten-ei (1110-1113)", + "Eikyū (1113-1118)", + "Gen-ei (1118-1120)", + "Hoan (1120-1124)", + "Tenji (1124-1126)", + "Daiji (1126-1131)", + "Tenshō (1131-1132)", + "Chōshō (1132-1135)", + "Hoen (1135-1141)", + "Eiji (1141-1142)", + "Kōji (1142-1144)", + "Tenyō (1144-1145)", + "Kyūan (1145-1151)", + "Ninpei (1151-1154)", + "Kyūju (1154-1156)", + "Hogen (1156-1159)", + "Heiji (1159-1160)", + "Eiryaku (1160-1161)", + "Ōho (1161-1163)", + "Chōkan (1163-1165)", + "Eiman (1165-1166)", + "Nin-an (1166-1169)", + "Kaō (1169-1171)", + "Shōan (1171-1175)", + "Angen (1175-1177)", + "Jishō (1177-1181)", + "Yōwa (1181-1182)", + "Juei (1182-1184)", + "Genryuku (1184-1185)", + "Bunji (1185-1190)", + "Kenkyū (1190-1199)", + "Shōji (1199-1201)", + "Kennin (1201-1204)", + "Genkyū (1204-1206)", + "Ken-ei (1206-1207)", + "Shōgen (1207-1211)", + "Kenryaku (1211-1213)", + "Kenpō (1213-1219)", + "Shōkyū (1219-1222)", + "Jōō (1222-1224)", + "Gennin (1224-1225)", + "Karoku (1225-1227)", + "Antei (1227-1229)", + "Kanki (1229-1232)", + "Jōei (1232-1233)", + "Tempuku (1233-1234)", + "Bunryaku (1234-1235)", + "Katei (1235-1238)", + "Ryakunin (1238-1239)", + "En-ō (1239-1240)", + "Ninji (1240-1243)", + "Kangen (1243-1247)", + "Hōji (1247-1249)", + "Kenchō (1249-1256)", + "Kōgen (1256-1257)", + "Shōka (1257-1259)", + "Shōgen (1259-1260)", + "Bun-ō (1260-1261)", + "Kōchō (1261-1264)", + "Bun-ei (1264-1275)", + "Kenji (1275-1278)", + "Kōan (1278-1288)", + "Shōō (1288-1293)", + "Einin (1293-1299)", + "Shōan (1299-1302)", + "Kengen (1302-1303)", + "Kagen (1303-1306)", + "Tokuji (1306-1308)", + "Enkei (1308-1311)", + "Ōchō (1311-1312)", + "Shōwa (1312-1317)", + "Bunpō (1317-1319)", + "Genō (1319-1321)", + "Genkyō (1321-1324)", + "Shōchū (1324-1326)", + "Kareki (1326-1329)", + "Gentoku (1329-1331)", + "Genkō (1331-1334)", + "Kemmu (1334-1336)", + "Engen (1336-1340)", + "Kōkoku (1340-1346)", + "Shōhei (1346-1370)", + "Kentoku (1370-1372)", + "Bunchū (1372-1375)", + "Tenju (1375-1379)", + "Kōryaku (1379-1381)", + "Kōwa (1381-1384)", + "Genchū (1384-1392)", + "Meitoku (1384-1387)", + "Kakei (1387-1389)", + "Kōō (1389-1390)", + "Meitoku (1390-1394)", + "Ōei (1394-1428)", + "Shōchō (1428-1429)", + "Eikyō (1429-1441)", + "Kakitsu (1441-1444)", + "Bun-an (1444-1449)", + "Hōtoku (1449-1452)", + "Kyōtoku (1452-1455)", + "Kōshō (1455-1457)", + "Chōroku (1457-1460)", + "Kanshō (1460-1466)", + "Bunshō (1466-1467)", + "Ōnin (1467-1469)", + "Bunmei (1469-1487)", + "Chōkyō (1487-1489)", + "Entoku (1489-1492)", + "Meiō (1492-1501)", + "Bunki (1501-1504)", + "Eishō (1504-1521)", + "Taiei (1521-1528)", + "Kyōroku (1528-1532)", + "Tenmon (1532-1555)", + "Kōji (1555-1558)", + "Eiroku (1558-1570)", + "Genki (1570-1573)", + "Tenshō (1573-1592)", + "Bunroku (1592-1596)", + "Keichō (1596-1615)", + "Genwa (1615-1624)", + "Kan-ei (1624-1644)", + "Shōho (1644-1648)", + "Keian (1648-1652)", + "Shōō (1652-1655)", + "Meiryaku (1655-1658)", + "Manji (1658-1661)", + "Kanbun (1661-1673)", + "Enpō (1673-1681)", + "Tenwa (1681-1684)", + "Jōkyō (1684-1688)", + "Genroku (1688-1704)", + "Hōei (1704-1711)", + "Shōtoku (1711-1716)", + "Kyōhō (1716-1736)", + "Genbun (1736-1741)", + "Kanpō (1741-1744)", + "Enkyō (1744-1748)", + "Kan-en (1748-1751)", + "Hōryaku (1751-1764)", + "Meiwa (1764-1772)", + "An-ei (1772-1781)", + "Tenmei (1781-1789)", + "Kansei (1789-1801)", + "Kyōwa (1801-1804)", + "Bunka (1804-1818)", + "Bunsei (1818-1830)", + "Tenpō (1830-1844)", + "Kōka (1844-1848)", + "Kaei (1848-1854)", + "Ansei (1854-1860)", + "Man-en (1860-1861)", + "Bunkyū (1861-1864)", + "Genji (1864-1865)", + "Keiō (1865-1868)", + "Meiji", + "Taishō", + "Shōwa", + "Heisei" + ] + } + }, + "persian": { + "months": { + "narrow": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12" + ], + "short": [ + "Farvardin", + "Ordibehesht", + "Khordad", + "Tir", + "Mordad", + "Shahrivar", + "Mehr", + "Aban", + "Azar", + "Dey", + "Bahman", + "Esfand" + ], + "long": [ + "Farvardin", + "Ordibehesht", + "Khordad", + "Tir", + "Mordad", + "Shahrivar", + "Mehr", + "Aban", + "Azar", + "Dey", + "Bahman", + "Esfand" + ] + }, + "eras": { + "short": [ + "AP" + ] + } + }, + "roc": { + "eras": { + "short": [ + "Antes de R.O.C.", + "R.O.C." + ] + } + } + } + }, + "number": { + "nu": [ + "latn" + ], + "patterns": { + "decimal": { + "positivePattern": "{number}", + "negativePattern": "-{number}" + }, + "currency": { + "positivePattern": "{currency}{number}", + "negativePattern": "-{currency}{number}" + }, + "percent": { + "positivePattern": "{number}%", + "negativePattern": "-{number}%" + } + }, + "symbols": { + "latn": { + "decimal": ",", + "group": ".", + "nan": "NaN", + "percent": "%", + "infinity": "∞" + } + }, + "currencies": { + "AUD": "AU$", + "BRL": "R$", + "CAD": "CA$", + "CNY": "CN¥", + "EUR": "€", + "GBP": "£", + "HKD": "HK$", + "ILS": "₪", + "INR": "₹", + "JPY": "JP¥", + "KRW": "₩", + "MXN": "MX$", + "NZD": "NZ$", + "PTE": "Esc.", + "THB": "฿", + "TWD": "NT$", + "USD": "US$", + "VND": "₫", + "XAF": "FCFA", + "XCD": "EC$", + "XOF": "CFA", + "XPF": "CFPF" + } + } + } - listeners[i].fn.apply(listeners[i].context, args); - } - } - } +/***/ }, +/* 67 */ +/***/ function(module, exports, __webpack_require__) { - return true; - }; + /* (ignored) */ + +/***/ }, +/* 68 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext: true */ + + "use strict"; + exports.__addLocaleData = __addLocaleData; + var intl$messageformat$$ = __webpack_require__(95), intl$relativeformat$$ = __webpack_require__(96), src$en$$ = __webpack_require__(85), src$mixin$$ = __webpack_require__(86), src$components$date$$ = __webpack_require__(87), src$components$time$$ = __webpack_require__(88), src$components$relative$$ = __webpack_require__(89), src$components$number$$ = __webpack_require__(90), src$components$message$$ = __webpack_require__(91), src$components$html$message$$ = __webpack_require__(92); + function __addLocaleData(data) { + intl$messageformat$$["default"].__addLocaleData(data); + intl$relativeformat$$["default"].__addLocaleData(data); + } + + __addLocaleData(src$en$$["default"]); + exports.IntlMixin = src$mixin$$["default"], exports.FormattedDate = src$components$date$$["default"], exports.FormattedTime = src$components$time$$["default"], exports.FormattedRelative = src$components$relative$$["default"], exports.FormattedNumber = src$components$number$$["default"], exports.FormattedMessage = src$components$message$$["default"], exports.FormattedHTMLMessage = src$components$html$message$$["default"]; + + //# sourceMappingURL=react-intl.js.map + +/***/ }, +/* 69 */ +/***/ function(module, exports, __webpack_require__) { /** - * Register a new EventListener for the given event. - * - * @param {String} event Name of the event. - * @param {Functon} fn Callback function. - * @param {Mixed} context The context of the function. - * @api public + * A module of methods that you want to include in all actions. + * This module is consumed by `createAction`. */ - EventEmitter.prototype.on = function on(event, fn, context) { - var listener = new EE(fn, context || this); + module.exports = { + }; - if (!this._events) this._events = {}; - if (!this._events[event]) this._events[event] = listener; - else { - if (!this._events[event].fn) this._events[event].push(listener); - else this._events[event] = [ - this._events[event], listener - ]; - } - return this; - }; +/***/ }, +/* 70 */ +/***/ function(module, exports, __webpack_require__) { + + var _ = __webpack_require__(81), + maker = __webpack_require__(80).instanceJoinCreator; /** - * Add an EventListener that's only called once. + * Extract child listenables from a parent from their + * children property and return them in a keyed Object * - * @param {String} event Name of the event. - * @param {Function} fn Callback function. - * @param {Mixed} context The context of the function. - * @api public + * @param {Object} listenable The parent listenable */ - EventEmitter.prototype.once = function once(event, fn, context) { - var listener = new EE(fn, context || this, true); - - if (!this._events) this._events = {}; - if (!this._events[event]) this._events[event] = listener; - else { - if (!this._events[event].fn) this._events[event].push(listener); - else this._events[event] = [ - this._events[event], listener - ]; - } - - return this; + var mapChildListenables = function(listenable) { + var i = 0, children = {}, childName; + for (;i < (listenable.children||[]).length; ++i) { + childName = listenable.children[i]; + if(listenable[childName]){ + children[childName] = listenable[childName]; + } + } + return children; }; /** - * Remove event listeners. + * Make a flat dictionary of all listenables including their + * possible children (recursively), concatenating names in camelCase. * - * @param {String} event The event we want to remove. - * @param {Function} fn The listener that we need to find. - * @param {Boolean} once Only remove once listeners. - * @api public + * @param {Object} listenables The top-level listenables */ - EventEmitter.prototype.removeListener = function removeListener(event, fn, once) { - if (!this._events || !this._events[event]) return this; + var flattenListenables = function(listenables) { + var flattened = {}; + for(var key in listenables){ + var listenable = listenables[key]; + var childMap = mapChildListenables(listenable); - var listeners = this._events[event] - , events = []; + // recursively flatten children + var children = flattenListenables(childMap); - if (fn) { - if (listeners.fn && (listeners.fn !== fn || (once && !listeners.once))) { - events.push(listeners); - } - if (!listeners.fn) for (var i = 0, length = listeners.length; i < length; i++) { - if (listeners[i].fn !== fn || (once && !listeners[i].once)) { - events.push(listeners[i]); - } + // add the primary listenable and chilren + flattened[key] = listenable; + for(var childKey in children){ + var childListenable = children[childKey]; + flattened[key + _.capitalize(childKey)] = childListenable; + } } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) { - this._events[event] = events.length === 1 ? events[0] : events; - } else { - delete this._events[event]; - } - return this; + return flattened; }; /** - * Remove all listeners or only the listeners for the specified event. - * - * @param {String} event The event want to remove all listeners for. - * @api public + * A module of methods related to listening. */ - EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - if (!this._events) return this; - - if (event) delete this._events[event]; - else this._events = {}; - - return this; - }; + module.exports = { - // - // Alias methods names because people roll like that. - // - EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - EventEmitter.prototype.addListener = EventEmitter.prototype.on; + /** + * An internal utility function used by `validateListening` + * + * @param {Action|Store} listenable The listenable we want to search for + * @returns {Boolean} The result of a recursive search among `this.subscriptions` + */ + hasListener: function(listenable) { + var i = 0, j, listener, listenables; + for (;i < (this.subscriptions||[]).length; ++i) { + listenables = [].concat(this.subscriptions[i].listenable); + for (j = 0; j < listenables.length; j++){ + listener = listenables[j]; + if (listener === listenable || listener.hasListener && listener.hasListener(listenable)) { + return true; + } + } + } + return false; + }, - // - // This function doesn't apply anymore. - // - EventEmitter.prototype.setMaxListeners = function setMaxListeners() { - return this; - }; + /** + * A convenience method that listens to all listenables in the given object. + * + * @param {Object} listenables An object of listenables. Keys will be used as callback method names. + */ + listenToMany: function(listenables){ + var allListenables = flattenListenables(listenables); + for(var key in allListenables){ + var cbname = _.callbackName(key), + localname = this[cbname] ? cbname : this[key] ? key : undefined; + if (localname){ + this.listenTo(allListenables[key],localname,this[cbname+"Default"]||this[localname+"Default"]||localname); + } + } + }, - // + /** + * Checks if the current context can listen to the supplied listenable + * + * @param {Action|Store} listenable An Action or Store that should be + * listened to. + * @returns {String|Undefined} An error message, or undefined if there was no problem. + */ + validateListening: function(listenable){ + if (listenable === this) { + return "Listener is not able to listen to itself"; + } + if (!_.isFunction(listenable.listen)) { + return listenable + " is missing a listen method"; + } + if (listenable.hasListener && listenable.hasListener(this)) { + return "Listener cannot listen to this listenable because of circular loop"; + } + }, + + /** + * Sets up a subscription to the given listenable for the context object + * + * @param {Action|Store} listenable An Action or Store that should be + * listened to. + * @param {Function|String} callback The callback to register as event handler + * @param {Function|String} defaultCallback The callback to register as default handler + * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is the object being listened to + */ + listenTo: function(listenable, callback, defaultCallback) { + var desub, unsubscriber, subscriptionobj, subs = this.subscriptions = this.subscriptions || []; + _.throwIf(this.validateListening(listenable)); + this.fetchInitialState(listenable, defaultCallback); + desub = listenable.listen(this[callback]||callback, this); + unsubscriber = function() { + var index = subs.indexOf(subscriptionobj); + _.throwIf(index === -1,'Tried to remove listen already gone from subscriptions list!'); + subs.splice(index, 1); + desub(); + }; + subscriptionobj = { + stop: unsubscriber, + listenable: listenable + }; + subs.push(subscriptionobj); + return subscriptionobj; + }, + + /** + * Stops listening to a single listenable + * + * @param {Action|Store} listenable The action or store we no longer want to listen to + * @returns {Boolean} True if a subscription was found and removed, otherwise false. + */ + stopListeningTo: function(listenable){ + var sub, i = 0, subs = this.subscriptions || []; + for(;i < subs.length; i++){ + sub = subs[i]; + if (sub.listenable === listenable){ + sub.stop(); + _.throwIf(subs.indexOf(sub)!==-1,'Failed to remove listen from subscriptions list!'); + return true; + } + } + return false; + }, + + /** + * Stops all subscriptions and empties subscriptions array + */ + stopListeningToAll: function(){ + var remaining, subs = this.subscriptions || []; + while((remaining=subs.length)){ + subs[0].stop(); + _.throwIf(subs.length!==remaining-1,'Failed to remove listen from subscriptions list!'); + } + }, + + /** + * Used in `listenTo`. Fetches initial data from a publisher if it has a `getInitialState` method. + * @param {Action|Store} listenable The publisher we want to get initial state from + * @param {Function|String} defaultCallback The method to receive the data + */ + fetchInitialState: function (listenable, defaultCallback) { + defaultCallback = (defaultCallback && this[defaultCallback]) || defaultCallback; + var me = this; + if (_.isFunction(defaultCallback) && _.isFunction(listenable.getInitialState)) { + var data = listenable.getInitialState(); + if (data && _.isFunction(data.then)) { + data.then(function() { + defaultCallback.apply(me, arguments); + }); + } else { + defaultCallback.call(this, data); + } + } + }, + + /** + * The callback will be called once all listenables have triggered at least once. + * It will be invoked with the last emission from each listenable. + * @param {...Publishers} publishers Publishers that should be tracked. + * @param {Function|String} callback The method to call when all publishers have emitted + * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables + */ + joinTrailing: maker("last"), + + /** + * The callback will be called once all listenables have triggered at least once. + * It will be invoked with the first emission from each listenable. + * @param {...Publishers} publishers Publishers that should be tracked. + * @param {Function|String} callback The method to call when all publishers have emitted + * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables + */ + joinLeading: maker("first"), + + /** + * The callback will be called once all listenables have triggered at least once. + * It will be invoked with all emission from each listenable. + * @param {...Publishers} publishers Publishers that should be tracked. + * @param {Function|String} callback The method to call when all publishers have emitted + * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables + */ + joinConcat: maker("all"), + + /** + * The callback will be called once all listenables have triggered. + * If a callback triggers twice before that happens, an error is thrown. + * @param {...Publishers} publishers Publishers that should be tracked. + * @param {Function|String} callback The method to call when all publishers have emitted + * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables + */ + joinStrict: maker("strict") + }; + + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + var _ = __webpack_require__(81); + + /** + * A module of methods for object that you want to be able to listen to. + * This module is consumed by `createStore` and `createAction` + */ + module.exports = { + + /** + * Hook used by the publisher that is invoked before emitting + * and before `shouldEmit`. The arguments are the ones that the action + * is invoked with. If this function returns something other than + * undefined, that will be passed on as arguments for shouldEmit and + * emission. + */ + preEmit: function() {}, + + /** + * Hook used by the publisher after `preEmit` to determine if the + * event should be emitted with given arguments. This may be overridden + * in your application, default implementation always returns true. + * + * @returns {Boolean} true if event should be emitted + */ + shouldEmit: function() { return true; }, + + /** + * Subscribes the given callback for action triggered + * + * @param {Function} callback The callback to register as event handler + * @param {Mixed} [optional] bindContext The context to bind the callback with + * @returns {Function} Callback that unsubscribes the registered event handler + */ + listen: function(callback, bindContext) { + bindContext = bindContext || this; + var eventHandler = function(args) { + if (aborted){ + return; + } + callback.apply(bindContext, args); + }, me = this, aborted = false; + this.emitter.addListener(this.eventLabel, eventHandler); + return function() { + aborted = true; + me.emitter.removeListener(me.eventLabel, eventHandler); + }; + }, + + /** + * Attach handlers to promise that trigger the completed and failed + * child publishers, if available. + * + * @param {Object} The promise to attach to + */ + promise: function(promise) { + var me = this; + + var canHandlePromise = + this.children.indexOf('completed') >= 0 && + this.children.indexOf('failed') >= 0; + + if (!canHandlePromise){ + throw new Error('Publisher must have "completed" and "failed" child publishers'); + } + + promise.then(function(response) { + return me.completed(response); + }, function(error) { + return me.failed(error); + }); + }, + + /** + * Subscribes the given callback for action triggered, which should + * return a promise that in turn is passed to `this.promise` + * + * @param {Function} callback The callback to register as event handler + */ + listenAndPromise: function(callback, bindContext) { + var me = this; + bindContext = bindContext || this; + this.willCallPromise = (this.willCallPromise || 0) + 1; + + var removeListen = this.listen(function() { + + if (!callback) { + throw new Error('Expected a function returning a promise but got ' + callback); + } + + var args = arguments, + promise = callback.apply(bindContext, args); + return me.promise.call(me, promise); + }, bindContext); + + return function () { + me.willCallPromise--; + removeListen.call(me); + }; + + }, + + /** + * Publishes an event using `this.emitter` (if `shouldEmit` agrees) + */ + trigger: function() { + var args = arguments, + pre = this.preEmit.apply(this, args); + args = pre === undefined ? args : _.isArguments(pre) ? pre : [].concat(pre); + if (this.shouldEmit.apply(this, args)) { + this.emitter.emit(this.eventLabel, args); + } + }, + + /** + * Tries to publish the event on the next tick + */ + triggerAsync: function(){ + var args = arguments,me = this; + _.nextTick(function() { + me.trigger.apply(me, args); + }); + }, + + /** + * Returns a Promise for the triggered action + * + * @return {Promise} + * Resolved by completed child action. + * Rejected by failed child action. + * If listenAndPromise'd, then promise associated to this trigger. + * Otherwise, the promise is for next child action completion. + */ + triggerPromise: function(){ + var me = this; + var args = arguments; + + var canHandlePromise = + this.children.indexOf('completed') >= 0 && + this.children.indexOf('failed') >= 0; + + var promise = _.createPromise(function(resolve, reject) { + // If `listenAndPromise` is listening + // patch `promise` w/ context-loaded resolve/reject + if (me.willCallPromise) { + _.nextTick(function() { + var old_promise_method = me.promise; + me.promise = function (promise) { + promise.then(resolve, reject); + // Back to your regularly schedule programming. + me.promise = old_promise_method; + return me.promise.apply(me, arguments); + }; + me.trigger.apply(me, args); + }); + return; + } + + if (canHandlePromise) { + var removeSuccess = me.completed.listen(function(args) { + removeSuccess(); + removeFailed(); + resolve(args); + }); + + var removeFailed = me.failed.listen(function(args) { + removeSuccess(); + removeFailed(); + reject(args); + }); + } + + me.triggerAsync.apply(me, args); + + if (!canHandlePromise) { + resolve(); + } + }); + + return promise; + } + }; + + +/***/ }, +/* 72 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * A module of methods that you want to include in all stores. + * This module is consumed by `createStore`. + */ + module.exports = { + }; + + +/***/ }, +/* 73 */ +/***/ function(module, exports, __webpack_require__) { + + var _ = __webpack_require__(81), + Reflux = __webpack_require__(64), + Keep = __webpack_require__(82), + allowed = {preEmit:1,shouldEmit:1}; + + /** + * Creates an action functor object. It is mixed in with functions + * from the `PublisherMethods` mixin. `preEmit` and `shouldEmit` may + * be overridden in the definition object. + * + * @param {Object} definition The action object definition + */ + var createAction = function(definition) { + + definition = definition || {}; + if (!_.isObject(definition)){ + definition = {actionName: definition}; + } + + for(var a in Reflux.ActionMethods){ + if (!allowed[a] && Reflux.PublisherMethods[a]) { + throw new Error("Cannot override API method " + a + + " in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead." + ); + } + } + + for(var d in definition){ + if (!allowed[d] && Reflux.PublisherMethods[d]) { + throw new Error("Cannot override API method " + d + + " in action creation. Use another method name or override it on Reflux.PublisherMethods instead." + ); + } + } + + definition.children = definition.children || []; + if (definition.asyncResult){ + definition.children = definition.children.concat(["completed","failed"]); + } + + var i = 0, childActions = {}; + for (; i < definition.children.length; i++) { + var name = definition.children[i]; + childActions[name] = createAction(name); + } + + var context = _.extend({ + eventLabel: "action", + emitter: new _.EventEmitter(), + _isAction: true + }, Reflux.PublisherMethods, Reflux.ActionMethods, definition); + + var functor = function() { + return functor[functor.sync?"trigger":"triggerPromise"].apply(functor, arguments); + }; + + _.extend(functor,childActions,context); + + Keep.createdActions.push(functor); + + return functor; + + }; + + module.exports = createAction; + + +/***/ }, +/* 74 */ +/***/ function(module, exports, __webpack_require__) { + + var _ = __webpack_require__(81), + Reflux = __webpack_require__(64), + Keep = __webpack_require__(82), + mixer = __webpack_require__(93), + allowed = {preEmit:1,shouldEmit:1}, + bindMethods = __webpack_require__(94); + + /** + * Creates an event emitting Data Store. It is mixed in with functions + * from the `ListenerMethods` and `PublisherMethods` mixins. `preEmit` + * and `shouldEmit` may be overridden in the definition object. + * + * @param {Object} definition The data store object definition + * @returns {Store} A data store instance + */ + module.exports = function(definition) { + + definition = definition || {}; + + for(var a in Reflux.StoreMethods){ + if (!allowed[a] && (Reflux.PublisherMethods[a] || Reflux.ListenerMethods[a])){ + throw new Error("Cannot override API method " + a + + " in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead." + ); + } + } + + for(var d in definition){ + if (!allowed[d] && (Reflux.PublisherMethods[d] || Reflux.ListenerMethods[d])){ + throw new Error("Cannot override API method " + d + + " in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead." + ); + } + } + + definition = mixer(definition); + + function Store() { + var i=0, arr; + this.subscriptions = []; + this.emitter = new _.EventEmitter(); + this.eventLabel = "change"; + bindMethods(this, definition); + if (this.init && _.isFunction(this.init)) { + this.init(); + } + if (this.listenables){ + arr = [].concat(this.listenables); + for(;i < arr.length;i++){ + this.listenToMany(arr[i]); + } + } + } + + _.extend(Store.prototype, Reflux.ListenerMethods, Reflux.PublisherMethods, Reflux.StoreMethods, definition); + + var store = new Store(); + Keep.createdStores.push(store); + + return store; + }; + + +/***/ }, +/* 75 */ +/***/ function(module, exports, __webpack_require__) { + + var Reflux = __webpack_require__(64), + _ = __webpack_require__(81); + + module.exports = function(listenable,key){ + return { + getInitialState: function(){ + if (!_.isFunction(listenable.getInitialState)) { + return {}; + } else if (key === undefined) { + return listenable.getInitialState(); + } else { + return _.object([key],[listenable.getInitialState()]); + } + }, + componentDidMount: function(){ + _.extend(this,Reflux.ListenerMethods); + var me = this, cb = (key === undefined ? this.setState : function(v){me.setState(_.object([key],[v]));}); + this.listenTo(listenable,cb); + }, + componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount + }; + }; + + +/***/ }, +/* 76 */ +/***/ function(module, exports, __webpack_require__) { + + var Reflux = __webpack_require__(64), + _ = __webpack_require__(81); + + module.exports = function(listenable, key, filterFunc) { + filterFunc = _.isFunction(key) ? key : filterFunc; + return { + getInitialState: function() { + if (!_.isFunction(listenable.getInitialState)) { + return {}; + } else if (_.isFunction(key)) { + return filterFunc.call(this, listenable.getInitialState()); + } else { + // Filter initial payload from store. + var result = filterFunc.call(this, listenable.getInitialState()); + if (result) { + return _.object([key], [result]); + } else { + return {}; + } + } + }, + componentDidMount: function() { + _.extend(this, Reflux.ListenerMethods); + var me = this; + var cb = function(value) { + if (_.isFunction(key)) { + me.setState(filterFunc.call(me, value)); + } else { + var result = filterFunc.call(me, value); + me.setState(_.object([key], [result])); + } + }; + + this.listenTo(listenable, cb); + }, + componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount + }; + }; + + + +/***/ }, +/* 77 */ +/***/ function(module, exports, __webpack_require__) { + + var _ = __webpack_require__(81), + ListenerMethods = __webpack_require__(70); + + /** + * A module meant to be consumed as a mixin by a React component. Supplies the methods from + * `ListenerMethods` mixin and takes care of teardown of subscriptions. + * Note that if you're using the `connect` mixin you don't need this mixin, as connect will + * import everything this mixin contains! + */ + module.exports = _.extend({ + + /** + * Cleans up all listener previously registered. + */ + componentWillUnmount: ListenerMethods.stopListeningToAll + + }, ListenerMethods); + + +/***/ }, +/* 78 */ +/***/ function(module, exports, __webpack_require__) { + + var Reflux = __webpack_require__(64); + + + /** + * A mixin factory for a React component. Meant as a more convenient way of using the `ListenerMixin`, + * without having to manually set listeners in the `componentDidMount` method. + * + * @param {Action|Store} listenable An Action or Store that should be + * listened to. + * @param {Function|String} callback The callback to register as event handler + * @param {Function|String} defaultCallback The callback to register as default handler + * @returns {Object} An object to be used as a mixin, which sets up the listener for the given listenable. + */ + module.exports = function(listenable,callback,initial){ + return { + /** + * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods` + * and then make the call to `listenTo` with the arguments provided to the factory function + */ + componentDidMount: function() { + for(var m in Reflux.ListenerMethods){ + if (this[m] !== Reflux.ListenerMethods[m]){ + if (this[m]){ + throw "Can't have other property '"+m+"' when using Reflux.listenTo!"; + } + this[m] = Reflux.ListenerMethods[m]; + } + } + this.listenTo(listenable,callback,initial); + }, + /** + * Cleans up all listener previously registered. + */ + componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll + }; + }; + + +/***/ }, +/* 79 */ +/***/ function(module, exports, __webpack_require__) { + + var Reflux = __webpack_require__(64); + + /** + * A mixin factory for a React component. Meant as a more convenient way of using the `listenerMixin`, + * without having to manually set listeners in the `componentDidMount` method. This version is used + * to automatically set up a `listenToMany` call. + * + * @param {Object} listenables An object of listenables + * @returns {Object} An object to be used as a mixin, which sets up the listeners for the given listenables. + */ + module.exports = function(listenables){ + return { + /** + * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods` + * and then make the call to `listenTo` with the arguments provided to the factory function + */ + componentDidMount: function() { + for(var m in Reflux.ListenerMethods){ + if (this[m] !== Reflux.ListenerMethods[m]){ + if (this[m]){ + throw "Can't have other property '"+m+"' when using Reflux.listenToMany!"; + } + this[m] = Reflux.ListenerMethods[m]; + } + } + this.listenToMany(listenables); + }, + /** + * Cleans up all listener previously registered. + */ + componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll + }; + }; + + +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Internal module used to create static and instance join methods + */ + + var slice = Array.prototype.slice, + _ = __webpack_require__(81), + createStore = __webpack_require__(74), + strategyMethodNames = { + strict: "joinStrict", + first: "joinLeading", + last: "joinTrailing", + all: "joinConcat" + }; + + /** + * Used in `index.js` to create the static join methods + * @param {String} strategy Which strategy to use when tracking listenable trigger arguments + * @returns {Function} A static function which returns a store with a join listen on the given listenables using the given strategy + */ + exports.staticJoinCreator = function(strategy){ + return function(/* listenables... */) { + var listenables = slice.call(arguments); + return createStore({ + init: function(){ + this[strategyMethodNames[strategy]].apply(this,listenables.concat("triggerAsync")); + } + }); + }; + }; + + /** + * Used in `ListenerMethods.js` to create the instance join methods + * @param {String} strategy Which strategy to use when tracking listenable trigger arguments + * @returns {Function} An instance method which sets up a join listen on the given listenables using the given strategy + */ + exports.instanceJoinCreator = function(strategy){ + return function(/* listenables..., callback*/){ + _.throwIf(arguments.length < 3,'Cannot create a join with less than 2 listenables!'); + var listenables = slice.call(arguments), + callback = listenables.pop(), + numberOfListenables = listenables.length, + join = { + numberOfListenables: numberOfListenables, + callback: this[callback]||callback, + listener: this, + strategy: strategy + }, i, cancels = [], subobj; + for (i = 0; i < numberOfListenables; i++) { + _.throwIf(this.validateListening(listenables[i])); + } + for (i = 0; i < numberOfListenables; i++) { + cancels.push(listenables[i].listen(newListener(i,join),this)); + } + reset(join); + subobj = {listenable: listenables}; + subobj.stop = makeStopper(subobj,cancels,this); + this.subscriptions = (this.subscriptions || []).concat(subobj); + return subobj; + }; + }; + + // ---- internal join functions ---- + + function makeStopper(subobj,cancels,context){ + return function() { + var i, subs = context.subscriptions, + index = (subs ? subs.indexOf(subobj) : -1); + _.throwIf(index === -1,'Tried to remove join already gone from subscriptions list!'); + for(i=0;i < cancels.length; i++){ + cancels[i](); + } + subs.splice(index, 1); + }; + } + + function reset(join) { + join.listenablesEmitted = new Array(join.numberOfListenables); + join.args = new Array(join.numberOfListenables); + } + + function newListener(i,join) { + return function() { + var callargs = slice.call(arguments); + if (join.listenablesEmitted[i]){ + switch(join.strategy){ + case "strict": throw new Error("Strict join failed because listener triggered twice."); + case "last": join.args[i] = callargs; break; + case "all": join.args[i].push(callargs); + } + } else { + join.listenablesEmitted[i] = true; + join.args[i] = (join.strategy==="all"?[callargs]:callargs); + } + emitIfAllListenablesEmitted(join); + }; + } + + function emitIfAllListenablesEmitted(join) { + for (var i = 0; i < join.numberOfListenables; i++) { + if (!join.listenablesEmitted[i]) { + return; + } + } + join.callback.apply(join.listener,join.args); + reset(join); + } + + +/***/ }, +/* 81 */ +/***/ function(module, exports, __webpack_require__) { + + /* + * isObject, extend, isFunction, isArguments are taken from undescore/lodash in + * order to remove the dependency + */ + var isObject = exports.isObject = function(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + }; + + exports.extend = function(obj) { + if (!isObject(obj)) { + return obj; + } + var source, prop; + for (var i = 1, length = arguments.length; i < length; i++) { + source = arguments[i]; + for (prop in source) { + if (Object.getOwnPropertyDescriptor && Object.defineProperty) { + var propertyDescriptor = Object.getOwnPropertyDescriptor(source, prop); + Object.defineProperty(obj, prop, propertyDescriptor); + } else { + obj[prop] = source[prop]; + } + } + } + return obj; + }; + + exports.isFunction = function(value) { + return typeof value === 'function'; + }; + + exports.EventEmitter = __webpack_require__(97); + + exports.nextTick = function(callback) { + setTimeout(callback, 0); + }; + + exports.capitalize = function(string){ + return string.charAt(0).toUpperCase()+string.slice(1); + }; + + exports.callbackName = function(string){ + return "on"+exports.capitalize(string); + }; + + exports.object = function(keys,vals){ + var o={}, i=0; + for(;i 1) { + updated.init = function () { + var args = arguments; + composed.init.forEach(function (init) { + init.apply(this, args); + }, this); + }; + } + if (composed.preEmit.length > 1) { + updated.preEmit = function () { + return composed.preEmit.reduce(function (args, preEmit) { + var newValue = preEmit.apply(this, args); + return newValue === undefined ? args : [newValue]; + }.bind(this), arguments); + }; + } + if (composed.shouldEmit.length > 1) { + updated.shouldEmit = function () { + var args = arguments; + return !composed.shouldEmit.some(function (shouldEmit) { + return !shouldEmit.apply(this, args); + }, this); + }; + } + Object.keys(composed).forEach(function (composable) { + if (composed[composable].length === 1) { + updated[composable] = composed[composable][0]; + } + }); + + return updated; + }; + + +/***/ }, +/* 94 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = function(store, definition) { + for (var name in definition) { + if (Object.getOwnPropertyDescriptor && Object.defineProperty) { + var propertyDescriptor = Object.getOwnPropertyDescriptor(definition, name); + + if (!propertyDescriptor.value || typeof propertyDescriptor.value !== 'function' || !definition.hasOwnProperty(name)) { + continue; + } + + store[name] = definition[name].bind(store); + } else { + var property = definition[name]; + + if (typeof property !== 'function' || !definition.hasOwnProperty(name)) { + continue; + } + + store[name] = property.bind(store); + } + } + + return store; + }; + + +/***/ }, +/* 95 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint node:true */ + + 'use strict'; + + var IntlMessageFormat = __webpack_require__(105)['default']; + + // Add all locale data to `IntlMessageFormat`. This module will be ignored when + // bundling for the browser with Browserify/Webpack. + __webpack_require__(101); + + // Re-export `IntlMessageFormat` as the CommonJS default exports with all the + // locale data registered, and with English set as the default locale. Define + // the `default` prop for use with other compiled ES6 Modules. + exports = module.exports = IntlMessageFormat; + exports['default'] = exports; + + +/***/ }, +/* 96 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint node:true */ + + 'use strict'; + + var IntlRelativeFormat = __webpack_require__(103)['default']; + + // Add all locale data to `IntlRelativeFormat`. This module will be ignored when + // bundling for the browser with Browserify/Webpack. + __webpack_require__(102); + + // Re-export `IntlRelativeFormat` as the CommonJS default exports with all the + // locale data registered, and with English set as the default locale. Define + // the `default` prop for use with other compiled ES6 Modules. + exports = module.exports = IntlRelativeFormat; + exports['default'] = exports; + + +/***/ }, +/* 97 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + /** + * Representation of a single EventEmitter function. + * + * @param {Function} fn Event handler to be called. + * @param {Mixed} context Context for function execution. + * @param {Boolean} once Only emit once + * @api private + */ + function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; + } + + /** + * Minimal EventEmitter interface that is molded against the Node.js + * EventEmitter interface. + * + * @constructor + * @api public + */ + function EventEmitter() { /* Nothing to set */ } + + /** + * Holds the assigned EventEmitters by name. + * + * @type {Object} + * @private + */ + EventEmitter.prototype._events = undefined; + + /** + * Return a list of assigned event listeners. + * + * @param {String} event The events that should be listed. + * @returns {Array} + * @api public + */ + EventEmitter.prototype.listeners = function listeners(event) { + if (!this._events || !this._events[event]) return []; + if (this._events[event].fn) return [this._events[event].fn]; + + for (var i = 0, l = this._events[event].length, ee = new Array(l); i < l; i++) { + ee[i] = this._events[event][i].fn; + } + + return ee; + }; + + /** + * Emit an event to all registered event listeners. + * + * @param {String} event The name of the event. + * @returns {Boolean} Indication if we've emitted an event. + * @api public + */ + EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + if (!this._events || !this._events[event]) return false; + + var listeners = this._events[event] + , len = arguments.length + , args + , i; + + if ('function' === typeof listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; + }; + + /** + * Register a new EventListener for the given event. + * + * @param {String} event Name of the event. + * @param {Functon} fn Callback function. + * @param {Mixed} context The context of the function. + * @api public + */ + EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this); + + if (!this._events) this._events = {}; + if (!this._events[event]) this._events[event] = listener; + else { + if (!this._events[event].fn) this._events[event].push(listener); + else this._events[event] = [ + this._events[event], listener + ]; + } + + return this; + }; + + /** + * Add an EventListener that's only called once. + * + * @param {String} event Name of the event. + * @param {Function} fn Callback function. + * @param {Mixed} context The context of the function. + * @api public + */ + EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true); + + if (!this._events) this._events = {}; + if (!this._events[event]) this._events[event] = listener; + else { + if (!this._events[event].fn) this._events[event].push(listener); + else this._events[event] = [ + this._events[event], listener + ]; + } + + return this; + }; + + /** + * Remove event listeners. + * + * @param {String} event The event we want to remove. + * @param {Function} fn The listener that we need to find. + * @param {Boolean} once Only remove once listeners. + * @api public + */ + EventEmitter.prototype.removeListener = function removeListener(event, fn, once) { + if (!this._events || !this._events[event]) return this; + + var listeners = this._events[event] + , events = []; + + if (fn) { + if (listeners.fn && (listeners.fn !== fn || (once && !listeners.once))) { + events.push(listeners); + } + if (!listeners.fn) for (var i = 0, length = listeners.length; i < length; i++) { + if (listeners[i].fn !== fn || (once && !listeners[i].once)) { + events.push(listeners[i]); + } + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) { + this._events[event] = events.length === 1 ? events[0] : events; + } else { + delete this._events[event]; + } + + return this; + }; + + /** + * Remove all listeners or only the listeners for the specified event. + * + * @param {String} event The event want to remove all listeners for. + * @api public + */ + EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + if (!this._events) return this; + + if (event) delete this._events[event]; + else this._events = {}; + + return this; + }; + + // + // Alias methods names because people roll like that. + // + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + EventEmitter.prototype.addListener = EventEmitter.prototype.on; + + // + // This function doesn't apply anymore. + // + EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; + }; + + // // Expose the module. // EventEmitter.EventEmitter = EventEmitter; EventEmitter.EventEmitter2 = EventEmitter; EventEmitter.EventEmitter3 = EventEmitter; - // - // Expose the module. - // - module.exports = EventEmitter; + // + // Expose the module. + // + module.exports = EventEmitter; + + +/***/ }, +/* 98 */ +/***/ function(module, exports, __webpack_require__) { + + /* global React */ + /* jshint esnext:true */ + + // TODO: Remove the global `React` binding lookup once the ES6 Module Transpiler + // supports external modules. This is a hack for now that provides the local + // modules a referece to React. + "use strict"; + exports["default"] = React; + + //# sourceMappingURL=react.js.map + +/***/ }, +/* 99 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint esnext:true */ + + /* + HTML escaping implementation is the same as React's (on purpose.) Therefore, it + has the following Copyright and Licensing: + + Copyright 2013-2014, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the LICENSE + file in the root directory of React's source tree. + */ + "use strict"; + var ESCAPED_CHARS = { + '&' : '&', + '>' : '>', + '<' : '<', + '"' : '"', + '\'': ''' + }; + + var UNSAFE_CHARS_REGEX = /[&><"']/g; + + exports["default"] = function (str) { + return ('' + str).replace(UNSAFE_CHARS_REGEX, function (match) { + return ESCAPED_CHARS[match]; + }); + }; + + //# sourceMappingURL=escape.js.map + +/***/ }, +/* 100 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*! Native Promise Only + v0.7.6-a (c) Kyle Simpson + MIT License: http://getify.mit-license.org + */ + !function(t,n,e){n[t]=n[t]||e(),"undefined"!=typeof module&&module.exports?module.exports=n[t]:"function"=="function"&&__webpack_require__(110)&&!(__WEBPACK_AMD_DEFINE_RESULT__ = function(){return n[t]}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))}("Promise","undefined"!=typeof global?global:this,function(){"use strict";function t(t,n){l.add(t,n),h||(h=y(l.drain))}function n(t){var n,e=typeof t;return null==t||"object"!=e&&"function"!=e||(n=t.then),"function"==typeof n?n:!1}function e(){for(var t=0;t0&&t(e,a))}catch(s){i.call(u||new f(a),s)}}}function i(n){var o=this;o.triggered||(o.triggered=!0,o.def&&(o=o.def),o.msg=n,o.state=2,o.chain.length>0&&t(e,o))}function c(t,n,e,o){for(var r=0;r= 0) { + return true; + } + + if (typeof units === 'string') { + var suggestion = /s$/.test(units) && units.substr(0, units.length - 1); + if (suggestion && src$es5$$.arrIndexOf.call(FIELDS, suggestion) >= 0) { + throw new Error( + '"' + units + '" is not a valid IntlRelativeFormat `units` ' + + 'value, did you mean: ' + suggestion + ); + } + } + + throw new Error( + '"' + units + '" is not a valid IntlRelativeFormat `units` value, it ' + + 'must be one of: "' + FIELDS.join('", "') + '"' + ); + }; + + RelativeFormat.prototype._resolveLocale = function (locales) { + if (typeof locales === 'string') { + locales = [locales]; + } + + // Create a copy of the array so we can push on the default locale. + locales = (locales || []).concat(RelativeFormat.defaultLocale); + + var localeData = RelativeFormat.__localeData__; + var i, len, localeParts, data; + + // Using the set of locales + the default locale, we look for the first one + // which that has been registered. When data does not exist for a locale, we + // traverse its ancestors to find something that's been registered within + // its hierarchy of locales. Since we lack the proper `parentLocale` data + // here, we must take a naive approach to traversal. + for (i = 0, len = locales.length; i < len; i += 1) { + localeParts = locales[i].toLowerCase().split('-'); + + while (localeParts.length) { + data = localeData[localeParts.join('-')]; + if (data) { + // Return the normalized locale string; e.g., we return "en-US", + // instead of "en-us". + return data.locale; + } + + localeParts.pop(); + } + } + + var defaultLocale = locales.pop(); + throw new Error( + 'No locale data has been added to IntlRelativeFormat for: ' + + locales.join(', ') + ', or the default locale: ' + defaultLocale + ); + }; + + RelativeFormat.prototype._resolveStyle = function (style) { + // Default to "best fit" style. + if (!style) { + return STYLES[0]; + } + + if (src$es5$$.arrIndexOf.call(STYLES, style) >= 0) { + return style; + } + + throw new Error( + '"' + style + '" is not a valid IntlRelativeFormat `style` value, it ' + + 'must be one of: "' + STYLES.join('", "') + '"' + ); + }; + + RelativeFormat.prototype._selectUnits = function (diffReport) { + var i, l, units; + + for (i = 0, l = FIELDS.length; i < l; i += 1) { + units = FIELDS[i]; + + if (Math.abs(diffReport[units]) < RelativeFormat.thresholds[units]) { + break; + } + } + + return units; + }; + + //# sourceMappingURL=core.js.map + +/***/ }, +/* 107 */ +/***/ function(module, exports, __webpack_require__) { + + // GENERATED FILE + "use strict"; + exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"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"}}}}}; + + //# sourceMappingURL=en.js.map + +/***/ }, +/* 108 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var src$es5$$ = __webpack_require__(118); + exports["default"] = createFormatCache; + + // ----------------------------------------------------------------------------- + + function createFormatCache(FormatConstructor) { + var cache = src$es5$$.objCreate(null); + + return function () { + var args = Array.prototype.slice.call(arguments); + var cacheId = getCacheId(args); + var format = cacheId && cache[cacheId]; + + if (!format) { + format = src$es5$$.objCreate(FormatConstructor.prototype); + FormatConstructor.apply(format, args); + + if (cacheId) { + cache[cacheId] = format; + } + } + + return format; + }; + } + + // -- Utilities ---------------------------------------------------------------- + + function getCacheId(inputs) { + // When JSON is not available in the runtime, we will not create a cache id. + if (typeof JSON === 'undefined') { return; } + + var cacheId = []; + + var i, len, input; + + for (i = 0, len = inputs.length; i < len; i += 1) { + input = inputs[i]; + + if (input && typeof input === 'object') { + cacheId.push(orderedProps(input)); + } else { + cacheId.push(input); + } + } + + return JSON.stringify(cacheId); + } + + function orderedProps(obj) { + var props = [], + keys = []; + + var key, i, len, prop; + + for (key in obj) { + if (obj.hasOwnProperty(key)) { + keys.push(key); + } + } + + var orderedKeys = keys.sort(); + + for (i = 0, len = orderedKeys.length; i < len; i += 1) { + key = orderedKeys[i]; + prop = {}; + + prop[key] = obj[key]; + props[i] = prop; + } + + return props; + } + + //# sourceMappingURL=memoizer.js.map + +/***/ }, +/* 109 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(setImmediate, clearImmediate) {var nextTick = __webpack_require__(120).nextTick; + var apply = Function.prototype.apply; + var slice = Array.prototype.slice; + var immediateIds = {}; + var nextImmediateId = 0; + + // DOM APIs, for completeness + + exports.setTimeout = function() { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); + }; + exports.setInterval = function() { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); + }; + exports.clearTimeout = + exports.clearInterval = function(timeout) { timeout.close(); }; + + function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; + } + Timeout.prototype.unref = Timeout.prototype.ref = function() {}; + Timeout.prototype.close = function() { + this._clearFn.call(window, this._id); + }; + + // Does not start the time, just sets up the members needed. + exports.enroll = function(item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; + }; + + exports.unenroll = function(item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; + }; + + exports._unrefActive = exports.active = function(item) { + clearTimeout(item._idleTimeoutId); + + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } + }; + + // That's not how node.js implements it but the exposed api is the same. + exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + + immediateIds[id] = true; + + nextTick(function onNextTick() { + if (immediateIds[id]) { + // fn.call() is faster so we optimize for the common use-case + // @see http://jsperf.com/call-apply-segu + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + // Prevent ids from leaking + exports.clearImmediate(id); + } + }); + + return id; + }; + + exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { + delete immediateIds[id]; + }; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(109).setImmediate, __webpack_require__(109).clearImmediate)) + +/***/ }, +/* 110 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__; + + /* WEBPACK VAR INJECTION */}.call(exports, {})) + +/***/ }, +/* 111 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + var src$utils$$ = __webpack_require__(115), src$es5$$ = __webpack_require__(116), src$compiler$$ = __webpack_require__(117), intl$messageformat$parser$$ = __webpack_require__(119); + exports["default"] = MessageFormat; + + // -- MessageFormat -------------------------------------------------------- + + function MessageFormat(message, locales, formats) { + // Parse string messages into an AST. + var ast = typeof message === 'string' ? + MessageFormat.__parse(message) : message; + + if (!(ast && ast.type === 'messageFormatPattern')) { + throw new TypeError('A message must be provided as a String or AST.'); + } + + // Creates a new object with the specified `formats` merged with the default + // formats. + formats = this._mergeFormats(MessageFormat.formats, formats); + + // Defined first because it's used to build the format pattern. + src$es5$$.defineProperty(this, '_locale', {value: this._resolveLocale(locales)}); + + // Compile the `ast` to a pattern that is highly optimized for repeated + // `format()` invocations. **Note:** This passes the `locales` set provided + // to the constructor instead of just the resolved locale. + var pluralFn = this._findPluralRuleFunction(this._locale); + var pattern = this._compilePattern(ast, locales, formats, pluralFn); + + // "Bind" `format()` method to `this` so it can be passed by reference like + // the other `Intl` APIs. + var messageFormat = this; + this.format = function (values) { + return messageFormat._format(pattern, values); + }; + } + + // Default format options used as the prototype of the `formats` provided to the + // constructor. These are used when constructing the internal Intl.NumberFormat + // and Intl.DateTimeFormat instances. + src$es5$$.defineProperty(MessageFormat, 'formats', { + enumerable: true, + + 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' + } + } + } + }); + + // Define internal private properties for dealing with locale data. + src$es5$$.defineProperty(MessageFormat, '__localeData__', {value: src$es5$$.objCreate(null)}); + src$es5$$.defineProperty(MessageFormat, '__addLocaleData', {value: function (data) { + if (!(data && data.locale)) { + throw new Error( + 'Locale data provided to IntlMessageFormat is missing a ' + + '`locale` property' + ); + } + + MessageFormat.__localeData__[data.locale.toLowerCase()] = data; + }}); + + // Defines `__parse()` static method as an exposed private. + src$es5$$.defineProperty(MessageFormat, '__parse', {value: intl$messageformat$parser$$["default"].parse}); + + // Define public `defaultLocale` property which defaults to English, but can be + // set by the developer. + src$es5$$.defineProperty(MessageFormat, 'defaultLocale', { + enumerable: true, + writable : true, + value : undefined + }); + + MessageFormat.prototype.resolvedOptions = function () { + // TODO: Provide anything else? + return { + locale: this._locale + }; + }; + + MessageFormat.prototype._compilePattern = function (ast, locales, formats, pluralFn) { + var compiler = new src$compiler$$["default"](locales, formats, pluralFn); + return compiler.compile(ast); + }; + + MessageFormat.prototype._findPluralRuleFunction = function (locale) { + var localeData = MessageFormat.__localeData__; + var data = localeData[locale.toLowerCase()]; + + // The locale data is de-duplicated, so we have to traverse the locale's + // hierarchy until we find a `pluralRuleFunction` to return. + while (data) { + if (data.pluralRuleFunction) { + return data.pluralRuleFunction; + } + + data = data.parentLocale && localeData[data.parentLocale.toLowerCase()]; + } + + throw new Error( + 'Locale data added to IntlMessageFormat is missing a ' + + '`pluralRuleFunction` for :' + locale + ); + }; + + MessageFormat.prototype._format = function (pattern, values) { + var result = '', + i, len, part, id, value; + + for (i = 0, len = pattern.length; i < len; i += 1) { + part = pattern[i]; + + // Exist early for string parts. + if (typeof part === 'string') { + result += part; + continue; + } + + id = part.id; + + // Enforce that all required values are provided by the caller. + if (!(values && src$utils$$.hop.call(values, id))) { + throw new Error('A value must be provided for: ' + id); + } + + value = values[id]; + + // Recursively format plural and select parts' option — which can be a + // nested pattern structure. The choosing of the option to use is + // abstracted-by and delegated-to the part helper object. + if (part.options) { + result += this._format(part.getOption(value), values); + } else { + result += part.format(value); + } + } + + return result; + }; + + MessageFormat.prototype._mergeFormats = function (defaults, formats) { + var mergedFormats = {}, + type, mergedType; + + for (type in defaults) { + if (!src$utils$$.hop.call(defaults, type)) { continue; } + + mergedFormats[type] = mergedType = src$es5$$.objCreate(defaults[type]); + + if (formats && src$utils$$.hop.call(formats, type)) { + src$utils$$.extend(mergedType, formats[type]); + } + } + + return mergedFormats; + }; + + MessageFormat.prototype._resolveLocale = function (locales) { + if (typeof locales === 'string') { + locales = [locales]; + } + + // Create a copy of the array so we can push on the default locale. + locales = (locales || []).concat(MessageFormat.defaultLocale); + + var localeData = MessageFormat.__localeData__; + var i, len, localeParts, data; + + // Using the set of locales + the default locale, we look for the first one + // which that has been registered. When data does not exist for a locale, we + // traverse its ancestors to find something that's been registered within + // its hierarchy of locales. Since we lack the proper `parentLocale` data + // here, we must take a naive approach to traversal. + for (i = 0, len = locales.length; i < len; i += 1) { + localeParts = locales[i].toLowerCase().split('-'); + + while (localeParts.length) { + data = localeData[localeParts.join('-')]; + if (data) { + // Return the normalized locale string; e.g., we return "en-US", + // instead of "en-us". + return data.locale; + } + + localeParts.pop(); + } + } + + var defaultLocale = locales.pop(); + throw new Error( + 'No locale data has been added to IntlMessageFormat for: ' + + locales.join(', ') + ', or the default locale: ' + defaultLocale + ); + }; + + //# sourceMappingURL=core.js.map + +/***/ }, +/* 112 */ +/***/ function(module, exports, __webpack_require__) { + + // GENERATED FILE + "use strict"; + exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}}; + + //# sourceMappingURL=en.js.map + +/***/ }, +/* 113 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + + var round = Math.round; + + function daysToYears(days) { + // 400 years have 146097 days (taking into account leap year rules) + return days * 400 / 146097; + } + + exports["default"] = function (from, to) { + // Convert to ms timestamps. + from = +from; + to = +to; + + var millisecond = round(to - from), + second = round(millisecond / 1000), + minute = round(second / 60), + hour = round(minute / 60), + day = round(hour / 24), + week = round(day / 7); + + var rawYears = daysToYears(day), + month = round(rawYears * 12), + year = round(rawYears); + + return { + millisecond: millisecond, + second : second, + minute : minute, + hour : hour, + day : day, + week : week, + month : month, + year : year + }; + }; + + //# sourceMappingURL=diff.js.map + +/***/ }, +/* 114 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + + // Purposely using the same implementation as the Intl.js `Intl` polyfill. + // Copyright 2013 Andy Earnshaw, MIT License + + var hop = Object.prototype.hasOwnProperty; + var toString = Object.prototype.toString; + + var realDefineProp = (function () { + try { return !!Object.defineProperty({}, 'a', {}); } + catch (e) { return false; } + })(); + + var es3 = !realDefineProp && !Object.prototype.__defineGetter__; + + var defineProperty = realDefineProp ? Object.defineProperty : + function (obj, name, desc) { + + if ('get' in desc && obj.__defineGetter__) { + obj.__defineGetter__(name, desc.get); + } else if (!hop.call(obj, name) || 'value' in desc) { + obj[name] = desc.value; + } + }; + + var objCreate = Object.create || function (proto, props) { + var obj, k; + + function F() {} + F.prototype = proto; + obj = new F(); + + for (k in props) { + if (hop.call(props, k)) { + defineProperty(obj, k, props[k]); + } + } + + return obj; + }; + + var arrIndexOf = Array.prototype.indexOf || function (search, fromIndex) { + /*jshint validthis:true */ + var arr = this; + if (!arr.length) { + return -1; + } + + for (var i = fromIndex || 0, max = arr.length; i < max; i++) { + if (arr[i] === search) { + return i; + } + } + + return -1; + }; + + var isArray = Array.isArray || function (obj) { + return toString.call(obj) === '[object Array]'; + }; + + var dateNow = Date.now || function () { + return new Date().getTime(); + }; + exports.defineProperty = defineProperty, exports.objCreate = objCreate, exports.arrIndexOf = arrIndexOf, exports.isArray = isArray, exports.dateNow = dateNow; + + //# sourceMappingURL=es5.js.map + +/***/ }, +/* 115 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + exports.extend = extend; + var hop = Object.prototype.hasOwnProperty; + + function extend(obj) { + var sources = Array.prototype.slice.call(arguments, 1), + i, len, source, key; + + for (i = 0, len = sources.length; i < len; i += 1) { + source = sources[i]; + if (!source) { continue; } + + for (key in source) { + if (hop.call(source, key)) { + obj[key] = source[key]; + } + } + } + + return obj; + } + exports.hop = hop; + + //# sourceMappingURL=utils.js.map + +/***/ }, +/* 116 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + var src$utils$$ = __webpack_require__(115); + + // Purposely using the same implementation as the Intl.js `Intl` polyfill. + // Copyright 2013 Andy Earnshaw, MIT License + + var realDefineProp = (function () { + try { return !!Object.defineProperty({}, 'a', {}); } + catch (e) { return false; } + })(); + + var es3 = !realDefineProp && !Object.prototype.__defineGetter__; + + var defineProperty = realDefineProp ? Object.defineProperty : + function (obj, name, desc) { + + if ('get' in desc && obj.__defineGetter__) { + obj.__defineGetter__(name, desc.get); + } else if (!src$utils$$.hop.call(obj, name) || 'value' in desc) { + obj[name] = desc.value; + } + }; + + var objCreate = Object.create || function (proto, props) { + var obj, k; + + function F() {} + F.prototype = proto; + obj = new F(); + + for (k in props) { + if (src$utils$$.hop.call(props, k)) { + defineProperty(obj, k, props[k]); + } + } + + return obj; + }; + exports.defineProperty = defineProperty, exports.objCreate = objCreate; + + //# sourceMappingURL=es5.js.map + +/***/ }, +/* 117 */ +/***/ function(module, exports, __webpack_require__) { + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + + /* jslint esnext: true */ + + "use strict"; + exports["default"] = Compiler; + + function Compiler(locales, formats, pluralFn) { + this.locales = locales; + this.formats = formats; + this.pluralFn = pluralFn; + } + + Compiler.prototype.compile = function (ast) { + this.pluralStack = []; + this.currentPlural = null; + this.pluralNumberFormat = null; + + return this.compileMessage(ast); + }; + + Compiler.prototype.compileMessage = function (ast) { + if (!(ast && ast.type === 'messageFormatPattern')) { + throw new Error('Message AST is not of type: "messageFormatPattern"'); + } + + var elements = ast.elements, + pattern = []; + + var i, len, element; + + for (i = 0, len = elements.length; i < len; i += 1) { + element = elements[i]; + + switch (element.type) { + case 'messageTextElement': + pattern.push(this.compileMessageText(element)); + break; + + case 'argumentElement': + pattern.push(this.compileArgument(element)); + break; + + default: + throw new Error('Message element does not have a valid type'); + } + } + + return pattern; + }; + + Compiler.prototype.compileMessageText = function (element) { + // When this `element` is part of plural sub-pattern and its value contains + // an unescaped '#', use a `PluralOffsetString` helper to properly output + // the number with the correct offset in the string. + if (this.currentPlural && /(^|[^\\])#/g.test(element.value)) { + // Create a cache a NumberFormat instance that can be reused for any + // PluralOffsetString instance in this message. + if (!this.pluralNumberFormat) { + this.pluralNumberFormat = new Intl.NumberFormat(this.locales); + } + + return new PluralOffsetString( + this.currentPlural.id, + this.currentPlural.format.offset, + this.pluralNumberFormat, + element.value); + } + + // Unescape the escaped '#'s in the message text. + return element.value.replace(/\\#/g, '#'); + }; + + Compiler.prototype.compileArgument = function (element) { + var format = element.format; + + if (!format) { + return new StringFormat(element.id); + } + + var formats = this.formats, + locales = this.locales, + pluralFn = this.pluralFn, + options; + + switch (format.type) { + case 'numberFormat': + options = formats.number[format.style]; + return { + id : element.id, + format: new Intl.NumberFormat(locales, options).format + }; + + case 'dateFormat': + options = formats.date[format.style]; + return { + id : element.id, + format: new Intl.DateTimeFormat(locales, options).format + }; + + case 'timeFormat': + options = formats.time[format.style]; + return { + id : element.id, + format: new Intl.DateTimeFormat(locales, options).format + }; + + case 'pluralFormat': + options = this.compileOptions(element); + return new PluralFormat( + element.id, format.ordinal, format.offset, options, pluralFn + ); + + case 'selectFormat': + options = this.compileOptions(element); + return new SelectFormat(element.id, options); + + default: + throw new Error('Message element does not have a valid format type'); + } + }; + + Compiler.prototype.compileOptions = function (element) { + var format = element.format, + options = format.options, + optionsHash = {}; + + // Save the current plural element, if any, then set it to a new value when + // compiling the options sub-patterns. This conforms the spec's algorithm + // for handling `"#"` syntax in message text. + this.pluralStack.push(this.currentPlural); + this.currentPlural = format.type === 'pluralFormat' ? element : null; + + var i, len, option; + + for (i = 0, len = options.length; i < len; i += 1) { + option = options[i]; + + // Compile the sub-pattern and save it under the options's selector. + optionsHash[option.selector] = this.compileMessage(option.value); + } + + // Pop the plural stack to put back the original current plural value. + this.currentPlural = this.pluralStack.pop(); + + return optionsHash; + }; + + // -- Compiler Helper Classes -------------------------------------------------- + + function StringFormat(id) { + this.id = id; + } + + StringFormat.prototype.format = function (value) { + if (!value) { + return ''; + } + + return typeof value === 'string' ? value : String(value); + }; + + function PluralFormat(id, useOrdinal, offset, options, pluralFn) { + this.id = id; + this.useOrdinal = useOrdinal; + this.offset = offset; + this.options = options; + this.pluralFn = pluralFn; + } + + PluralFormat.prototype.getOption = function (value) { + var options = this.options; + + var option = options['=' + value] || + options[this.pluralFn(value - this.offset, this.useOrdinal)]; + + return option || options.other; + }; + + function PluralOffsetString(id, offset, numberFormat, string) { + this.id = id; + this.offset = offset; + this.numberFormat = numberFormat; + this.string = string; + } + + PluralOffsetString.prototype.format = function (value) { + var number = this.numberFormat.format(value - this.offset); + + return this.string + .replace(/(^|[^\\])#/g, '$1' + number) + .replace(/\\#/g, '#'); + }; + + function SelectFormat(id, options) { + this.id = id; + this.options = options; + } + + SelectFormat.prototype.getOption = function (value) { + var options = this.options; + return options[value] || options.other; + }; + + //# sourceMappingURL=compiler.js.map + +/***/ }, +/* 118 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + // Purposely using the same implementation as the Intl.js `Intl` polyfill. + // Copyright 2013 Andy Earnshaw, MIT License + + var hop = Object.prototype.hasOwnProperty; + + var realDefineProp = (function () { + try { return !!Object.defineProperty({}, 'a', {}); } + catch (e) { return false; } + })(); + + var es3 = !realDefineProp && !Object.prototype.__defineGetter__; + + var defineProperty = realDefineProp ? Object.defineProperty : + function (obj, name, desc) { + + if ('get' in desc && obj.__defineGetter__) { + obj.__defineGetter__(name, desc.get); + } else if (!hop.call(obj, name) || 'value' in desc) { + obj[name] = desc.value; + } + }; + + var objCreate = Object.create || function (proto, props) { + var obj, k; + + function F() {} + F.prototype = proto; + obj = new F(); + + for (k in props) { + if (hop.call(props, k)) { + defineProperty(obj, k, props[k]); + } + } + + return obj; + }; + exports.defineProperty = defineProperty, exports.objCreate = objCreate; + + //# sourceMappingURL=es5.js.map + +/***/ }, +/* 119 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports = module.exports = __webpack_require__(121)['default']; + exports['default'] = exports; + + +/***/ }, +/* 120 */ +/***/ function(module, exports, __webpack_require__) { + + // shim for using process in browser + + var process = module.exports = {}; + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + + function cleanUpNextTick() { + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + + function drainQueue() { + if (draining) { + return; + } + var timeout = setTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + currentQueue[queueIndex].run(); + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + clearTimeout(timeout); + } + + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + setTimeout(drainQueue, 0); + } + }; + + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() {} + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + // TODO(shtylman) + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function() { return 0; }; + + +/***/ }, +/* 121 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + exports["default"] = (function() { + /* + * Generated by PEG.js 0.8.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(message, expected, found, offset, line, column) { + this.message = message; + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$FAILED = {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = [], + peg$c1 = function(elements) { + return { + type : 'messageFormatPattern', + elements: elements + }; + }, + peg$c2 = peg$FAILED, + peg$c3 = function(text) { + var string = '', + i, j, outerLen, inner, innerLen; + + for (i = 0, outerLen = text.length; i < outerLen; i += 1) { + inner = text[i]; + + for (j = 0, innerLen = inner.length; j < innerLen; j += 1) { + string += inner[j]; + } + } + + return string; + }, + peg$c4 = function(messageText) { + return { + type : 'messageTextElement', + value: messageText + }; + }, + peg$c5 = /^[^ \t\n\r,.+={}#]/, + peg$c6 = { type: "class", value: "[^ \\t\\n\\r,.+={}#]", description: "[^ \\t\\n\\r,.+={}#]" }, + peg$c7 = "{", + peg$c8 = { type: "literal", value: "{", description: "\"{\"" }, + peg$c9 = null, + peg$c10 = ",", + peg$c11 = { type: "literal", value: ",", description: "\",\"" }, + peg$c12 = "}", + peg$c13 = { type: "literal", value: "}", description: "\"}\"" }, + peg$c14 = function(id, format) { + return { + type : 'argumentElement', + id : id, + format: format && format[2] + }; + }, + peg$c15 = "number", + peg$c16 = { type: "literal", value: "number", description: "\"number\"" }, + peg$c17 = "date", + peg$c18 = { type: "literal", value: "date", description: "\"date\"" }, + peg$c19 = "time", + peg$c20 = { type: "literal", value: "time", description: "\"time\"" }, + peg$c21 = function(type, style) { + return { + type : type + 'Format', + style: style && style[2] + }; + }, + peg$c22 = "plural", + peg$c23 = { type: "literal", value: "plural", description: "\"plural\"" }, + peg$c24 = function(pluralStyle) { + return { + type : pluralStyle.type, + ordinal: false, + offset : pluralStyle.offset || 0, + options: pluralStyle.options + }; + }, + peg$c25 = "selectordinal", + peg$c26 = { type: "literal", value: "selectordinal", description: "\"selectordinal\"" }, + peg$c27 = function(pluralStyle) { + return { + type : pluralStyle.type, + ordinal: true, + offset : pluralStyle.offset || 0, + options: pluralStyle.options + } + }, + peg$c28 = "select", + peg$c29 = { type: "literal", value: "select", description: "\"select\"" }, + peg$c30 = function(options) { + return { + type : 'selectFormat', + options: options + }; + }, + peg$c31 = "=", + peg$c32 = { type: "literal", value: "=", description: "\"=\"" }, + peg$c33 = function(selector, pattern) { + return { + type : 'optionalFormatPattern', + selector: selector, + value : pattern + }; + }, + peg$c34 = "offset:", + peg$c35 = { type: "literal", value: "offset:", description: "\"offset:\"" }, + peg$c36 = function(number) { + return number; + }, + peg$c37 = function(offset, options) { + return { + type : 'pluralFormat', + offset : offset, + options: options + }; + }, + peg$c38 = { type: "other", description: "whitespace" }, + peg$c39 = /^[ \t\n\r]/, + peg$c40 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" }, + peg$c41 = { type: "other", description: "optionalWhitespace" }, + peg$c42 = /^[0-9]/, + peg$c43 = { type: "class", value: "[0-9]", description: "[0-9]" }, + peg$c44 = /^[0-9a-f]/i, + peg$c45 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" }, + peg$c46 = "0", + peg$c47 = { type: "literal", value: "0", description: "\"0\"" }, + peg$c48 = /^[1-9]/, + peg$c49 = { type: "class", value: "[1-9]", description: "[1-9]" }, + peg$c50 = function(digits) { + return parseInt(digits, 10); + }, + peg$c51 = /^[^{}\\\0-\x1F \t\n\r]/, + peg$c52 = { type: "class", value: "[^{}\\\\\\0-\\x1F \\t\\n\\r]", description: "[^{}\\\\\\0-\\x1F \\t\\n\\r]" }, + peg$c53 = "\\#", + peg$c54 = { type: "literal", value: "\\#", description: "\"\\\\#\"" }, + peg$c55 = function() { return '\\#'; }, + peg$c56 = "\\{", + peg$c57 = { type: "literal", value: "\\{", description: "\"\\\\{\"" }, + peg$c58 = function() { return '\u007B'; }, + peg$c59 = "\\}", + peg$c60 = { type: "literal", value: "\\}", description: "\"\\\\}\"" }, + peg$c61 = function() { return '\u007D'; }, + peg$c62 = "\\u", + peg$c63 = { type: "literal", value: "\\u", description: "\"\\\\u\"" }, + peg$c64 = function(digits) { + return String.fromCharCode(parseInt(digits, 16)); + }, + peg$c65 = function(chars) { return chars.join(''); }, + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function expected(description) { + throw peg$buildException( + null, + [{ type: "other", description: description }], + peg$reportedPos + ); + } + + function error(message) { + throw peg$buildException(message, null, peg$reportedPos); + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildException(message, expected, pos) { + function cleanupExpected(expected) { + var i = 1; + + expected.sort(function(a, b) { + if (a.description < b.description) { + return -1; + } else if (a.description > b.description) { + return 1; + } else { + return 0; + } + }); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .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(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDescs = new Array(expected.length), + expectedDesc, foundDesc, i; + + for (i = 0; i < expected.length; i++) { + expectedDescs[i] = expected[i].description; + } + + expectedDesc = expected.length > 1 + ? expectedDescs.slice(0, -1).join(", ") + + " or " + + expectedDescs[expected.length - 1] + : expectedDescs[0]; + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + var posDetails = peg$computePosDetails(pos), + found = pos < input.length ? input.charAt(pos) : null; + + if (expected !== null) { + cleanupExpected(expected); + } + + return new SyntaxError( + message !== null ? message : buildMessage(expected, found), + expected, + found, + pos, + posDetails.line, + posDetails.column + ); + } + + function peg$parsestart() { + var s0; + + s0 = peg$parsemessageFormatPattern(); + + return s0; + } + + function peg$parsemessageFormatPattern() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsemessageFormatElement(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsemessageFormatElement(); + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c1(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsemessageFormatElement() { + var s0; + + s0 = peg$parsemessageTextElement(); + if (s0 === peg$FAILED) { + s0 = peg$parseargumentElement(); + } + + return s0; + } + + function peg$parsemessageText() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s4 = peg$parsechars(); + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s4 = peg$parsechars(); + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c3(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsews(); + if (s1 !== peg$FAILED) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parsemessageTextElement() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsemessageText(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c4(s1); + } + s0 = s1; + + return s0; + } + + function peg$parseargument() { + var s0, s1, s2; + + s0 = peg$parsenumber(); + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + if (peg$c5.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + if (peg$c5.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseargumentElement() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseargument(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 44) { + s6 = peg$c10; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + s8 = peg$parseelementFormat(); + if (s8 !== peg$FAILED) { + s6 = [s6, s7, s8]; + s5 = s6; + } else { + peg$currPos = s5; + s5 = peg$c2; + } + } else { + peg$currPos = s5; + s5 = peg$c2; + } + } else { + peg$currPos = s5; + s5 = peg$c2; + } + if (s5 === peg$FAILED) { + s5 = peg$c9; + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s7 = peg$c12; + peg$currPos++; + } else { + s7 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c14(s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseelementFormat() { + var s0; + + s0 = peg$parsesimpleFormat(); + if (s0 === peg$FAILED) { + s0 = peg$parsepluralFormat(); + if (s0 === peg$FAILED) { + s0 = peg$parseselectOrdinalFormat(); + if (s0 === peg$FAILED) { + s0 = peg$parseselectFormat(); + } + } + } + + return s0; + } + + function peg$parsesimpleFormat() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6) === peg$c15) { + s1 = peg$c15; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + if (s1 === peg$FAILED) { + if (input.substr(peg$currPos, 4) === peg$c17) { + s1 = peg$c17; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s1 === peg$FAILED) { + if (input.substr(peg$currPos, 4) === peg$c19) { + s1 = peg$c19; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c10; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsechars(); + if (s6 !== peg$FAILED) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 === peg$FAILED) { + s3 = peg$c9; + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c21(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsepluralFormat() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6) === peg$c22) { + s1 = peg$c22; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s3 = peg$c10; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsepluralStyle(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c24(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseselectOrdinalFormat() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 13) === peg$c25) { + s1 = peg$c25; + peg$currPos += 13; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s3 = peg$c10; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsepluralStyle(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c27(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseselectFormat() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6) === peg$c28) { + s1 = peg$c28; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c29); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s3 = peg$c10; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseoptionalFormatPattern(); + if (s6 !== peg$FAILED) { + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseoptionalFormatPattern(); + } + } else { + s5 = peg$c2; + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c30(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseselector() { + var s0, s1, s2, s3; + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c31; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c32); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsenumber(); + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$parsechars(); + } -/***/ }, -/* 77 */ -/***/ function(module, exports, __webpack_require__) { + return s0; + } - var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*! Native Promise Only - v0.7.6-a (c) Kyle Simpson - MIT License: http://getify.mit-license.org - */ - !function(t,n,e){n[t]=n[t]||e(),"undefined"!=typeof module&&module.exports?module.exports=n[t]:"function"=="function"&&__webpack_require__(78)&&!(__WEBPACK_AMD_DEFINE_RESULT__ = function(){return n[t]}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))}("Promise","undefined"!=typeof global?global:this,function(){"use strict";function t(t,n){l.add(t,n),h||(h=y(l.drain))}function n(t){var n,e=typeof t;return null==t||"object"!=e&&"function"!=e||(n=t.then),"function"==typeof n?n:!1}function e(){for(var t=0;t0&&t(e,a))}catch(s){i.call(u||new f(a),s)}}}function i(n){var o=this;o.triggered||(o.triggered=!0,o.def&&(o=o.def),o.msg=n,o.state=2,o.chain.length>0&&t(e,o))}function c(t,n,e,o){for(var r=0;r= 0) { - item._idleTimeoutId = setTimeout(function onTimeout() { - if (item._onTimeout) - item._onTimeout(); - }, msecs); - } - }; + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsews(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsews(); + } + if (s1 !== peg$FAILED) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } - // That's not how node.js implements it but the exposed api is the same. - exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) { - var id = nextImmediateId++; - var args = arguments.length < 2 ? false : slice.call(arguments, 1); + return s0; + } - immediateIds[id] = true; + function peg$parsedigit() { + var s0; - nextTick(function onNextTick() { - if (immediateIds[id]) { - // fn.call() is faster so we optimize for the common use-case - // @see http://jsperf.com/call-apply-segu - if (args) { - fn.apply(null, args); + if (peg$c42.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; } else { - fn.call(null); + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c43); } } - // Prevent ids from leaking - exports.clearImmediate(id); + + return s0; } - }); - return id; - }; + function peg$parsehexDigit() { + var s0; - exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { - delete immediateIds[id]; - }; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(79).setImmediate, __webpack_require__(79).clearImmediate)) + if (peg$c44.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } -/***/ }, -/* 80 */ -/***/ function(module, exports, __webpack_require__) { + return s0; + } - // shim for using process in browser + function peg$parsenumber() { + var s0, s1, s2, s3, s4, s5; - var process = module.exports = {}; - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 48) { + s1 = peg$c46; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s1 === peg$FAILED) { + s1 = peg$currPos; + s2 = peg$currPos; + if (peg$c48.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsedigit(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsedigit(); + } + if (s4 !== peg$FAILED) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c50(s1); + } + s0 = s1; - function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); + return s0; } - } - function drainQueue() { - if (draining) { - return; - } - var timeout = setTimeout(cleanUpNextTick); - draining = true; + function peg$parsechar() { + var s0, s1, s2, s3, s4, s5, s6, s7; - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - currentQueue[queueIndex].run(); + if (peg$c51.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c53) { + s1 = peg$c53; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c54); } } - queueIndex = -1; - len = queue.length; + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c55(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c56) { + s1 = peg$c56; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c58(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c59) { + s1 = peg$c59; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c61(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c62) { + s1 = peg$c62; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$currPos; + s4 = peg$parsehexDigit(); + if (s4 !== peg$FAILED) { + s5 = peg$parsehexDigit(); + if (s5 !== peg$FAILED) { + s6 = peg$parsehexDigit(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehexDigit(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== peg$FAILED) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c64(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + } + } + + return s0; } - currentQueue = null; - draining = false; - clearTimeout(timeout); - } - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; + function peg$parsechars() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsechar(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsechar(); } - } - queue.push(new Item(fun, args)); - if (!draining) { - setTimeout(drainQueue, 0); - } - }; + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + s0 = s1; - // v8 likes predictible objects - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - process.versions = {}; + return s0; + } - function noop() {} + peg$result = peg$startRuleFunction(); - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail({ type: "end", description: "end of input" }); + } - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; + throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); + } + } - // TODO(shtylman) - process.cwd = function () { return '/' }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - process.umask = function() { return 0; }; + return { + SyntaxError: SyntaxError, + parse: parse + }; + })(); + //# sourceMappingURL=parser.js.map /***/ } /******/ ]); \ No newline at end of file diff --git a/grommet.min.js b/grommet.min.js index d60adf3..66cf1fb 100644 --- a/grommet.min.js +++ b/grommet.min.js @@ -1,7 +1,19 @@ -var Grommet=function(e){function t(r){if(n[r])return n[r].exports;var s=n[r]={exports:{},id:r,loaded:!1};return e[r].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r={App:n(1),CheckBox:n(2),Document:n(3),Donut:n(4),Footer:n(5),Form:n(6),FormField:n(7),Header:n(8),Label:n(9),Login:n(10),LoginForm:n(11),Menu:n(12),Meter:n(13),Panel:n(14),RadioButton:n(15),Search:n(16),SearchInput:n(17),Section:n(18),Table:n(19),Tiles:n(20),Tile:n(21),Title:n(22),Object:n(23),TBD:n(24),Icons:{Clear:n(25),DragHandle:n(26),Edit:n(27),Filter:n(28),Help:n(29),More:n(30),Next:n(31),Previous:n(32),Search:n(33),SearchPlus:n(34),Spinning:n(35),Status:n(36)},Mixins:{KeyboardAccelerators:n(37),ReactLayeredComponent:n(38)},Actions:n(39),SessionStore:n(40),Rest:n(41)};e.exports=r},function(e,t,n){var r=n(42),s=r.createClass({displayName:"App",propTypes:{centered:r.PropTypes.bool},getDefaultProps:function(){return{centered:!0}},render:function(){var e=["app"];return this.props.centered&&e.push("app--centered"),this.props.inline&&e.push("app--inline"),this.props.className&&e.push(this.props.className),r.createElement("div",{className:e.join(" ")},this.props.children)}});e.exports=s},function(e,t,n){var r=n(42),s=r.createClass({displayName:"CheckBox",propTypes:{checked:r.PropTypes.bool,defaultChecked:r.PropTypes.bool,id:r.PropTypes.string.isRequired,label:r.PropTypes.string.isRequired,name:r.PropTypes.string,onChange:r.PropTypes.func},render:function(){var e=["check-box"];return this.props.className&&e.push(this.props.className),r.createElement("span",{className:e.join(" ")},r.createElement("input",{className:"check-box__input",id:this.props.id,name:this.props.name,type:"checkbox",checked:this.props.checked,defaultChecked:this.props.defaultChecked,onChange:this.props.onChange}),r.createElement("label",{className:"check-box__label checkbox",htmlFor:this.props.id},this.props.label))}});e.exports=s},function(e,t,n){var r=n(42),s=r.createClass({displayName:"GrommetDocument",propTypes:{colorIndex:r.PropTypes.string},render:function(){var e=["document"];return this.props.colorIndex&&e.push("header-color-index-"+this.props.colorIndex),r.createElement("div",{ref:"document",className:e.join(" ")},r.createElement("div",{className:"document__content"},this.props.children))}});e.exports=s},function(e,t,n){function r(e,t,n,r){var s=(r-90)*Math.PI/180;return{x:e+n*Math.cos(s),y:t+n*Math.sin(s)}}function s(e,t,n,s,i){var o=r(e,t,n,i),a=r(e,t,n,s),l=180>=i-s?"0":"1",c=["M",o.x,o.y,"A",n,n,0,l,0,a.x,a.y].join(" ");return c}var i=n(42),o=192,a=i.createClass({displayName:"Donut",propTypes:{legend:i.PropTypes.bool,series:i.PropTypes.arrayOf(i.PropTypes.shape({label:i.PropTypes.string,value:i.PropTypes.number,colorIndex:i.PropTypes.oneOfType([i.PropTypes.number,i.PropTypes.string]),onClick:i.PropTypes.func})).isRequired,units:i.PropTypes.string},_initialTimeout:function(){this.setState({initial:!1,activeIndex:0}),clearTimeout(this._timeout)},_onMouseOver:function(e){this.setState({initial:!1,activeIndex:e})},_onMouseOut:function(){this.setState({initial:!1,activeIndex:0})},_onResize:function(){var e=window.innerWidth/window.innerHeight;.8>e?this.setState({orientation:"portrait"}):e>1.2&&this.setState({orientation:"landscape"});var t=this.refs.donut.getDOMNode().parentNode,n=t.offsetWidth,r=t.offsetHeight;this.setState(o>r||o>n||2*o>n&&2*o>r?{size:"small"}:{size:null})},getInitialState:function(){return{initial:!0,activeIndex:0,legend:!1,orientation:"portrait"}},componentDidMount:function(){this._timeout=setTimeout(this._initialTimeout,10),this.setState({initial:!0,activeIndex:0}),window.addEventListener("resize",this._onResize),setTimeout(this._onResize,10)},componentWillUnmount:function(){clearTimeout(this._timeout),this._timeout=null,window.removeEventListener("resize",this._onResize)},_itemColorIndex:function(e,t){return e.colorIndex||"graph-"+(t+1)},_renderLegend:function(){var e=0,t=this.props.series.map(function(t,n){var r=["donut__legend-item"];this.state.activeIndex===n&&r.push("donut__legend-item--active");var s=this._itemColorIndex(t,n);return e+=t.value,i.createElement("li",{key:t.label,className:r.join(" "),onMouseOver:this._onMouseOver.bind(this,n),onMouseOut:this._onMouseOut.bind(this,n)},i.createElement("svg",{className:"donut__legend-item-swatch color-index-"+s,viewBox:"0 0 12 12"},i.createElement("path",{className:t.className,d:"M 5 0 l 0 12"})),i.createElement("span",{className:"donut__legend-item-label"},t.label),i.createElement("span",{className:"donut__legend-item-value"},t.value),i.createElement("span",{className:"donut__legend-item-units"},this.props.units))},this);return i.createElement("ol",{className:"donut__legend"},t,i.createElement("li",{className:"donut__legend-total"},i.createElement("span",{className:"donut__legend-total-label"},"Total"),i.createElement("span",{className:"donut__legend-total-value"},e),i.createElement("span",{className:"donut__legend-total-units"},this.props.units)))},render:function(){var e=["donut","donut--"+this.state.orientation];this.state.size&&e.push("donut--"+this.state.size);var t=0;this.props.series.some(function(e){t+=e.value});var n=0,r=360/t,a=null,l=null,c=null,p=this.props.series.map(function(e,t){var p=Math.min(360,Math.max(10,n+r*e.value)),u=84,h=s(o/2,o/2,u,n,p);n=p;var d=this._itemColorIndex(e,t),m=["donut__slice"];return m.push("color-index-"+d),this.state.activeIndex===t&&(m.push("donut__slice--active"),a=e.value,l=e.units,c=e.label),i.createElement("path",{key:e.label,fill:"none",className:m.join(" "),d:h,onMouseOver:this._onMouseOver.bind(null,t),onMouseOut:this._onMouseOut.bind(null,t),onClick:e.onClick})},this),u=null;return this.props.legend&&(u=this._renderLegend()),i.createElement("div",{ref:"donut",className:e.join(" ")},i.createElement("div",{className:"donut__graphic-container"},i.createElement("svg",{className:"donut__graphic",viewBox:"0 0 "+o+" "+o,preserveAspectRatio:"xMidYMid meet"},i.createElement("g",null,p)),i.createElement("div",{className:"donut__active"},i.createElement("div",{className:"donut__active-value large-number-font"},a,i.createElement("span",{className:"donut__active-units large-number-font"},l)),i.createElement("div",{className:"donut__active-label"},c))),u)}});e.exports=a},function(e,t,n){var r=n(42),s=n(43),i=r.createClass({displayName:"Footer",propTypes:{centered:r.PropTypes.bool,colorIndex:r.PropTypes.string,primary:r.PropTypes.bool,scrollTop:r.PropTypes.bool},_updateState:function(){this.setState({scrolled:this._scrollable.scrollTop>0})},_onClickTop:function(){this._scrollable.scrollTop=0},_onScroll:function(){clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(this._updateState,10)},getInitialState:function(){return{scrolled:!1}},componentDidMount:function(){this._scrollable=this.refs.footer.getDOMNode().parentNode.parentNode,this._scrollable.addEventListener("scroll",this._onScroll)},componentWillUnmount:function(){this._scrollable.removeEventListener("scroll",this._onScroll)},componentWillReceiveProps:function(){this.setState({scrolled:!1})},componentDidUpdate:function(){this.state.scrolled||(this._scrollable.scrollTop=0)},render:function(){var e=["footer"];this.props.primary&&e.push("footer--primary"),this.props.centered&&e.push("footer--centered"),this.props.colorIndex&&e.push("background-color-index-"+this.props.colorIndex),this.props.className&&e.push(this.props.className);var t=null;return this.props.scrollTop&&this.state.scrolled&&(t=r.createElement("div",{className:"footer__top control-icon",onClick:this._onClickTop},r.createElement(s,null))),r.createElement("div",{ref:"footer",className:e.join(" ")},r.createElement("div",{className:"footer__content"},this.props.children,t))}});e.exports=i},function(e,t,n){var r=n(42),s=r.createClass({displayName:"Form",propTypes:{compact:r.PropTypes.bool,onSubmit:r.PropTypes.func,className:r.PropTypes.string},render:function(){var e=["form"];return this.props.compact&&e.push("form--compact"),this.props.className&&e.push(this.props.className),r.createElement("form",{className:e.join(" "),onSubmit:this.props.onSubmit},this.props.children)}});e.exports=s},function(e,t,n){var r=n(42),s="form-field",i=r.createClass({displayName:"FormField",propTypes:{error:r.PropTypes.string,help:r.PropTypes.node,htmlFor:r.PropTypes.string,label:r.PropTypes.string,required:r.PropTypes.bool},render:function(){var e=[s];this.props.required&&e.push(s+"--required"),this.props.htmlFor&&e.push(s+"--text");var t=null;this.props.error&&(e.push(s+"--error"),t=r.createElement("span",{className:s+"__error"},this.props.error));var n=null;return this.props.help&&(n=r.createElement("span",{className:s+"__help"},this.props.help)),r.createElement("div",{className:e.join(" ")},r.createElement("label",{className:s+"__label",htmlFor:this.props.htmlFor},this.props.label),r.createElement("span",{className:s+"__container"},r.createElement("span",{className:s+"__contents"},this.props.children),n,t))}});e.exports=i},function(e,t,n){var r=n(42),s="header",i=r.createClass({displayName:"Header",propTypes:{colorIndex:r.PropTypes.string,fixed:r.PropTypes.bool,flush:r.PropTypes.bool,large:r.PropTypes.bool,primary:r.PropTypes.bool,small:r.PropTypes.bool},getDefaultProps:function(){return{flush:!0,large:!1,primary:!1,small:!1}},_onResize:function(){this._alignMirror()},_alignMirror:function(){var e=this.refs.content.getDOMNode(),t=this.refs.mirror.getDOMNode(),n=t.getBoundingClientRect();e.style.width=""+Math.floor(n.width)+"px";var r=e.getBoundingClientRect();t.style.height=""+Math.floor(r.height)+"px"},componentDidMount:function(){this.props.fixed&&(this._alignMirror(),window.addEventListener("resize",this._onResize))},componentDidUpdate:function(){this.props.fixed&&this._alignMirror()},componentWillUnmount:function(){this.props.fixed&&window.removeEventListener("resize",this._onResize)},render:function(){var e=[s];this.props.primary&&e.push(s+"--primary"),this.props.fixed&&e.push(s+"--fixed"),this.props.flush&&e.push(s+"--flush"),this.props.large&&e.push(s+"--large"),this.props.small&&e.push(s+"--small"),this.props.className&&e.push(this.props.className);var t=null;this.props.fixed&&(t=r.createElement("div",{ref:"mirror",className:s+"__mirror"}));var n=r.createElement("div",{ref:"content",className:s+"__content"},this.props.children);if(this.props.colorIndex||this.props.fixed){var i=[s+"__wrapper"];this.props.colorIndex&&i.push("background-color-index-"+this.props.colorIndex),n=r.createElement("div",{className:i.join(" ")},n)}return r.createElement("div",{className:e.join(" ")},t,n)}});e.exports=i},function(e,t,n){var r=n(42),s=r.createClass({displayName:"Label",propTypes:{icon:r.PropTypes.node,text:r.PropTypes.string},render:function(){var e=null,t=null;return this.props.icon&&(e=r.createElement("span",{className:"label__icon control-icon"},this.props.icon)),this.props.text&&(t=r.createElement("span",{className:"label__text"},this.props.text)),r.createElement("div",{className:"label"},e,t)}});e.exports=s},function(e,t,n){var r=n(42),s=r.createClass({displayName:"Login",propTypes:{background:r.PropTypes.string},_onResize:function(){this.adjustBackground()},adjustBackground:function(){var e=window.innerWidth/window.innerHeight,t=this.refs.background.getDOMNode(),n=t.scrollWidth/t.scrollHeight;this.setState({orientation:n>e?"portrait":"landscape"})},getInitialState:function(){return{orientation:null}},componentDidMount:function(){window.addEventListener("resize",this._onResize),setTimeout(this.adjustBackground,300)},componentWillUnmount:function(){window.removeEventListener("resize",this._onResize)},render:function(){var e=null;if(this.props.background){var t=["login__background"];this.state.orientation&&t.push("login__background--"+this.state.orientation),e=r.createElement("img",{ref:"background",className:t.join(" "),src:this.props.background})}return r.createElement("div",{className:"login"},e,r.createElement("div",{className:"login__container"},this.props.children))}});e.exports=s},function(e,t,n){var r=n(42),s=n(6),i=n(7),o=n(2),a="login-form",l=r.createClass({displayName:"LoginForm",propTypes:{logo:r.PropTypes.node,title:r.PropTypes.string,rememberMe:r.PropTypes.bool,forgotPassword:r.PropTypes.node,errors:r.PropTypes.arrayOf(r.PropTypes.string),onSubmit:r.PropTypes.func},_onSubmit:function(e){e.preventDefault();var t=this.refs.username.getDOMNode().value.trim(),n=this.refs.password.getDOMNode().value.trim();this.props.onSubmit&&this.props.onSubmit({username:t,password:n})},getDefaultProps:function(){return{errors:[]}},componentDidMount:function(){this.refs.username.getDOMNode().focus()},render:function(){var e=[a],t=this.props.errors.map(function(e,t){return r.createElement("div",{key:t,className:a+"__error"},e)}),n=null;this.props.logo&&(n=r.createElement("div",{className:a+"__logo"},this.props.logo));var l=null;this.props.title&&(l=r.createElement("h1",{className:a+"__title"},this.props.title));var c=null;if(this.props.rememberMe||this.props.forgotPassword){var p=null;this.props.rememberMe&&(p=r.createElement(o,{className:a+"__remember-me",id:"remember-me",label:"Remember me"})),c=r.createElement("div",{className:a+"__footer"},p,this.props.forgotPassword)}return r.createElement(s,{className:e.join(" "),onSubmit:this._onSubmit},n,l,r.createElement("fieldset",null,r.createElement(i,{htmlFor:"username",label:"Username"},r.createElement("input",{id:"username",ref:"username",type:"text"})),r.createElement(i,{htmlFor:"password",label:"Password"},r.createElement("input",{id:"password",ref:"password",type:"password"}))),t,r.createElement("input",{type:"submit",className:a+"__submit primary call-to-action",value:"Log in"}),c)}});e.exports=l},function(e,t,n){var r=n(42),s=n(38),i=n(37),o=n(44),a=n(30),l=n(45),c="menu",p=r.createClass({displayName:"MenuLayer",propTypes:{align:r.PropTypes.oneOf(["top","bottom","left","right"]),direction:r.PropTypes.oneOf(["up","down","left","right"]),onClick:r.PropTypes.func.isRequired,router:r.PropTypes.func},childContextTypes:{router:r.PropTypes.func},getChildContext:function(){return{router:this.props.router}},render:function(){var e=[c+"__layer"];return this.props.direction&&e.push(c+"__layer--"+this.props.direction),this.props.align&&e.push(c+"__layer--align-"+this.props.align),r.createElement("div",{id:"menu-layer",className:e.join(" "),onClick:this.props.onClick},this.props.children)}}),u=r.createClass({displayName:"Menu",propTypes:{align:r.PropTypes.oneOf(["top","bottom","left","right"]),collapse:r.PropTypes.bool,direction:r.PropTypes.oneOf(["up","down","left","right"]),icon:r.PropTypes.node,label:r.PropTypes.string,primary:r.PropTypes.bool,small:r.PropTypes.bool},contextTypes:{router:r.PropTypes.func},getDefaultProps:function(){return{align:"left",direction:"down",small:!1}},mixins:[s,i,o],_onOpen:function(e){e.preventDefault(),this.setState({active:!0})},_onClose:function(){this.setState({active:!1})},_onFocusControl:function(){this.setState({controlFocused:!0})},_onBlurControl:function(){this.setState({controlFocused:!1})},getInitialState:function(){return{controlFocused:!1,active:!1,inline:!this.props.label&&!this.props.icon&&!this.props.collapse}},componentDidUpdate:function(e,t){var n={esc:this._onClose,space:this._onClose,tab:this._onClose},r={space:this._onOpen,down:this._onOpen};if(!this.state.controlFocused&&t.controlFocused&&this.stopListeningToKeyboard(r),!this.state.active&&t.active&&(document.removeEventListener("click",this._onClose),this.stopListeningToKeyboard(n),this.stopOverlay()),this.state.controlFocused&&(!t.controlFocused||!this.state.active&&t.active)&&this.startListeningToKeyboard(r),this.state.active&&!t.active){document.addEventListener("click",this._onClose),this.startListeningToKeyboard(n);var s=this.refs.control.getDOMNode(),i=document.getElementById("menu-layer"),o=i.querySelectorAll("."+c+"__control")[0],a=i.querySelectorAll("svg, img")[0],l=window.getComputedStyle(s).fontSize;o.style.fontSize=l;var p=s.clientHeight;a&&p<=a.clientHeight+1&&("down"===this.props.direction?o.style.marginTop="-1px":"up"===this.props.direction&&(o.style.marginBottom="1px")),o.style.height=p+"px",o.style.lineHeight=p+"px",this.startOverlay(s,i,this.props.align)}},componentWillUnmount:function(){document.removeEventListener("click",this._onClose)},_renderControl:function(){var e=null,t=null,n=c+"__control",s=[n];return this.props.icon?(s.push(n+"--labelled"),t=this.props.icon):(s.push(n+"--fixed-label"),t=r.createElement(a,null)),e=this.props.label?r.createElement("div",{className:s.join(" ")},r.createElement("div",{className:n+"-icon"},t),r.createElement("span",{className:n+"-label"},this.props.label),r.createElement(l,{className:n+"-drop-icon"})):r.createElement("div",{className:n},t)},_classes:function(e){var t=[e];return this.props.direction&&t.push(e+"--"+this.props.direction),this.props.align&&t.push(e+"--align-"+this.props.align),this.props.small&&t.push(e+"--small"),this.props.primary&&t.push(e+"--primary"),t},render:function(){var e=this._classes(c);if(this.state.inline?e.push(c+"--inline"):(e.push(c+"--controlled"),this.props.label&&e.push(c+"--labelled")),this.props.className&&e.push(this.props.className),this.state.inline)return r.createElement("div",{className:e.join(" "),onClick:this._onClose},this.props.children);var t=this._renderControl();return r.createElement("div",{ref:"control",className:e.join(" "),tabIndex:"0",onClick:this._onOpen,onFocus:this._onFocusControl,onBlur:this._onBlurControl},t)},renderLayer:function(){if(this.state.active){var e=this._renderControl(),t=null,n=null;return"up"===this.props.direction?(t=this.props.children,n=e):(t=e,n=this.props.children),r.createElement(p,{router:this.context.router,align:this.props.align,direction:this.props.direction,onClick:this._onClose},t,n)}return r.createElement("span",null)}});e.exports=u},function(e,t,n){var r=n(42),s=192,i=24,o=i/2,a=r.createClass({displayName:"Meter",propTypes:{max:r.PropTypes.number,min:r.PropTypes.number,threshold:r.PropTypes.number,units:r.PropTypes.string,value:r.PropTypes.number},getDefaultProps:function(){return{max:100,min:0}},render:function(){var e=["meter"];this.props.className&&e.push(this.props.className);var t=s/(this.props.max-this.props.min),n=t*(this.props.value-this.props.min),a="M0,"+o+" L"+n+","+o,l=null;return this.props.threshold&&(n=t*(this.props.threshold-this.props.min),l=r.createElement("path",{className:"meter__threshold",d:"M"+n+",0 L"+n+","+i})),r.createElement("div",{className:e.join(" ")},r.createElement("svg",{className:"meter__graphic",viewBox:"0 0 "+s+" "+i,preserveAspectRatio:"xMidYMid meet"},r.createElement("g",null,r.createElement("path",{className:"meter__value",d:a}),l)),r.createElement("span",{className:"meter__label"},r.createElement("span",{className:"meter__label-value"},this.props.value),r.createElement("span",{className:"meter__label-units"},this.props.units)))}});e.exports=a},function(e,t,n){var r=n(42),s=r.createClass({displayName:"Panel",propTypes:{direction:r.PropTypes.string,index:r.PropTypes.oneOf([1,2])},render:function(){var e=["panel"];"horizontal"===this.props.direction&&e.push("panel--horizontal"),this.props.index&&e.push("panel--index-"+this.props.index);var t=null;return this.props.title&&(t=r.createElement("h2",{className:"panel__title"},this.props.title)),r.createElement("div",{className:e.join(" ")},t,this.props.children)}});e.exports=s},function(e,t,n){var r=n(42),s=r.createClass({displayName:"RadioButton",propTypes:{checked:r.PropTypes.bool,defaultChecked:r.PropTypes.bool,id:r.PropTypes.string.isRequired,label:r.PropTypes.string.isRequired,name:r.PropTypes.string,onChange:r.PropTypes.func},render:function(){var e=["radio-button"];return this.props.className&&e.push(this.props.className),r.createElement("span",{className:e.join(" ")},r.createElement("input",{className:"radio-button__input",id:this.props.id,name:this.props.name,type:"radio",checked:this.props.checked,defaultChecked:this.props.defaultChecked,onChange:this.props.onChange}),r.createElement("label",{className:"radio-button__label radio",htmlFor:this.props.id},this.props.label))}});e.exports=s},function(e,t,n){var r=n(42),s=n(38),i=n(37),o=n(44),a=n(33),l="search",c=r.createClass({displayName:"Search",propTypes:{align:r.PropTypes.oneOf(["left","right"]),defaultValue:r.PropTypes.string,inline:r.PropTypes.bool,onChange:r.PropTypes.func,placeHolder:r.PropTypes.string,suggestions:r.PropTypes.arrayOf(r.PropTypes.string)},getDefaultProps:function(){return{align:"left",inline:!1,placeHolder:"Search"}},mixins:[s,i,o],_onAddLayer:function(e){e.preventDefault(),this.setState({layer:!0,activeSuggestionIndex:-1})},_onRemoveLayer:function(){this.setState({layer:!1})},_onFocusControl:function(){this.setState({controlFocused:!0,layer:!0,activeSuggestionIndex:-1})},_onBlurControl:function(){this.setState({controlFocused:!1})},_onFocusInput:function(){this.refs.input.getDOMNode().select(),this.setState({layer:!this.props.inline||this.props.suggestions,activeSuggestionIndex:-1})},_onBlurInput:function(){},_onChangeInput:function(e){this.setState({activeSuggestionIndex:-1}),this.props.onChange&&this.props.onChange(e.target.value)},_onNextSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.min(e+1,this.props.suggestions.length-1),this.setState({activeSuggestionIndex:e})},_onPreviousSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.max(e-1,0),this.setState({activeSuggestionIndex:e})},_onEnter:function(){if(this.state.activeSuggestionIndex>=0){var e=this.props.suggestions[this.state.activeSuggestionIndex];this.props.onChange&&this.props.onChange(e)}this._onRemoveLayer()},_onClickSuggestion:function(e){this.props.onChange&&this.props.onChange(e),this._onRemoveLayer()},_onSink:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},getInitialState:function(){return{align:"left",controlFocused:!1,layer:!1,activeSuggestionIndex:-1}},componentDidUpdate:function(e,t){var n={esc:this._onRemoveLayer,tab:this._onRemoveLayer,up:this._onPreviousSuggestion,down:this._onNextSuggestion,enter:this._onEnter},r={space:this._onAddLayer};if(!this.state.controlFocused&&t.controlFocused&&this.stopListeningToKeyboard(r),!this.state.layer&&t.layer&&(document.removeEventListener("click",this._onRemoveLayer),this.stopListeningToKeyboard(n),this.stopOverlay()),this.state.controlFocused&&!t.controlFocused&&this.startListeningToKeyboard(r),this.state.layer&&!t.layer){document.addEventListener("click",this._onRemoveLayer),this.startListeningToKeyboard(n);var s=(this.refs.control?this.refs.control:this.refs.input).getDOMNode(),i=document.getElementById("search-layer"),o=i.querySelectorAll(".search__control")[0],a=i.querySelectorAll("svg")[0],l=i.querySelectorAll(".search__input")[0],c=window.getComputedStyle(s).fontSize;l.style.fontSize=c;var p=s.clientHeight;a&&p<=a.clientHeight&&(o.style.marginTop="-2px"),l.style.height=p+"px",o&&(o.style.height=p+"px",o.style.lineHeight=p+"px"),this.startOverlay(s,i,this.props.align),l.focus()}},componentWillUnmount:function(){document.removeEventListener("click",this._onRemoveLayer)},focus:function(){var e=this.refs.input||this.refs.control;e&&e.getDOMNode().focus()},_createControl:function(){var e=l+"__control";return r.createElement("div",{className:e},r.createElement(a,null))},_classes:function(e){var t=[e];return t.push(this.props.inline?e+"--inline":e+"--controlled"),this.props.align&&t.push(e+"--align-"+this.props.align),t},render:function(){var e=this._classes(l);if(this.props.className&&e.push(this.props.className),this.props.inline){var t=this.props.suggestions?!0:!1;return r.createElement("div",{className:e.join(" ")},r.createElement("input",{ref:"input",type:"search",placeholder:this.props.placeHolder,value:this.props.defaultValue,className:l+"__input",readOnly:t,onFocus:this._onFocusInput,onBlur:this._onBlurInput,onChange:this._onChangeInput}))}var n=this._createControl();return r.createElement("div",{ref:"control",className:e.join(" "),tabIndex:"0",onClick:this._onAddLayer,onFocus:this._onFocusControl,onBlur:this._onBlurControl},n)},renderLayer:function(){if(this.state.layer){var e=this._classes(l+"__layer"),t=null;this.props.suggestions&&(t=this.props.suggestions.map(function(e,t){var n=[l+"__suggestion"];return t===this.state.activeSuggestionIndex&&n.push(l+"__suggestion--active"),r.createElement("div",{key:e,className:n.join(" "),onClick:this._onClickSuggestion.bind(this,e)},e)},this));var n=r.createElement("div",{className:l+"__layer-contents",onClick:this._onSink},r.createElement("input",{type:"search",defaultValue:this.props.defaultValue,className:l+"__input",onChange:this._onChangeInput}),r.createElement("div",{className:l+"__suggestions"},t));if(!this.props.inline){var s=this._createControl(),i="right"===this.props.align,o=i?n:s,a=i?s:n;n=r.createElement("div",{className:l+"__layer-header"},o,a)}return r.createElement("div",{id:"search-layer",className:e.join(" ")},n)}return r.createElement("span",null)}});e.exports=c},function(e,t,n){var r=n(42),s=n(38),i=n(37),o=n(44),a=n(33),l="search-input",c=r.createClass({displayName:"SearchInput",propTypes:{defaultValue:r.PropTypes.string,id:r.PropTypes.string,name:r.PropTypes.string,onChange:r.PropTypes.func,onSearch:r.PropTypes.func,suggestions:r.PropTypes.arrayOf(r.PropTypes.string),value:r.PropTypes.string},mixins:[s,i,o],_onInputChange:function(e){this.props.onChange(e.target.value)},_onOpen:function(e){e.preventDefault(),this.setState({active:!0,activeSuggestionIndex:-1})},_onClose:function(){this.setState({active:!1})},_onSearchChange:function(e){this.setState({activeSuggestionIndex:-1}),this.props.onSearch(e.target.value)},_onNextSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.min(e+1,this.props.suggestions.length-1),this.setState({activeSuggestionIndex:e})},_onPreviousSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.max(e-1,0),this.setState({activeSuggestionIndex:e})},_onEnter:function(){if(this.setState({active:!1}),this._activation(!1),this.state.activeSuggestionIndex>=0){var e=this.props.suggestions[this.state.activeSuggestionIndex];this.setState({value:e}),this.props.onChange(e)}},_onClickSuggestion:function(e){this.setState({value:e}),this._activation(!1),this.props.onChange(e)},_activation:function(e){var t={esc:this._onClose,tab:this._onClose,up:this._onPreviousSuggestion,down:this._onNextSuggestion,enter:this._onEnter};if(e){document.addEventListener("click",this._onClose),this.startListeningToKeyboard(t);var n=this.refs.component.getDOMNode(),r=document.getElementById(l+"-layer");this.startOverlay(n,r,"below");var s=r.querySelectorAll("input")[0];s.focus()}else document.removeEventListener("click",this._onClose),this.stopListeningToKeyboard(t),this.stopOverlay()},getInitialState:function(){return{active:!1,defaultValue:this.props.defaultValue,value:this.props.value,activeSuggestionIndex:-1}},componentDidMount:function(){this.state.active&&this._activation(this.state.active)},componentDidUpdate:function(e,t){!this.state.active&&t.active&&this._activation(this.state.active),this.state.active&&!t.active&&this._activation(this.state.active)},componentWillUnmount:function(){this._activation(!1)},render:function(){var e=[l];return this.state.active&&e.push(l+"--active"),this.props.className&&e.push(this.props.className),r.createElement("div",{ref:"component",className:e.join(" ")},r.createElement("input",{className:l+"__input",id:this.props.id,name:this.props.name,value:this.props.value,defaultValue:this.props.defaultValue,onChange:this._onInputChange}),r.createElement("div",{className:l+"__control",onClick:this._onOpen},r.createElement(a,null)))},renderLayer:function(){if(this.state.active){var e=null;return this.props.suggestions&&(e=this.props.suggestions.map(function(e,t){var n=[l+"__layer-suggestion"];return t===this.state.activeSuggestionIndex&&n.push(l+"__layer-suggestion--active"),r.createElement("div",{key:e,className:n.join(" "),onClick:this._onClickSuggestion.bind(this,e)},e)},this)),r.createElement("div",{id:l+"-layer",className:l+"__layer",onClick:this._onClose},r.createElement("input",{type:"search",defaultValue:"",placeholder:"Search",className:l+"__layer-input",onChange:this._onSearchChange}),r.createElement("div",{className:l+"__layer-suggestions"},e))}return r.createElement("span",null)}});e.exports=c},function(e,t,n){var r=n(42),s=r.createClass({displayName:"Section",propTypes:{compact:r.PropTypes.bool,colorIndex:r.PropTypes.string,direction:r.PropTypes.oneOf(["up","down","left","right"]),centered:r.PropTypes.bool,texture:r.PropTypes.string},getDefaultProps:function(){return{colored:!1,direction:"down",small:!1}},render:function(){var e=["section"],t=["section__content"];this.props.compact&&e.push("section--compact"),this.props.centered&&e.push("section--centered"),this.props.direction&&e.push("section--"+this.props.direction),this.props.colorIndex&&e.push("background-color-index-"+this.props.colorIndex),this.props.className&&e.push(this.props.className);var n={};return this.props.texture&&(n.backgroundImage=this.props.texture),r.createElement("div",{className:e.join(" "),style:n},r.createElement("div",{className:t.join(" ")},this.props.children))}});e.exports=s},function(e,t,n){var r=n(42),s=n(35),i=n(46),o="table",a=r.createClass({displayName:"Table",propTypes:{selection:r.PropTypes.number,onMore:r.PropTypes.func,scrollable:r.PropTypes.bool,selectable:r.PropTypes.bool},mixins:[i],getDefaultProps:function(){return{selection:null,scrollable:!1,selectable:!1}},_clearSelection:function(){for(var e=this.refs.table.getDOMNode().querySelectorAll("."+o+"__row--selected"),t=0;t0&&!this._keyboardAcceleratorListening&&(window.addEventListener("keydown",this._onKeyboardAcceleratorKeyPress),this._keyboardAcceleratorListening=!0)},stopListeningToKeyboard:function(e){if(e)for(var t in e)if(e.hasOwnProperty(t)){var n=t;r.hasOwnProperty(t)&&(n=r[t]),delete this._keyboardAcceleratorHandlers[n]}var s=0;for(var i in this._keyboardAcceleratorHandlers)this._keyboardAcceleratorHandlers.hasOwnProperty(i)&&(s+=1);e&&0!==s||(window.removeEventListener("keydown",this._onKeyboardAcceleratorKeyPress),this._keyboardAcceleratorHandlers={},this._keyboardAcceleratorListening=!1)},componentWillUnmount:function(){this.stopListeningToKeyboard()}};e.exports=s},function(e,t,n){var r=n(42),s={componentWillUnmount:function(){this._unrenderLayer(),document.body.removeChild(this._target)},componentDidUpdate:function(){this._renderLayer()},componentDidMount:function(){this._target=document.createElement("div"),document.body.appendChild(this._target),this._renderLayer()},_renderLayer:function(){r.render(this.renderLayer(),this._target)},_unrenderLayer:function(){r.unmountComponentAtNode(this._target)}};e.exports=s},function(e,t,n){var r=n(54),s=n(41),i=r.createActions({login:{asyncResult:!0},logout:{}});i.login.listen(function(e,t){if(!e||!t)return this.failed(400,{message:"Please provide userName and password."});var n=this;s.post("/rest/login-sessions",{authLoginDomain:"LOCAL",userName:e,password:t,loginMsgAck:!0}).end(function(t,r){return t||!r.ok?n.failed(t,r.body):void n.completed(e,r.body.sessionID)})}),e.exports=i},function(e,t,n){var r=n(54),s=n(39),i=n(47),o="token",a="user",l="loginTime",c="email",p=r.createStore({_data:{id:null,name:null,created:null,email:null,loginError:null},init:function(){this._data.id=i.get(o),this._data.name=i.get(a),this._data.created=i.get(l),this._data.email=i.get(c),this.listenTo(s.login.completed,this._onLoginCompleted),this.listenTo(s.login.failed,this._onLoginFailed),this.listenTo(s.logout,this._onLogout)},_onLoginCompleted:function(e,t){this._data.id=t,this._data.name=e,this._data.created=new Date,this._data.loginError=null,-1!==e.indexOf("@")&&(this._data.email=e),i.set(o,this._data.id),i.set(a,this._data.name),i.set(l,this._data.created),i.set(c,this._data.email),this.trigger(this._data)},_onLoginFailed:function(e,t){this._data.loginError={message:t.message,resolution:t.resolution},this.trigger(this._data)},_onLogout:function(){this._data.id=null,this._data.name=null,this._data.created=null,this._data.email=null,i.remove(o),i.remove(a),i.remove(l),i.remove(c),this.trigger(this._data)},getInitialState:function(){return this._data}});e.exports=p},function(e,t,n){function r(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(null!==r&&void 0!==r)if(Array.isArray(r))for(var s=0;sr?i-=i+s-r:0>i&&(i=0);var o=n.top;"up"===this.props.direction?o=n.top+n.height-t.offsetHeight:"below"===this._overlay.align&&(o=n.top+n.height);var a=window.innerHeight-o;t.style.left=""+i+"px",t.style.width=""+s+"px",t.style.top=""+o+"px",t.style.maxHeight=""+a+"px"},componentWillUnmount:function(){this.stopOverlay()}};e.exports=s},function(e,t,n){var r=n(42),s=r.createClass({displayName:"DropCaret",render:function(){var e="control-icon control-icon-drop-caret";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 48 48",version:"1.1"},r.createElement("g",{fill:"none"},r.createElement("path",{strokeWidth:"2",d:"M12,18l12,9l12-9"})))}});e.exports=s},function(e,t,n){var r=n(55),s=2e3,i=200,o={_infiniteScroll:{indicatorElement:null,scrollParent:null,onEnd:null},_onScroll:function(){clearTimeout(this._infiniteScroll.scrollTimer),this._infiniteScroll.scrollTimer=setTimeout(function(){var e=this._infiniteScroll.scrollParent.getBoundingClientRect(),t=this._infiniteScroll.indicatorElement.getBoundingClientRect();t.bottom<=e.bottom&&this._infiniteScroll.onEnd()}.bind(this),s)},startListeningForScroll:function(e,t){this._infiniteScroll.onEnd=t,this._infiniteScroll.indicatorElement=e,this._infiniteScroll.scrollParent=r.findScrollParents(e)[0],this._infiniteScroll.scrollParent.addEventListener("scroll",this._onScroll),this._infiniteScroll.scrollParent===document&&(this._infiniteScroll.scrollTimer=setTimeout(t,i))},stopListeningForScroll:function(){this._infiniteScroll.scrollParent&&(clearTimeout(this._infiniteScroll.scrollTimer),this._infiniteScroll.scrollParent.removeEventListener("scroll",this._onScroll),this._infiniteScroll.scrollParent=null)},componentWillUnmount:function(){this.stopListeningForScroll()}};e.exports=o},function(e,t,n){var r={get:function(e){return e?decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null:null},set:function(e,t,n,r,s,i){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var o="";if(n)switch(n.constructor){case Number:o=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:o="; expires="+n;break;case Date:o="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+o+(s?"; domain="+s:"")+(r?"; path="+r:"")+(i?"; secure":""),!0},remove:function(e,t,n){return this.has(e)?(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0):!1},has:function(e){return e?new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie):!1},keys:function(){for(var e=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),t=e.length,n=0;t>n;n++)e[n]=decodeURIComponent(e[n]);return e}};e.exports=r},function(e,t,n){var r=n(42),s=r.createClass({displayName:"OK",render:function(){var e="status-icon status-icon-ok";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#43A547"},r.createElement("path",{d:"M0,4.4058651 L0,19.657478 C0,21.7548387 2.41428571,23.9929619 4.68571429,23.9929619 L19.4571429,23.9929619 C21.7285714,23.9929619 24,21.8956012 24,19.657478 L24,4.4058651 C24,2.3085044 21.7285714,0.0703812317 19.4571429,0.0703812317 L4.68571429,0.0703812317 C2.27142857,0.0703812317 0,2.16774194 0,4.4058651 L0,4.4058651 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF",transform:"translate(4.214286, 3.519062)"},r.createElement("path",{d:"M0.0428571429,6.76363636 L0.0428571429,10.5431085 L6.86428571,15.4416422 L15.6642857,4.80703812 L15.6642857,0.0492668622 L6.15,11.2469208 L0.0428571429,6.76363636 Z"})))}});e.exports=s},function(e,t,n){var r=n(42),s=r.createClass({displayName:"ErrorStatus",render:function(){var e="status-icon status-icon-error";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#DC462F"},r.createElement("circle",{cx:"12",cy:"12",r:"12"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF"},r.createElement("rect",{x:"4",y:"10",width:"16",height:"4"})))}});e.exports=s},function(e,t,n){var r=n(42),s=r.createClass({displayName:"Warning",render:function(){var e="status-icon status-icon-warning";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 27 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#F3B51D"},r.createElement("path",{d:"M26.758209,22.8752239 L14.1062687,0.494328358 C13.8268657,-0.071641791 13.2608955,-0.071641791 12.838209,0.494328358 L0.179104478,22.8752239 C-0.100298507,23.441194 0.179104478,24 0.745074627,24 L26.0561194,24 C26.758209,24 27.0376119,23.5773134 26.758209,22.8752239 L26.758209,22.8752239 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF",transform:"translate(12.250746, 7.307463)"},r.createElement("path",{d:"M2.69373134,9.01970149 L0.0214925373,9.01970149 L0.0214925373,0.0143283582 L2.69373134,0.0143283582 L2.69373134,9.01970149 L2.69373134,9.01970149 Z M2.69373134,10.9898507 L0.0214925373,10.9898507 L0.0214925373,13.6620896 L2.69373134,13.6620896 L2.69373134,10.9898507 L2.69373134,10.9898507 Z"})))}});e.exports=s},function(e,t,n){var r=n(42),s=r.createClass({displayName:"Disabled",render:function(){var e="status-icon status-icon-disabled";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#848484"},r.createElement("path",{d:"M12,0 L0,12 L12,24 L24,12 L12,0 L12,0 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF"},r.createElement("circle",{cx:"12",cy:"12",r:"5.5"})))}});e.exports=s},function(e,t,n){var r=n(42),s=r.createClass({displayName:"Unknown",render:function(){var e="status-icon status-icon-unknown";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#848484"},r.createElement("path",{d:"M12,0 L0,12 L12,24 L24,12 L12,0 L12,0 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF",transform:"translate(7.524324, 4.994595)"},r.createElement("path",{d:"M8.89945946,3.97621622 C8.89945946,4.48216216 8.64648649,4.98810811 8.39351351,5.49405405 C8.0172973,5.87027027 7.51135135,6.62918919 6.49945946,7.38810811 C5.99351351,7.76432432 5.74054054,8.14702703 5.6172973,8.4 L5.6172973,8.77621622 C5.49405405,9.02918919 5.49405405,9.53513514 5.49405405,10.1643243 L3.47027027,10.1643243 L3.47027027,9.53513514 C3.47027027,8.90594595 3.59351351,8.0172973 3.84648649,7.51135135 C3.96972973,7.13513514 4.47567568,6.62918919 5.23459459,5.99351351 C5.99351351,5.36432432 6.36972973,4.98162162 6.49945946,4.85837838 C6.75243243,4.60540541 6.87567568,4.35243243 6.87567568,3.97621622 C6.87567568,3.6 6.6227027,3.2172973 6.24648649,2.84108108 C5.87027027,2.46486486 5.23459459,2.33513514 4.60540541,2.33513514 C3.97621622,2.33513514 3.47027027,2.45837838 2.96432432,2.71135135 C2.58810811,2.96432432 2.20540541,3.34054054 2.08216216,3.84648649 L0.0583783784,3.84648649 C0.0583783784,2.83459459 0.564324324,1.95243243 1.32324324,1.19351351 C2.20540541,0.434594595 3.2172973,0.0583783784 4.48216216,0.0583783784 C5.87027027,0.0583783784 7.00540541,0.434594595 7.76432432,1.19351351 C8.51675676,1.95891892 8.89945946,2.96432432 8.89945946,3.97621622 L8.89945946,3.97621622 Z M4.47567568,10.9232432 C3.71675676,10.9232432 2.95783784,11.6821622 2.95783784,12.4410811 C2.95783784,13.2 3.71675676,13.9589189 4.47567568,13.9589189 C5.23459459,13.9589189 5.99351351,13.2 5.99351351,12.4410811 C5.99351351,11.6821622 5.23459459,10.9232432 4.47567568,10.9232432 L4.47567568,10.9232432 Z"})))}});e.exports=s},function(e,t,n){var r=n(42),s=r.createClass({displayName:"Label",render:function(){var e="status-icon status-icon-label";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#CCCCCC"},r.createElement("circle",{cx:"12",cy:"12",r:"12"})))}});e.exports=s},function(e,t,n){e.exports=n(57)},function(e,t,n){e.exports={findScrollParents:function(e){for(var t=[],n=e.parentNode;n;)n.scrollHeight>n.offsetHeight+10&&t.push(n),n=n.parentNode;return 0===t.length&&t.push(document),t}}},function(e,t,n){function r(){}function s(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function i(e){return e===Object(e)}function o(e){if(!i(e))return e;var t=[];for(var n in e)null!=e[n]&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}function a(e){for(var t,n,r={},s=e.split("&"),i=0,o=s.length;o>i;++i)n=s[i],t=n.split("="),r[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return r}function l(e){var t,n,r,s,i=e.split(/\r?\n/),o={};i.pop();for(var a=0,l=i.length;l>a;++a)n=i[a],t=n.indexOf(":"),r=n.slice(0,t).toLowerCase(),s=g(n.slice(t+1)),o[r]=s;return o}function c(e){return e.split(/ *; */).shift()}function p(e){return f(e.split(/ *; */),function(e,t){var n=t.split(/ *= */),r=n.shift(),s=n.shift();return r&&s&&(e[r]=s),e},{})}function u(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=l(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function h(e,t){var n=this;m.call(this),this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new u(n)}catch(r){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=r,n.callback(e)}if(n.emit("response",t),e)return n.callback(e,t);if(t.status>=200&&t.status<300)return n.callback(e,t);var s=new Error(t.statusText||"Unsuccessful HTTP response");s.original=e,s.response=t,s.status=t.status,n.callback(e||s,t)})}function d(e,t){return"function"==typeof t?new h("GET",e).end(t):1==arguments.length?new h("GET",e):new h(e,t)}var m=n(72),f=n(73),v="undefined"==typeof window?this||self:window;d.getXHR=function(){if(!(!v.XMLHttpRequest||v.location&&"file:"==v.location.protocol&&v.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var g="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};d.serializeObject=o,d.parseString=a,d.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},d.serialize={"application/x-www-form-urlencoded":o,"application/json":JSON.stringify},d.parse={"application/x-www-form-urlencoded":a,"application/json":JSON.parse},u.prototype.get=function(e){return this.header[e.toLowerCase()]},u.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=c(t);var n=p(t);for(var r in n)this[r]=n[r]},u.prototype.parseBody=function(e){var t=d.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},u.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},u.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",s=new Error(r);return s.status=this.status,s.method=t,s.url=n,s},d.Response=u,m(h.prototype),h.prototype.use=function(e){return e(this),this},h.prototype.timeout=function(e){return this._timeout=e,this},h.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},h.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},h.prototype.set=function(e,t){if(i(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},h.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},h.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},h.prototype.type=function(e){return this.set("Content-Type",d.types[e]||e),this},h.prototype.accept=function(e){return this.set("Accept",d.types[e]||e),this},h.prototype.auth=function(e,t){var n=btoa(e+":"+t);return this.set("Authorization","Basic "+n),this},h.prototype.query=function(e){return"string"!=typeof e&&(e=o(e)),e&&this._query.push(e),this},h.prototype.field=function(e,t){return this._formData||(this._formData=new v.FormData),this._formData.append(e,t),this},h.prototype.attach=function(e,t,n){return this._formData||(this._formData=new v.FormData),this._formData.append(e,t,n),this},h.prototype.send=function(e){var t=i(e),n=this.getHeader("Content-Type");if(t&&i(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||s(e)?this:(n||this.type("json"),this)},h.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),n(e,t)},h.prototype.crossDomainError=function(){var e=new Error("Origin is not allowed by Access-Control-Allow-Origin");e.crossDomain=!0,this.callback(e)},h.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},h.prototype.withCredentials=function(){return this._withCredentials=!0,this},h.prototype.end=function(e){var t=this,n=this.xhr=d.getXHR(),i=this._query.join("&"),o=this._timeout,a=this._formData||this._data;this._callback=e||r,n.onreadystatechange=function(){if(4==n.readyState){var e;try{e=n.status}catch(r){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var l=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.emit("progress",e)};this.hasListeners("progress")&&(n.onprogress=l);try{n.upload&&this.hasListeners("progress")&&(n.upload.onprogress=l)}catch(c){}if(o&&!this._timer&&(this._timer=setTimeout(function(){ -t.timedout=!0,t.abort()},o)),i&&(i=d.serializeObject(i),this.url+=~this.url.indexOf("?")?"&"+i:"?"+i),n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof a&&!s(a)){var p=d.serialize[this.getHeader("Content-Type")];p&&(a=p(a))}for(var u in this.header)null!=this.header[u]&&n.setRequestHeader(u,this.header[u]);return this.emit("request",this),n.send(a),this},d.Request=h,d.get=function(e,t,n){var r=d("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},d.head=function(e,t,n){var r=d("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},d.del=function(e,t){var n=d("DELETE",e);return t&&n.end(t),n},d.patch=function(e,t,n){var r=d("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},d.post=function(e,t,n){var r=d("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},d.put=function(e,t,n){var r=d("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},e.exports=d},function(e,t,n){t.ActionMethods=n(58),t.ListenerMethods=n(59),t.PublisherMethods=n(60),t.StoreMethods=n(61),t.createAction=n(62),t.createStore=n(63),t.connect=n(64),t.connectFilter=n(65),t.ListenerMixin=n(66),t.listenTo=n(67),t.listenToMany=n(68);var r=n(69).staticJoinCreator;t.joinTrailing=t.all=r("last"),t.joinLeading=r("first"),t.joinStrict=r("strict"),t.joinConcat=r("all");var s=n(70);t.EventEmitter=s.EventEmitter,t.Promise=s.Promise,t.createActions=function(e){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r],o=s.isObject(i)?r:i;n[o]=t.createAction(i)}return n},t.setEventEmitter=function(e){var r=n(70);t.EventEmitter=r.EventEmitter=e},t.setPromise=function(e){var r=n(70);t.Promise=r.Promise=e},t.setPromiseFactory=function(e){var t=n(70);t.createPromise=e},t.nextTick=function(e){var t=n(70);t.nextTick=e},t.__keep=n(71),Function.prototype.bind||console.error("Function.prototype.bind not available. ES5 shim required. https://github.com/spoike/refluxjs#es5")},function(e,t,n){e.exports={}},function(e,t,n){var r=n(70),s=n(69).instanceJoinCreator,i=function(e){for(var t,n=0,r={};n<(e.children||[]).length;++n)t=e.children[n],e[t]&&(r[t]=e[t]);return r},o=function(e){var t={};for(var n in e){var s=e[n],a=i(s),l=o(a);t[n]=s;for(var c in l){var p=l[c];t[n+r.capitalize(c)]=p}}return t};e.exports={hasListener:function(e){for(var t,n,r,s=0;s<(this.subscriptions||[]).length;++s)for(r=[].concat(this.subscriptions[s].listenable),t=0;t=0&&this.children.indexOf("failed")>=0;if(!n)throw new Error('Publisher must have "completed" and "failed" child publishers');e.then(function(e){return t.completed(e)},function(e){return t.failed(e)})},listenAndPromise:function(e,t){var n=this;t=t||this,this.willCallPromise=(this.willCallPromise||0)+1;var r=this.listen(function(){if(!e)throw new Error("Expected a function returning a promise but got "+e);var r=arguments,s=e.apply(t,r);return n.promise.call(n,s)},t);return function(){n.willCallPromise--,r.call(n)}},trigger:function(){var e=arguments,t=this.preEmit.apply(this,e);e=void 0===t?e:r.isArguments(t)?t:[].concat(t),this.shouldEmit.apply(this,e)&&this.emitter.emit(this.eventLabel,e)},triggerAsync:function(){var e=arguments,t=this;r.nextTick(function(){t.trigger.apply(t,e)})},triggerPromise:function(){var e=this,t=arguments,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0,s=r.createPromise(function(s,i){if(e.willCallPromise)return void r.nextTick(function(){var n=e.promise;e.promise=function(t){return t.then(s,i),e.promise=n,e.promise.apply(e,arguments)},e.trigger.apply(e,t)});if(n)var o=e.completed.listen(function(e){o(),a(),s(e)}),a=e.failed.listen(function(e){o(),a(),i(e)});e.triggerAsync.apply(e,t),n||s()});return s}}},function(e,t,n){e.exports={}},function(e,t,n){var r=n(70),s=n(57),i=n(71),o={preEmit:1,shouldEmit:1},a=function(e){e=e||{},r.isObject(e)||(e={actionName:e});for(var t in s.ActionMethods)if(!o[t]&&s.PublisherMethods[t])throw new Error("Cannot override API method "+t+" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");for(var n in e)if(!o[n]&&s.PublisherMethods[n])throw new Error("Cannot override API method "+n+" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");e.children=e.children||[],e.asyncResult&&(e.children=e.children.concat(["completed","failed"]));for(var l=0,c={};lt;t++)l.throwIf(this.validateListening(o[t]));for(t=0;p>t;t++)h.push(o[t].listen(i(t,u),this));return s(u),n={listenable:o},n.stop=r(n,h,this),this.subscriptions=(this.subscriptions||[]).concat(n),n}}},function(e,t,n){var r=t.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e};t.extend=function(e){if(!r(e))return e;for(var t,n,s=1,i=arguments.length;i>s;s++){t=arguments[s];for(n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o)}else e[n]=t[n]}return e},t.isFunction=function(e){return"function"==typeof e},t.EventEmitter=n(76),t.nextTick=function(e){setTimeout(e,0)},t.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.callbackName=function(e){return"on"+t.capitalize(e)},t.object=function(e,t){for(var n={},r=0;rr;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){e.exports=function(e,t,n){for(var r=0,s=e.length,i=3==arguments.length?n:e[r++];s>r;)i=t.call(null,i,e[r],++r,e);return i}},function(e,t,n){var r=n(70);e.exports=function(e){var t={init:[],preEmit:[],shouldEmit:[]},n=function s(e){var n={};return e.mixins&&e.mixins.forEach(function(e){r.extend(n,s(e))}),r.extend(n,e),Object.keys(t).forEach(function(n){e.hasOwnProperty(n)&&t[n].push(e[n])}),n}(e);return t.init.length>1&&(n.init=function(){var e=arguments;t.init.forEach(function(t){t.apply(this,e)},this)}),t.preEmit.length>1&&(n.preEmit=function(){return t.preEmit.reduce(function(e,t){var n=t.apply(this,e);return void 0===n?e:[n]}.bind(this),arguments)}),t.shouldEmit.length>1&&(n.shouldEmit=function(){var e=arguments;return!t.shouldEmit.some(function(t){return!t.apply(this,e)},this)}),Object.keys(t).forEach(function(e){1===t[e].length&&(n[e]=t[e][0])}),n}},function(e,t,n){e.exports=function(e,t){for(var n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var r=Object.getOwnPropertyDescriptor(t,n);if(!r.value||"function"!=typeof r.value||!t.hasOwnProperty(n))continue;e[n]=t[n].bind(e)}else{var s=t[n];if("function"!=typeof s||!t.hasOwnProperty(n))continue;e[n]=s.bind(e)}return e}},function(e,t,n){"use strict";function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(){}s.prototype._events=void 0,s.prototype.listeners=function(e){if(!this._events||!this._events[e])return[];if(this._events[e].fn)return[this._events[e].fn];for(var t=0,n=this._events[e].length,r=new Array(n);n>t;t++)r[t]=this._events[e][t].fn;return r},s.prototype.emit=function(e,t,n,r,s,i){if(!this._events||!this._events[e])return!1;var o,a,l=this._events[e],c=arguments.length;if("function"==typeof l.fn){switch(l.once&&this.removeListener(e,l.fn,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,r),!0;case 5:return l.fn.call(l.context,t,n,r,s),!0;case 6:return l.fn.call(l.context,t,n,r,s,i),!0}for(a=1,o=new Array(c-1);c>a;a++)o[a-1]=arguments[a];l.fn.apply(l.context,o)}else{var p,u=l.length;for(a=0;u>a;a++)switch(l[a].once&&this.removeListener(e,l[a].fn,!0),c){case 1:l[a].fn.call(l[a].context);break;case 2:l[a].fn.call(l[a].context,t);break;case 3:l[a].fn.call(l[a].context,t,n);break;default:if(!o)for(p=1,o=new Array(c-1);c>p;p++)o[p-1]=arguments[p];l[a].fn.apply(l[a].context,o)}}return!0},s.prototype.on=function(e,t,n){var s=new r(t,n||this);return this._events||(this._events={}),this._events[e]?this._events[e].fn?this._events[e]=[this._events[e],s]:this._events[e].push(s):this._events[e]=s,this},s.prototype.once=function(e,t,n){var s=new r(t,n||this,!0);return this._events||(this._events={}),this._events[e]?this._events[e].fn?this._events[e]=[this._events[e],s]:this._events[e].push(s):this._events[e]=s,this},s.prototype.removeListener=function(e,t,n){if(!this._events||!this._events[e])return this;var r=this._events[e],s=[];if(t&&(r.fn&&(r.fn!==t||n&&!r.once)&&s.push(r),!r.fn))for(var i=0,o=r.length;o>i;i++)(r[i].fn!==t||n&&!r[i].once)&&s.push(r[i]);return s.length?this._events[e]=1===s.length?s[0]:s:delete this._events[e],this},s.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[e]:this._events={},this):this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.EventEmitter=s,s.EventEmitter2=s,s.EventEmitter3=s,e.exports=s},function(e,t,n){var r;(function(s,i){/*! Native Promise Only +var Grommet=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r={App:n(1),CheckBox:n(2),Document:n(3),Donut:n(4),Footer:n(5),Form:n(6),FormField:n(7),Header:n(8),Label:n(9),Login:n(10),LoginForm:n(11),Menu:n(12),Meter:n(13),Panel:n(14),RadioButton:n(15),Search:n(16),SearchInput:n(17),Section:n(18),Table:n(19),Tiles:n(20),Tile:n(21),Title:n(22),Object:n(23),TBD:n(24),Icons:{Clear:n(25),DragHandle:n(26),Edit:n(27),Filter:n(28),Help:n(29),Left:n(30),More:n(31),Right:n(32),Search:n(33),SearchPlus:n(34),Spinning:n(35),Status:n(36)},Mixins:{KeyboardAccelerators:n(37),ReactLayeredComponent:n(38)},Actions:n(39),SessionStore:n(40),Rest:n(41)};e.exports=r},function(e,t,n){var r=n(42),i=n(43),a=r.createClass({displayName:"App",mixins:[i],propTypes:{centered:r.PropTypes.bool},getDefaultProps:function(){return{centered:!0}},render:function(){var e=["app"];this.props.centered&&e.push("app--centered"),this.props.inline&&e.push("app--inline"),this.props.className&&e.push(this.props.className);var t=r.Children.map(this.props.children,function(e){return e?r.cloneElement(e,this.getChildContext()):null}.bind(this));return r.createElement("div",{className:e.join(" ")},t)}});e.exports=a},function(e,t,n){var r=n(42),i="check-box",a=r.createClass({displayName:"CheckBox",propTypes:{checked:r.PropTypes.bool,defaultChecked:r.PropTypes.bool,id:r.PropTypes.string.isRequired,label:r.PropTypes.string.isRequired,name:r.PropTypes.string,onChange:r.PropTypes.func,toggle:r.PropTypes.bool},render:function(){var e=[i];return this.props.toggle&&e.push(i+"--toggle"),this.props.className&&e.push(this.props.className),r.createElement("label",{className:e.join(" ")},r.createElement("input",{className:i+"__input",id:this.props.id,name:this.props.name,type:"checkbox",checked:this.props.checked,defaultChecked:this.props.defaultChecked,onChange:this.props.onChange}),r.createElement("span",{className:i+"__control"}),r.createElement("span",{className:i+"__label"},this.props.label))}});e.exports=a},function(e,t,n){var r=n(42),i="document",a=r.createClass({displayName:"GrommetDocument",propTypes:{colorIndex:r.PropTypes.string,flush:r.PropTypes.bool},getDefaultProps:function(){return{flush:!0}},render:function(){var e=[i];return this.props.flush&&e.push(i+"--flush"),this.props.colorIndex&&e.push("header-color-index-"+this.props.colorIndex),r.createElement("div",{ref:"document",className:e.join(" ")},r.createElement("div",{className:i+"__content"},this.props.children))}});e.exports=a},function(e,t,n){function r(e,t,n,r){var i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function i(e,t,n,i,a){var s=r(e,t,n,a),o=r(e,t,n,i),l=180>=a-i?"0":"1",c=["M",s.x,s.y,"A",n,n,0,l,0,o.x,o.y].join(" ");return c}function a(e,t,n,i,a){var s=a-(a-i)/2,o=r(e,t,n-24,s),l=r(e,t,n,s-10),c=r(e,t,n,s+10),u=["M",o.x,o.y,"L",l.x,l.y,"A",n,n,0,0,0,c.x,c.y,"Z"].join(" ");return u}var s=n(42),o=n(44),l="donut",c=192,u=168,p=s.createClass({displayName:"Donut",propTypes:{legend:s.PropTypes.bool,partial:s.PropTypes.bool,max:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number,label:s.PropTypes.string}),s.PropTypes.number]),min:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number,label:s.PropTypes.string}),s.PropTypes.number]),series:s.PropTypes.arrayOf(s.PropTypes.shape({label:s.PropTypes.string,value:s.PropTypes.number.isRequired,units:s.PropTypes.string,colorIndex:s.PropTypes.string,important:s.PropTypes.bool,onClick:s.PropTypes.func})),small:s.PropTypes.bool,units:s.PropTypes.string,value:s.PropTypes.number},getDefaultProps:function(){return{max:{value:100},min:{value:0}}},_initialTimeout:function(){this.setState({initial:!1,activeIndex:this.state.importantIndex}),clearTimeout(this._timeout)},_onActive:function(e){this.setState({initial:!1,activeIndex:e})},_layout:function(){var e=window.innerWidth/window.innerHeight;.8>e?this.setState({orientation:"portrait"}):e>1.2&&this.setState({orientation:"landscape"});var t=this.refs.donut.getDOMNode().parentNode,n=t.offsetWidth,r=t.offsetHeight,i=c;this.props.partial&&(i=u),i>r||c>n||2*c>n&&2*i>r?this.setState({size:"small"}):this.setState({size:null})},_onResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._layout,50)},_generateSeries:function(e){var t=e.max.value-e.min.value,n=t-(e.value-e.min.value);return[{value:e.value},{value:n,colorIndex:"unset"}]},_importantIndex:function(e){var t=0;return e.some(function(e,n){return e.important?(t=n,!0):void 0}),t},getInitialState:function(){var e=this.props.series||this._generateSeries(this.props),t=this._importantIndex(e);return{initial:!0,importantIndex:t,activeIndex:t,legend:!1,orientation:"portrait",series:e}},componentDidMount:function(){console.log("Grommet Donut is deprecated. Please use Grommet Meter instead."),this._initialTimer=setTimeout(this._initialTimeout,10),this.setState({initial:!0,activeIndex:0}),window.addEventListener("resize",this._onResize),this._onResize()},componentWillReceiveProps:function(e){var t=e.series||this._generateSeries(e),n=this._importantIndex(t);this.setState({importantIndex:n,activeIndex:n,series:t})},componentWillUnmount:function(){clearTimeout(this._initialTimer),clearTimeout(this._resizeTimer),window.removeEventListener("resize",this._onResize)},_itemColorIndex:function(e,t){return e.colorIndex||"graph-"+(t+1)},render:function(){var e=[l,l+"--"+this.state.orientation];this.state.size&&e.push(l+"--"+this.state.size),this.props.partial&&e.push(l+"--partial"),this.props.small&&e.push(l+"--small");var t=c;this.props.partial&&(t=u);var n=0;this.state.series.some(function(e){n+=e.value});var r=0,p=360/n;this.props.partial&&(r=60,p=240/n);var h,m,d=null,f=null,g=null,y=null,v=this.state.series.map(function(e,t){var n=Math.min(360,Math.max(10,r+p*e.value));e.value>0&&r+360===n&&(n-=.1);var o=84,u=i(c/2,c/2,o,r+180,n+180),h=this._itemColorIndex(e,t),m=[l+"__slice"];if(m.push("color-index-"+h),this.state.activeIndex===t&&(m.push(l+"__slice--active"),d=e.value,f=e.units||this.props.units,g=e.label),t===this.state.activeIndex){var v=a(c/2,c/2,o,r+180,n+180);y=s.createElement("path",{stroke:"none",className:l+"__slice-indicator color-index-"+h,d:v})}return r=n,s.createElement("path",{key:e.label,fill:"none",className:m.join(" "),d:u,onMouseOver:this._onActive.bind(this,t),onMouseOut:this._onActive.bind(this,this.state.importantIndex),onClick:e.onClick})},this);this.props.partial&&(this.props.min&&(h=s.createElement("div",{className:l+"__min-label"},this.props.min.value," ",this.props.units)),this.props.max&&(m=s.createElement("div",{className:l+"__max-label"},this.props.max.value," ",this.props.units)));var b=null;return this.props.legend&&(b=s.createElement(o,{className:l+"__legend",series:this.props.series,units:this.props.units,value:this.props.value,activeIndex:this.state.activeIndex,onActive:this._onActive})),s.createElement("div",{ref:"donut",className:e.join(" ")},s.createElement("div",{className:l+"__graphic-container"},s.createElement("svg",{className:l+"__graphic",viewBox:"0 0 "+c+" "+t,preserveAspectRatio:"xMidYMid meet"},s.createElement("g",null,y,v)),s.createElement("div",{className:l+"__active"},s.createElement("div",{className:l+"__active-value large-number-font"},d,s.createElement("span",{className:l+"__active-units large-number-font"},f)),s.createElement("div",{className:l+"__active-label"},g)),h,m),b)}});e.exports=p},function(e,t,n){var r=n(42),i=n(45),a="footer",s=r.createClass({displayName:"Footer",propTypes:{centered:r.PropTypes.bool,colorIndex:r.PropTypes.string,flush:r.PropTypes.bool,primary:r.PropTypes.bool,scrollTop:r.PropTypes.bool},getDefaultProps:function(){return{flush:!0}},_updateState:function(){this.setState({scrolled:this._scrollable.scrollTop>0})},_onClickTop:function(){this._scrollable.scrollTop=0},_onScroll:function(){clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(this._updateState,10)},getInitialState:function(){return{scrolled:!1}},componentDidMount:function(){this._scrollable=this.refs.footer.getDOMNode().parentNode.parentNode,this._scrollable.addEventListener("scroll",this._onScroll)},componentWillUnmount:function(){this._scrollable.removeEventListener("scroll",this._onScroll)},componentWillReceiveProps:function(){this.setState({scrolled:!1})},componentDidUpdate:function(){this.state.scrolled||(this._scrollable.scrollTop=0)},render:function(){var e=[a];this.props.primary&&e.push(a+"--primary"),this.props.centered&&e.push(a+"--centered"),this.props.flush&&e.push(a+"--flush"),this.props.colorIndex&&e.push("background-color-index-"+this.props.colorIndex),this.props.className&&e.push(this.props.className);var t=null;return this.props.scrollTop&&this.state.scrolled&&(t=r.createElement("div",{className:a+"__top control-icon",onClick:this._onClickTop},r.createElement(i,null))),r.createElement("div",{ref:"footer",className:e.join(" ")},r.createElement("div",{className:a+"__content"},this.props.children,t))}});e.exports=s},function(e,t,n){var r=n(42),i="form",a=r.createClass({displayName:"Form",propTypes:{compact:r.PropTypes.bool,fill:r.PropTypes.bool,flush:r.PropTypes.bool,onSubmit:r.PropTypes.func,className:r.PropTypes.string},getDefaultProps:function(){return{compact:!1,fill:!1,flush:!0}},render:function(){var e=[i];return this.props.compact&&e.push(i+"--compact"),this.props.fill&&e.push(i+"--fill"),this.props.flush&&e.push(i+"--flush"),this.props.className&&e.push(this.props.className),r.createElement("form",{className:e.join(" "),onSubmit:this.props.onSubmit},this.props.children)}});e.exports=a},function(e,t,n){var r=n(42),i="form-field",a=r.createClass({displayName:"FormField",propTypes:{error:r.PropTypes.string,help:r.PropTypes.node,htmlFor:r.PropTypes.string,label:r.PropTypes.string,required:r.PropTypes.bool},_onFocus:function(){this.setState({focus:!0})},_onBlur:function(){this.setState({focus:!1})},_onClick:function(){this._inputElement&&this._inputElement.focus()},getInitialState:function(){return{focus:!1}},componentDidMount:function(){var e=this.refs.contents.getDOMNode(),t=e.querySelectorAll("input, textarea, select");1===t.length&&(this._inputElement=t[0],this._inputElement.addEventListener("focus",this._onFocus),this._inputElement.addEventListener("blur",this._onBlur))},componentWillUnmount:function(){this._inputElement&&(this._inputElement.removeEventListener("focus",this._onFocus),this._inputElement.removeEventListener("blur",this._onBlur),delete this._inputElement)},render:function(){var e=[i];this.state.focus&&e.push(i+"--focus"),this.props.required&&e.push(i+"--required"),this.props.htmlFor&&e.push(i+"--text");var t=null;this.props.error&&(e.push(i+"--error"),t=r.createElement("span",{className:i+"__error"},this.props.error));var n=null;return this.props.help&&(n=r.createElement("span",{className:i+"__help"},this.props.help)),r.createElement("div",{className:e.join(" "),onClick:this._onClick},t,r.createElement("label",{className:i+"__label",htmlFor:this.props.htmlFor},this.props.label),r.createElement("span",{ref:"contents",className:i+"__contents"},this.props.children),n)}});e.exports=a},function(e,t,n){var r=n(42),i="header",a=r.createClass({displayName:"Header",propTypes:{colorIndex:r.PropTypes.string,fixed:r.PropTypes.bool,flush:r.PropTypes.bool,large:r.PropTypes.bool,primary:r.PropTypes.bool,small:r.PropTypes.bool},getDefaultProps:function(){return{flush:!0,large:!1,primary:!1,small:!1}},_onResize:function(){this._alignMirror()},_alignMirror:function(){var e=this.refs.content.getDOMNode(),t=this.refs.mirror.getDOMNode(),n=t.getBoundingClientRect();e.style.width=""+Math.floor(n.width)+"px";var r=e.getBoundingClientRect();t.style.height=""+Math.floor(r.height)+"px"},componentDidMount:function(){this.props.fixed&&(this._alignMirror(),window.addEventListener("resize",this._onResize))},componentDidUpdate:function(){this.props.fixed&&this._alignMirror()},componentWillUnmount:function(){this.props.fixed&&window.removeEventListener("resize",this._onResize)},render:function(){var e=[i];this.props.primary&&e.push(i+"--primary"),this.props.fixed&&e.push(i+"--fixed"),this.props.flush&&e.push(i+"--flush"),this.props.large&&e.push(i+"--large"),this.props.small&&e.push(i+"--small"),this.props.className&&e.push(this.props.className);var t=null;this.props.fixed&&(t=r.createElement("div",{ref:"mirror",className:i+"__mirror"}));var n=r.createElement("div",{ref:"content",className:i+"__content"},this.props.children);if(this.props.colorIndex||this.props.fixed){var a=[i+"__wrapper"];this.props.colorIndex&&a.push("background-color-index-"+this.props.colorIndex),n=r.createElement("div",{className:a.join(" ")},n)}return r.createElement("div",{className:e.join(" ")},t,n)}});e.exports=a},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Label",propTypes:{icon:r.PropTypes.node,text:r.PropTypes.string},render:function(){var e=null,t=null;return this.props.icon&&(e=r.createElement("span",{className:"label__icon control-icon"},this.props.icon)),this.props.text&&(t=r.createElement("span",{className:"label__text"},this.props.text)),r.createElement("div",{className:"label"},e,t)}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Login",propTypes:{background:r.PropTypes.string},_onResize:function(){this.adjustBackground()},adjustBackground:function(){var e=window.innerWidth/window.innerHeight,t=this.refs.background.getDOMNode(),n=t.scrollWidth/t.scrollHeight;this.setState({orientation:n>e?"portrait":"landscape"})},getInitialState:function(){return{orientation:null}},componentDidMount:function(){window.addEventListener("resize",this._onResize),setTimeout(this.adjustBackground,300)},componentWillUnmount:function(){window.removeEventListener("resize",this._onResize)},render:function(){var e=null;if(this.props.background){var t=["login__background"];this.state.orientation&&t.push("login__background--"+this.state.orientation),e=r.createElement("img",{ref:"background",className:t.join(" "),src:this.props.background})}return r.createElement("div",{className:"login"},e,r.createElement("div",{className:"login__container"},this.props.children))}});e.exports=i},function(e,t,n){var r=n(42),i=n(6),a=n(7),s=n(2),o=n(43),l="login-form",c=r.createClass({displayName:"LoginForm",mixins:[o],propTypes:{logo:r.PropTypes.node,title:r.PropTypes.string,rememberMe:r.PropTypes.bool,forgotPassword:r.PropTypes.node,errors:r.PropTypes.arrayOf(r.PropTypes.string),onSubmit:r.PropTypes.func},_onSubmit:function(e){e.preventDefault();var t=this.refs.username.getDOMNode().value.trim(),n=this.refs.password.getDOMNode().value.trim();this.props.onSubmit&&this.props.onSubmit({username:t,password:n})},getDefaultProps:function(){return{errors:[]}},componentDidMount:function(){this.refs.username.getDOMNode().focus()},render:function(){var e=[l],t=this.props.errors.map(function(e,t){return r.createElement("div",{key:t,className:l+"__error"},this.getGrommetIntlMessage(e))}.bind(this)),n=null;this.props.logo&&(n=r.createElement("div",{className:l+"__logo"},this.props.logo));var o=null;this.props.title&&(o=r.createElement("h1",{className:l+"__title"},this.props.title));var c=null;if(this.props.rememberMe||this.props.forgotPassword){var u=null;this.props.rememberMe&&(u=r.createElement(s,{className:l+"__remember-me",id:"remember-me",label:this.getGrommetIntlMessage("Remember me")})),c=r.createElement("div",{className:l+"__footer"},u,this.props.forgotPassword)}return r.createElement(i,{className:e.join(" "),onSubmit:this._onSubmit},n,o,r.createElement("fieldset",null,r.createElement(a,{htmlFor:"username",label:this.getGrommetIntlMessage("Username")},r.createElement("input",{id:"username",ref:"username",type:"email"})),r.createElement(a,{htmlFor:"password",label:this.getGrommetIntlMessage("Password")},r.createElement("input",{id:"password",ref:"password",type:"password"}))),t,r.createElement("input",{type:"submit",className:l+"__submit primary call-to-action",value:this.getGrommetIntlMessage("Log In")}),c)}});e.exports=c},function(e,t,n){var r=n(42),i=n(38),a=n(37),s=n(46),o=n(31),l=n(47),c="menu",u=r.createClass({displayName:"MenuLayer",propTypes:{align:r.PropTypes.oneOf(["top","bottom","left","right"]),direction:r.PropTypes.oneOf(["up","down","left","right","center"]),onClick:r.PropTypes.func.isRequired,router:r.PropTypes.func},childContextTypes:{router:r.PropTypes.func},getChildContext:function(){return{router:this.props.router}},render:function(){var e=[c+"__layer"];return this.props.direction&&e.push(c+"__layer--"+this.props.direction),this.props.align&&e.push(c+"__layer--align-"+this.props.align),r.createElement("div",{id:"menu-layer",className:e.join(" "),onClick:this.props.onClick},this.props.children)}}),p=r.createClass({displayName:"Menu",propTypes:{align:r.PropTypes.oneOf(["top","bottom","left","right"]),collapse:r.PropTypes.bool,direction:r.PropTypes.oneOf(["up","down","left","right","center"]),icon:r.PropTypes.node,label:r.PropTypes.string,primary:r.PropTypes.bool,small:r.PropTypes.bool},contextTypes:{router:r.PropTypes.func},getDefaultProps:function(){return{align:"left",direction:"down",small:!1}},mixins:[i,a,s],_onOpen:function(e){e.preventDefault(),this.setState({active:!0})},_onClose:function(){this.setState({active:!1})},_onFocusControl:function(){this.setState({controlFocused:!0})},_onBlurControl:function(){this.setState({controlFocused:!1})},getInitialState:function(){return{controlFocused:!1,active:!1,inline:!this.props.label&&!this.props.icon&&!this.props.collapse}},componentDidUpdate:function(e,t){var n={esc:this._onClose,space:this._onClose,tab:this._onClose},r={space:this._onOpen,down:this._onOpen};if(!this.state.controlFocused&&t.controlFocused&&this.stopListeningToKeyboard(r),!this.state.active&&t.active&&(document.removeEventListener("click",this._onClose),this.stopListeningToKeyboard(n),this.stopOverlay()),this.state.controlFocused&&(!t.controlFocused||!this.state.active&&t.active)&&this.startListeningToKeyboard(r),this.state.active&&!t.active){document.addEventListener("click",this._onClose),this.startListeningToKeyboard(n);var i=this.refs.control.getDOMNode(),a=document.getElementById("menu-layer"),s=a.querySelectorAll("."+c+"__control")[0],o=a.querySelectorAll("svg, img")[0],l=window.getComputedStyle(i).fontSize;s.style.fontSize=l;var u=i.clientHeight;o&&u<=o.clientHeight+1&&("down"===this.props.direction?s.style.marginTop="-1px":"up"===this.props.direction&&(s.style.marginBottom="1px")),s.style.height=u+"px",s.style.lineHeight=u+"px",this.startOverlay(i,a,this.props.align)}},componentWillUnmount:function(){document.removeEventListener("click",this._onClose)},_renderControl:function(){var e=null,t=null,n=c+"__control",i=[n];return this.props.icon?(i.push(n+"--labelled"),t=this.props.icon):(i.push(n+"--fixed-label"),t=r.createElement(o,null)),e=this.props.label?r.createElement("div",{className:i.join(" ")},r.createElement("div",{className:n+"-icon"},t),r.createElement("span",{className:n+"-label"},this.props.label),r.createElement(l,{className:n+"-drop-icon"})):r.createElement("div",{className:n},t)},_classes:function(e){var t=[e];return this.props.direction&&t.push(e+"--"+this.props.direction),this.props.align&&t.push(e+"--align-"+this.props.align),this.props.small&&t.push(e+"--small"),this.props.primary&&t.push(e+"--primary"),t},render:function(){var e=this._classes(c);if(this.state.inline?e.push(c+"--inline"):(e.push(c+"--controlled"),this.props.label&&e.push(c+"--labelled")),this.props.className&&e.push(this.props.className),this.state.inline)return r.createElement("div",{className:e.join(" "),onClick:this._onClose},this.props.children);var t=this._renderControl();return r.createElement("div",{ref:"control",className:e.join(" "),tabIndex:"0",onClick:this._onOpen,onFocus:this._onFocusControl,onBlur:this._onBlurControl},t)},renderLayer:function(){if(this.state.active){var e=this._renderControl(),t=null,n=null;return"up"===this.props.direction?(t=this.props.children,n=e):(t=e,n=this.props.children),r.createElement(u,{router:this.context.router,align:this.props.align,direction:this.props.direction,onClick:this._onClose},t,n)}return r.createElement("span",null)}});e.exports=p},function(e,t,n){function r(e,t,n,r){var i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function i(e,t,n,i,a){var s=r(e,t,n,a),o=r(e,t,n,i),l=180>=a-i?"0":"1",c=["M",s.x,s.y,"A",n,n,0,l,0,o.x,o.y].join(" ");return c}function a(e,t,n,i,a){var s=a-(a-i)/2,o=r(e,t,n-24,s),l=r(e,t,n,s-10),c=r(e,t,n,s+10),u=["M",o.x,o.y,"L",l.x,l.y,"A",n,n,0,0,0,c.x,c.y,"Z"].join(" ");return u}var s=n(42),o=n(44),l="meter",c=192,u=24,p=u/2,h=192,m=84,d=144,f=s.createClass({displayName:"Meter",propTypes:{important:s.PropTypes.number,large:s.PropTypes.bool,legend:s.PropTypes.bool,legendTotal:s.PropTypes.bool,max:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number.isRequired,label:s.PropTypes.string}),s.PropTypes.number]),min:s.PropTypes.oneOfType([s.PropTypes.shape({value:s.PropTypes.number.isRequired,label:s.PropTypes.string}),s.PropTypes.number]),series:s.PropTypes.arrayOf(s.PropTypes.shape({label:s.PropTypes.string,value:s.PropTypes.number.isRequired,colorIndex:s.PropTypes.string,important:s.PropTypes.bool,onClick:s.PropTypes.func})),small:s.PropTypes.bool,threshold:s.PropTypes.number,type:s.PropTypes.oneOf(["bar","arc","circle"]),units:s.PropTypes.string,value:s.PropTypes.number,vertical:s.PropTypes.bool},getDefaultProps:function(){return{type:"bar"}},_initialTimeout:function(){this.setState({initial:!1,activeIndex:this.state.importantIndex}),clearTimeout(this._timeout)},_onActivate:function(e){this.setState({initial:!1,activeIndex:e})},_onResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._layout,50)},_layout:function(){var e=window.innerWidth/window.innerHeight;.8>e?this.setState({legendPosition:"bottom"}):e>1.2&&this.setState({legendPosition:"right"})},_generateSeries:function(e,t,n){var r=n.value-e.value;return[{value:e.value,important:!0},{value:r,colorIndex:"unset"}]},_importantIndex:function(e){var t=e.length-1;return this.props.hasOwnProperty("important")&&(t=this.props.important),e.some(function(e,n){return e.important?(t=n,!0):void 0}),t},_terminal:function(e){return"number"==typeof e&&(e={value:e}),e},_seriesTotal:function(e){var t=0;return e.some(function(e){t+=e.value}),t},_stateFromProps:function(e){var t;t=e.series&&e.series.length>1?this._seriesTotal(e.series):100;var n=this._terminal(e.min||0),r=this._terminal(e.max||t),i=e.series||this._generateSeries(e,n,r),a=this._importantIndex(i);t=this._seriesTotal(i);var s={importantIndex:a,activeIndex:a,legendPosition:"bottom",series:i,min:n,max:r,total:t};return"arc"===this.props.type?(s.startAngle=60,s.anglePer=240/t,this.props.vertical?s.angleOffset=90:s.angleOffset=180):"circle"===this.props.type?(s.startAngle=1,s.anglePer=358/t,s.angleOffset=180):"bar"===this.props.type&&(s.scale=c/(r.value-n.value)),s},getInitialState:function(){var e=this._stateFromProps(this.props);return e.initial=!0,e},componentDidMount:function(){this._initialTimer=setTimeout(this._initialTimeout,10),window.addEventListener("resize",this._onResize),this._onResize()},componentWillReceiveProps:function(e){var t=this._stateFromProps(e);this.setState(t)},componentWillUnmount:function(){clearTimeout(this._initialTimer),clearTimeout(this._resizeTimer),window.removeEventListener("resize",this._onResize)},_itemColorIndex:function(e,t){return e.colorIndex||"graph-"+(t+1)},_translateBarWidth:function(e){return Math.round(this.state.scale*e)},_renderBar:function(){var e=0,t=this.state.min.value,n=this.state.series.map(function(n,r){var i=this._itemColorIndex(n,r),a=[l+"__bar"];r===this.state.activeIndex&&a.push(l+"__bar--active"),a.push("color-index-"+i);var o=n.value-t;t=Math.max(0,t-n.value);var u,h=this._translateBarWidth(o);return u=this.props.vertical?"M"+p+","+(c-e)+" L"+p+","+(c-(e+h)):"M"+e+","+p+" L"+(e+h)+","+p,e+=h,s.createElement("path",{key:r,className:a.join(" "),d:u,onMouseOver:this._onActivate.bind(this,r),onMouseOut:this._onActivate.bind(this,this.state.importantIndex),onClick:n.onClick})},this);return n},_renderArcOrCircle:function(){var e=this.state.startAngle,t=null,n=this.state.series.map(function(n,r){var o=[l+"__slice"];r===this.state.activeIndex&&o.push(l+"__slice--active");var c=this._itemColorIndex(n,r);o.push("color-index-"+c);var u=Math.min(360,Math.max(0,e+this.state.anglePer*n.value)),p=i(h/2,h/2,m,e+this.state.angleOffset,u+this.state.angleOffset);if(r===this.state.activeIndex){var d=a(h/2,h/2,m,e+this.state.angleOffset,u+this.state.angleOffset);t=s.createElement("path",{stroke:"none",className:l+"__slice-indicator color-index-"+c,d:d})}return e=u,s.createElement("path",{key:n.label,fill:"none",className:o.join(" "),d:p,onMouseOver:this._onActivate.bind(this,r),onMouseOut:this._onActivate.bind(this,this.state.importantIndex),onClick:n.onClick})},this);return s.createElement("g",null,t,n)},_renderCurrent:function(){var e,t=this.state.series[this.state.activeIndex];return"arc"===this.props.type||"circle"===this.props.type?e=s.createElement("div",{className:l+"__active"},s.createElement("div",{className:l+"__active-value large-number-font"},t.value,s.createElement("span",{className:l+"__active-units large-number-font"},this.props.units)),s.createElement("div",{className:l+"__active-label"},t.label)):"bar"===this.props.type&&(e=s.createElement("span",{className:l+"__active"},s.createElement("span",{className:l+"__active-value large-number-font"},t.value),s.createElement("span",{className:l+"__active-units large-number-font"},this.props.units))),e},_renderBarThreshold:function(){var e,t=this._translateBarWidth(this.props.threshold-this.state.min.value);return e=this.props.vertical?"M0,"+(c-t)+" L"+u+","+(c-t):"M"+t+",0 L"+t+","+u,s.createElement("path",{className:l+"__threshold",d:e})},_renderCircleOrArcThreshold:function(){var e=this.state.startAngle+this.state.anglePer*this.props.threshold,t=Math.min(360,Math.max(0,e+1)),n=i(h/2,h/2,m,e+180,t+180);return s.createElement("path",{className:l+"__threshold",d:n})},_renderLegend:function(){return s.createElement(o,{className:l+"__legend",series:this.state.series,units:this.props.units,activeIndex:this.state.activeIndex,onActive:this._onActive})},render:function(){var e=[l];e.push(l+"--"+this.props.type),e.push(l+"--legend-"+this.state.legendPosition),this.props.vertical&&e.push(l+"--vertical"),this.props.small&&e.push(l+"--small"),this.props.large&&e.push(l+"--large"),this.props.className&&e.push(this.props.className);var t,n;"arc"===this.props.type?this.props.vertical?(n=d,t=h):(n=h,t=d):"circle"===this.props.type?(n=h,t=h):"bar"===this.props.type&&(this.props.vertical?(n=u,t=c):(n=c,t=u));var r=null;"arc"===this.props.type||"circle"===this.props.type?r=this._renderArcOrCircle():"bar"===this.props.type&&(r=this._renderBar());var i=null;this.props.threshold&&("arc"===this.props.type||"circle"===this.props.type?i=this._renderCircleOrArcThreshold():"bar"===this.props.type&&(i=this._renderBarThreshold()));var a=null;this.state.min.label&&(a=s.createElement("div",{className:l+"__label-min"},this.state.min.label));var o=null;this.state.max.label&&(o=s.createElement("div",{className:l+"__label-max"},this.state.max.label));var p=null;this.state.activeIndex>=0&&(p=this._renderCurrent());var m=null;return this.props.legend&&(m=this._renderLegend()),s.createElement("div",{className:e.join(" ")},s.createElement("svg",{className:l+"__graphic",viewBox:"0 0 "+n+" "+t,preserveAspectRatio:"xMidYMid meet"},s.createElement("g",null,r,i)),p,s.createElement("div",{className:l+"__labels"},a,o),m)}});e.exports=f},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Panel",propTypes:{direction:r.PropTypes.string,index:r.PropTypes.oneOf([1,2])},render:function(){var e=["panel"];"horizontal"===this.props.direction&&e.push("panel--horizontal"),this.props.index&&e.push("panel--index-"+this.props.index);var t=null;return this.props.title&&(t=r.createElement("h2",{className:"panel__title"},this.props.title)),r.createElement("div",{className:e.join(" ")},t,this.props.children)}});e.exports=i},function(e,t,n){var r=n(42),i="radio-button",a=r.createClass({displayName:"RadioButton",propTypes:{checked:r.PropTypes.bool,defaultChecked:r.PropTypes.bool,id:r.PropTypes.string.isRequired,label:r.PropTypes.string.isRequired,name:r.PropTypes.string,onChange:r.PropTypes.func},render:function(){var e=[i];return this.props.className&&e.push(this.props.className),r.createElement("label",{className:e.join(" ")},r.createElement("input",{className:i+"__input",id:this.props.id,name:this.props.name,type:"radio",checked:this.props.checked,defaultChecked:this.props.defaultChecked,onChange:this.props.onChange}),r.createElement("span",{className:i+"__control"}),r.createElement("span",{className:i+"__label"},this.props.label))}});e.exports=a},function(e,t,n){var r=n(42),i=n(38),a=n(37),s=n(46),o=n(33),l=n(43),c="search",u=r.createClass({displayName:"Search",propTypes:{align:r.PropTypes.oneOf(["left","right"]),defaultValue:r.PropTypes.string,inline:r.PropTypes.bool,onChange:r.PropTypes.func,placeHolder:r.PropTypes.string,suggestions:r.PropTypes.arrayOf(r.PropTypes.string)},getDefaultProps:function(){return{align:"left",inline:!1,placeHolder:"Search"}},mixins:[i,a,s,l],_onAddLayer:function(e){e.preventDefault(),this.setState({layer:!0,activeSuggestionIndex:-1})},_onRemoveLayer:function(){this.setState({layer:!1})},_onFocusControl:function(){this.setState({controlFocused:!0,layer:!0,activeSuggestionIndex:-1})},_onBlurControl:function(){this.setState({controlFocused:!1})},_onFocusInput:function(){this.refs.input.getDOMNode().select(),this.setState({layer:!this.state.inline||this.props.suggestions,activeSuggestionIndex:-1})},_onBlurInput:function(){},_onChangeInput:function(e){this.setState({activeSuggestionIndex:-1}),this.props.onChange&&this.props.onChange(e.target.value)},_onNextSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.min(e+1,this.props.suggestions.length-1),this.setState({activeSuggestionIndex:e})},_onPreviousSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.max(e-1,0),this.setState({activeSuggestionIndex:e})},_onEnter:function(){if(this.state.activeSuggestionIndex>=0){var e=this.props.suggestions[this.state.activeSuggestionIndex];this.props.onChange&&this.props.onChange(e)}this._onRemoveLayer()},_onClickSuggestion:function(e){this.props.onChange&&this.props.onChange(e),this._onRemoveLayer()},_onSink:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},_layout:function(){window.innerWidth<600?this.setState({inline:!1}):this.setState({inline:this.props.inline})},_onResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._layout,50)},getInitialState:function(){return{align:"left",controlFocused:!1,inline:this.props.inline,layer:!1,activeSuggestionIndex:-1}},componentDidMount:function(){window.addEventListener("resize",this._onResize),this._layout()},componentDidUpdate:function(e,t){var n={esc:this._onRemoveLayer,tab:this._onRemoveLayer,up:this._onPreviousSuggestion,down:this._onNextSuggestion,enter:this._onEnter},r={space:this._onAddLayer};if(!this.state.controlFocused&&t.controlFocused&&this.stopListeningToKeyboard(r),!this.state.layer&&t.layer&&(document.removeEventListener("click",this._onRemoveLayer),this.stopListeningToKeyboard(n),this.stopOverlay()),this.state.controlFocused&&!t.controlFocused&&this.startListeningToKeyboard(r),this.state.layer&&!t.layer){document.addEventListener("click",this._onRemoveLayer),this.startListeningToKeyboard(n);var i=(this.refs.control?this.refs.control:this.refs.input).getDOMNode(),a=document.getElementById("search-layer"),s=a.querySelectorAll(".search__control")[0],o=a.querySelectorAll("svg")[0],l=a.querySelectorAll(".search__input")[0],c=window.getComputedStyle(i).fontSize; +l.style.fontSize=c;var u=i.clientHeight;o&&u<=o.clientHeight&&(s.style.marginTop="-2px"),l.style.height=u+"px",s&&(s.style.height=u+"px",s.style.lineHeight=u+"px"),this.startOverlay(i,a,this.props.align),l.focus()}},componentWillUnmount:function(){document.removeEventListener("click",this._onRemoveLayer),window.removeEventListener("resize",this._onResize)},focus:function(){var e=this.refs.input||this.refs.control;e&&e.getDOMNode().focus()},_createControl:function(){var e=c+"__control";return r.createElement("div",{className:e},r.createElement(o,null))},_classes:function(e){var t=[e];return this.state.inline?t.push(e+"--inline"):t.push(e+"--controlled"),this.props.align&&t.push(e+"--align-"+this.props.align),t},render:function(){var e=this._classes(c);if(this.props.className&&e.push(this.props.className),this.state.inline){var t=this.props.suggestions?!0:!1;return r.createElement("div",{className:e.join(" ")},r.createElement("input",{ref:"input",type:"search",placeholder:this.getGrommetIntlMessage(this.props.placeHolder),value:this.props.defaultValue,className:c+"__input",readOnly:t,onFocus:this._onFocusInput,onBlur:this._onBlurInput,onChange:this._onChangeInput}))}var n=this._createControl();return r.createElement("div",{ref:"control",className:e.join(" "),tabIndex:"0",onClick:this._onAddLayer,onFocus:this._onFocusControl,onBlur:this._onBlurControl},n)},renderLayer:function(){if(this.state.layer){var e=this._classes(c+"__layer"),t=null;this.props.suggestions&&(t=this.props.suggestions.map(function(e,t){var n=[c+"__suggestion"];return t===this.state.activeSuggestionIndex&&n.push(c+"__suggestion--active"),r.createElement("div",{key:e,className:n.join(" "),onClick:this._onClickSuggestion.bind(this,e)},e)},this));var n=r.createElement("div",{className:c+"__layer-contents",onClick:this._onSink},r.createElement("input",{type:"search",defaultValue:this.props.defaultValue,className:c+"__input",onChange:this._onChangeInput}),r.createElement("div",{className:c+"__suggestions"},t));if(!this.state.inline){var i=this._createControl(),a="right"===this.props.align,s=a?n:i,o=a?i:n;n=r.createElement("div",{className:c+"__layer-header"},s,o)}return r.createElement("div",{id:"search-layer",className:e.join(" ")},n)}return r.createElement("span",null)}});e.exports=u},function(e,t,n){var r=n(42),i=n(38),a=n(37),s=n(46),o=n(33),l="search-input",c=r.createClass({displayName:"SearchInput",propTypes:{defaultValue:r.PropTypes.oneOfType([r.PropTypes.shape({label:r.PropTypes.string,value:r.PropTypes.string}),r.PropTypes.string]),id:r.PropTypes.string,name:r.PropTypes.string,onChange:r.PropTypes.func,onSearch:r.PropTypes.func,suggestions:r.PropTypes.arrayOf(r.PropTypes.oneOfType([r.PropTypes.shape({label:r.PropTypes.string,value:r.PropTypes.string}),r.PropTypes.string])),value:r.PropTypes.oneOfType([r.PropTypes.shape({label:r.PropTypes.string,value:r.PropTypes.string}),r.PropTypes.string])},mixins:[i,a,s],_onInputChange:function(e){this.props.onChange(e.target.value)},_onOpen:function(e){e.preventDefault(),this.setState({active:!0,activeSuggestionIndex:-1})},_onClose:function(){this.setState({active:!1})},_onSearchChange:function(e){this.setState({activeSuggestionIndex:-1}),this.props.onSearch(e.target.value)},_onNextSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.min(e+1,this.props.suggestions.length-1),this.setState({activeSuggestionIndex:e})},_onPreviousSuggestion:function(){var e=this.state.activeSuggestionIndex;e=Math.max(e-1,0),this.setState({activeSuggestionIndex:e})},_onEnter:function(){if(this.setState({active:!1}),this._activation(!1),this.state.activeSuggestionIndex>=0){var e=this.props.suggestions[this.state.activeSuggestionIndex];this.setState({value:e}),this.props.onChange(e)}},_onClickSuggestion:function(e){this.setState({value:e}),this._activation(!1),this.props.onChange(e)},_activation:function(e){var t={esc:this._onClose,tab:this._onClose,up:this._onPreviousSuggestion,down:this._onNextSuggestion,enter:this._onEnter};if(e){document.addEventListener("click",this._onClose),this.startListeningToKeyboard(t);var n=this.refs.component.getDOMNode(),r=document.getElementById(l+"-layer");this.startOverlay(n,r,"below");var i=r.querySelectorAll("input")[0];i.focus()}else document.removeEventListener("click",this._onClose),this.stopListeningToKeyboard(t),this.stopOverlay()},getInitialState:function(){return{active:!1,defaultValue:this.props.defaultValue,value:this.props.value,activeSuggestionIndex:-1}},componentDidMount:function(){this.state.active&&this._activation(this.state.active)},componentDidUpdate:function(e,t){!this.state.active&&t.active&&this._activation(this.state.active),this.state.active&&!t.active&&this._activation(this.state.active)},componentWillUnmount:function(){this._activation(!1)},_valueText:function(e){var t="";return e&&(t="string"==typeof e?e:e.label||e.value),t},render:function(){var e=[l];return this.state.active&&e.push(l+"--active"),this.props.className&&e.push(this.props.className),r.createElement("div",{ref:"component",className:e.join(" ")},r.createElement("input",{className:l+"__input",id:this.props.id,name:this.props.name,value:this._valueText(this.props.value),defaultValue:this._valueText(this.props.defaultValue),onChange:this._onInputChange}),r.createElement("div",{className:l+"__control",onClick:this._onOpen},r.createElement(o,null)))},renderLayer:function(){if(this.state.active){var e=null;return this.props.suggestions&&(e=this.props.suggestions.map(function(e,t){var n=[l+"__layer-suggestion"];return t===this.state.activeSuggestionIndex&&n.push(l+"__layer-suggestion--active"),r.createElement("div",{key:this._valueText(e),className:n.join(" "),onClick:this._onClickSuggestion.bind(this,e)},this._valueText(e))},this)),r.createElement("div",{id:l+"-layer",className:l+"__layer",onClick:this._onClose},r.createElement("input",{type:"search",defaultValue:"",placeholder:"Search",className:l+"__layer-input",onChange:this._onSearchChange}),r.createElement("div",{className:l+"__layer-suggestions"},e))}return r.createElement("span",null)}});e.exports=c},function(e,t,n){var r=n(42),i="section",a=r.createClass({displayName:"Section",propTypes:{centered:r.PropTypes.bool,compact:r.PropTypes.bool,colorIndex:r.PropTypes.string,direction:r.PropTypes.oneOf(["up","down","left","right"]),flush:r.PropTypes.bool,texture:r.PropTypes.string},getDefaultProps:function(){return{colored:!1,direction:"down",flush:!0,small:!1}},render:function(){var e=[i],t=[i+"__content"];this.props.compact&&e.push(i+"--compact"),this.props.centered&&e.push(i+"--centered"),this.props.flush&&e.push(i+"--flush"),this.props.direction&&e.push(i+"--"+this.props.direction),this.props.colorIndex&&e.push("background-color-index-"+this.props.colorIndex),this.props.className&&e.push(this.props.className);var n={};return this.props.texture&&(n.backgroundImage=this.props.texture),r.createElement("div",{className:e.join(" "),style:n},r.createElement("div",{className:t.join(" ")},this.props.children))}});e.exports=a},function(e,t,n){var r=n(42),i=n(35),a=n(48),s="table",o=r.createClass({displayName:"Table",propTypes:{selection:r.PropTypes.number,onMore:r.PropTypes.func,scrollable:r.PropTypes.bool,selectable:r.PropTypes.bool},mixins:[a],getDefaultProps:function(){return{selection:null,scrollable:!1,selectable:!1}},_clearSelection:function(){for(var e=this.refs.table.getDOMNode().querySelectorAll("."+s+"__row--selected"),t=0;t0&&!this._keyboardAcceleratorListening&&(window.addEventListener("keydown",this._onKeyboardAcceleratorKeyPress),this._keyboardAcceleratorListening=!0)},stopListeningToKeyboard:function(e){if(e)for(var t in e)if(e.hasOwnProperty(t)){var n=t;r.hasOwnProperty(t)&&(n=r[t]),delete this._keyboardAcceleratorHandlers[n]}var i=0;for(var a in this._keyboardAcceleratorHandlers)this._keyboardAcceleratorHandlers.hasOwnProperty(a)&&(i+=1);e&&0!==i||(window.removeEventListener("keydown",this._onKeyboardAcceleratorKeyPress),this._keyboardAcceleratorHandlers={},this._keyboardAcceleratorListening=!1)},componentWillUnmount:function(){this.stopListeningToKeyboard()}};e.exports=i},function(e,t,n){var r=n(42),i={componentWillUnmount:function(){this._unrenderLayer(),document.body.removeChild(this._target)},componentDidUpdate:function(){this._renderLayer()},componentDidMount:function(){this._target=document.createElement("div"),document.body.appendChild(this._target),this._renderLayer()},_renderLayer:function(){r.render(this.renderLayer(),this._target)},_unrenderLayer:function(){r.unmountComponentAtNode(this._target)}};e.exports=i},function(e,t,n){var r=n(56),i=n(41),a=r.createActions({login:{asyncResult:!0},logout:{}});a.login.listen(function(e,t){if(!e||!t)return this.failed(400,{message:"loginInvalidPassword"});var n=this;i.post("/rest/login-sessions",{authLoginDomain:"LOCAL",userName:e,password:t,loginMsgAck:!0}).end(function(t,r){return t||!r.ok?n.failed(t,r.body):void n.completed(e,r.body.sessionID)})}),e.exports=a},function(e,t,n){var r=n(56),i=n(39),a=n(49),s="token",o="user",l="loginTime",c="email",u=r.createStore({_data:{id:null,name:null,created:null,email:null,loginError:null},init:function(){this._data.id=a.get(s),this._data.name=a.get(o),this._data.created=a.get(l),this._data.email=a.get(c),this.listenTo(i.login.completed,this._onLoginCompleted),this.listenTo(i.login.failed,this._onLoginFailed),this.listenTo(i.logout,this._onLogout)},_onLoginCompleted:function(e,t){this._data.id=t,this._data.name=e,this._data.created=new Date,this._data.loginError=null,-1!==e.indexOf("@")&&(this._data.email=e),a.set(s,this._data.id),a.set(o,this._data.name),a.set(l,this._data.created),a.set(c,this._data.email),this.trigger(this._data)},_onLoginFailed:function(e,t){this._data.loginError={message:t.message,resolution:t.resolution},this.trigger(this._data)},_onLogout:function(){this._data.id=null,this._data.name=null,this._data.created=null,this._data.email=null,a.remove(s),a.remove(o),a.remove(l),a.remove(c),this.trigger(this._data)},getInitialState:function(){return this._data}});e.exports=u},function(e,t,n){function r(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(null!==r&&void 0!==r)if(Array.isArray(r))for(var i=0;ir?a-=a+i-r:0>a&&(a=0);var s=n.top;"up"===this.props.direction?s=n.top+n.height-t.offsetHeight:"below"===this._overlay.align&&(s=n.top+n.height);var o=window.innerHeight-s;t.style.left=""+a+"px",t.style.width=""+i+"px",t.style.top=""+s+"px",t.style.maxHeight=""+o+"px"},componentWillUnmount:function(){this.stopOverlay()}};e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"DropCaret",render:function(){var e="control-icon control-icon-drop-caret";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 48 48",version:"1.1"},r.createElement("g",{stroke:"none"},r.createElement("polygon",{points:"33.4,19.7 24.1,30.3 14.8,19.7"})))}});e.exports=i},function(e,t,n){var r=n(59),i=2e3,a=200,s={_infiniteScroll:{indicatorElement:null,scrollParent:null,onEnd:null},_onScroll:function(){clearTimeout(this._infiniteScroll.scrollTimer),this._infiniteScroll.scrollTimer=setTimeout(function(){var e=this._infiniteScroll.scrollParent.getBoundingClientRect(),t=this._infiniteScroll.indicatorElement.getBoundingClientRect();t.bottom<=e.bottom&&this._infiniteScroll.onEnd()}.bind(this),i)},startListeningForScroll:function(e,t){this._infiniteScroll.onEnd=t,this._infiniteScroll.indicatorElement=e,this._infiniteScroll.scrollParent=r.findScrollParents(e)[0],this._infiniteScroll.scrollParent.addEventListener("scroll",this._onScroll),this._infiniteScroll.scrollParent===document&&(this._infiniteScroll.scrollTimer=setTimeout(t,a))},stopListeningForScroll:function(){this._infiniteScroll.scrollParent&&(clearTimeout(this._infiniteScroll.scrollTimer),this._infiniteScroll.scrollParent.removeEventListener("scroll",this._onScroll),this._infiniteScroll.scrollParent=null)},componentWillUnmount:function(){this.stopListeningForScroll()}};e.exports=s},function(e,t,n){var r={get:function(e){return e?decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null:null},set:function(e,t,n,r,i,a){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var s="";if(n)switch(n.constructor){case Number:s=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:s="; expires="+n;break;case Date:s="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+s+(i?"; domain="+i:"")+(r?"; path="+r:"")+(a?"; secure":""), +!0},remove:function(e,t,n){return this.has(e)?(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0):!1},has:function(e){return e?new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie):!1},keys:function(){for(var e=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),t=e.length,n=0;t>n;n++)e[n]=decodeURIComponent(e[n]);return e}};e.exports=r},function(e,t,n){var r=n(42),i=r.createClass({displayName:"OK",render:function(){var e="status-icon status-icon-ok";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#43A547"},r.createElement("path",{d:"M0,4.4058651 L0,19.657478 C0,21.7548387 2.41428571,23.9929619 4.68571429,23.9929619 L19.4571429,23.9929619 C21.7285714,23.9929619 24,21.8956012 24,19.657478 L24,4.4058651 C24,2.3085044 21.7285714,0.0703812317 19.4571429,0.0703812317 L4.68571429,0.0703812317 C2.27142857,0.0703812317 0,2.16774194 0,4.4058651 L0,4.4058651 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF",transform:"translate(4.214286, 3.519062)"},r.createElement("path",{d:"M0.0428571429,6.76363636 L0.0428571429,10.5431085 L6.86428571,15.4416422 L15.6642857,4.80703812 L15.6642857,0.0492668622 L6.15,11.2469208 L0.0428571429,6.76363636 Z"})))}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"ErrorStatus",render:function(){var e="status-icon status-icon-error";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#DC462F"},r.createElement("circle",{cx:"12",cy:"12",r:"12"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF"},r.createElement("rect",{x:"4",y:"10",width:"16",height:"4"})))}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Warning",render:function(){var e="status-icon status-icon-warning";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 27 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#F3B51D"},r.createElement("path",{d:"M26.758209,22.8752239 L14.1062687,0.494328358 C13.8268657,-0.071641791 13.2608955,-0.071641791 12.838209,0.494328358 L0.179104478,22.8752239 C-0.100298507,23.441194 0.179104478,24 0.745074627,24 L26.0561194,24 C26.758209,24 27.0376119,23.5773134 26.758209,22.8752239 L26.758209,22.8752239 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF",transform:"translate(12.250746, 7.307463)"},r.createElement("path",{d:"M2.69373134,9.01970149 L0.0214925373,9.01970149 L0.0214925373,0.0143283582 L2.69373134,0.0143283582 L2.69373134,9.01970149 L2.69373134,9.01970149 Z M2.69373134,10.9898507 L0.0214925373,10.9898507 L0.0214925373,13.6620896 L2.69373134,13.6620896 L2.69373134,10.9898507 L2.69373134,10.9898507 Z"})))}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Disabled",render:function(){var e="status-icon status-icon-disabled";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#848484"},r.createElement("path",{d:"M12,0 L0,12 L12,24 L24,12 L12,0 L12,0 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF"},r.createElement("circle",{cx:"12",cy:"12",r:"5.5"})))}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Unknown",render:function(){var e="status-icon status-icon-unknown";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#848484"},r.createElement("path",{d:"M12,0 L0,12 L12,24 L24,12 L12,0 L12,0 Z"})),r.createElement("g",{className:"status-icon__detail",fill:"#FFFFFF",transform:"translate(7.524324, 4.994595)"},r.createElement("path",{d:"M8.89945946,3.97621622 C8.89945946,4.48216216 8.64648649,4.98810811 8.39351351,5.49405405 C8.0172973,5.87027027 7.51135135,6.62918919 6.49945946,7.38810811 C5.99351351,7.76432432 5.74054054,8.14702703 5.6172973,8.4 L5.6172973,8.77621622 C5.49405405,9.02918919 5.49405405,9.53513514 5.49405405,10.1643243 L3.47027027,10.1643243 L3.47027027,9.53513514 C3.47027027,8.90594595 3.59351351,8.0172973 3.84648649,7.51135135 C3.96972973,7.13513514 4.47567568,6.62918919 5.23459459,5.99351351 C5.99351351,5.36432432 6.36972973,4.98162162 6.49945946,4.85837838 C6.75243243,4.60540541 6.87567568,4.35243243 6.87567568,3.97621622 C6.87567568,3.6 6.6227027,3.2172973 6.24648649,2.84108108 C5.87027027,2.46486486 5.23459459,2.33513514 4.60540541,2.33513514 C3.97621622,2.33513514 3.47027027,2.45837838 2.96432432,2.71135135 C2.58810811,2.96432432 2.20540541,3.34054054 2.08216216,3.84648649 L0.0583783784,3.84648649 C0.0583783784,2.83459459 0.564324324,1.95243243 1.32324324,1.19351351 C2.20540541,0.434594595 3.2172973,0.0583783784 4.48216216,0.0583783784 C5.87027027,0.0583783784 7.00540541,0.434594595 7.76432432,1.19351351 C8.51675676,1.95891892 8.89945946,2.96432432 8.89945946,3.97621622 L8.89945946,3.97621622 Z M4.47567568,10.9232432 C3.71675676,10.9232432 2.95783784,11.6821622 2.95783784,12.4410811 C2.95783784,13.2 3.71675676,13.9589189 4.47567568,13.9589189 C5.23459459,13.9589189 5.99351351,13.2 5.99351351,12.4410811 C5.99351351,11.6821622 5.23459459,10.9232432 4.47567568,10.9232432 L4.47567568,10.9232432 Z"})))}});e.exports=i},function(e,t,n){var r=n(42),i=r.createClass({displayName:"Label",render:function(){var e="status-icon status-icon-label";return this.props.className&&(e+=" "+this.props.className),r.createElement("svg",{className:e,viewBox:"0 0 24 24",version:"1.1"},r.createElement("g",{className:"status-icon__base",fill:"#CCCCCC"},r.createElement("circle",{cx:"12",cy:"12",r:"12"})))}});e.exports=i},function(e,t,n){e.exports=n(64)},function(e,t,n){function r(e){return n(i(e))}function i(e){return a[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var a={"./en-US":58,"./en-US.js":58,"./pt-BR":61,"./pt-BR.js":61};r.keys=function(){return Object.keys(a)},r.resolve=i,e.exports=r,r.id=57},function(e,t,n){e.exports={IndexFilters:{filters:"{quantity, plural,\n =0 {Filters}\n =1 {one filter}\n other {# filters}\n}"},Active:"Active",Alerts:"Alerts",All:"All",Category:"Category",Cleared:"Cleared",Completed:"Completed",created:"Created",Critical:"Critical",Disabled:"Disabled",Error:"Error",loginInvalidPassword:"Please provide Username and Password.","Log In":"Log In",Logout:"Logout",model:"Model",modified:"Modified",Name:"Name",OK:"OK",Password:"Password","Remember me":"Remember me",Resource:"Resource",Running:"Running",Search:"Search",State:"State",Status:"Status",Tasks:"Tasks",Time:"Time",Total:"Total",Unknown:"Unknown",Username:"Username",uri:"URI",Warning:"Warning"}},function(e,t,n){e.exports={findScrollParents:function(e){for(var t=[],n=e.parentNode;n;)n.scrollHeight>n.offsetHeight+10&&t.push(n),n=n.parentNode;return 0===t.length&&t.push(document),t}}},function(e,t,n){(function(r){"use strict";var i=r.React;r.React=n(42);var a=n(68);if(n(67),t=e.exports=a.IntlMixin,Object.keys(a).forEach(function(e){Object.defineProperty(t,e,{enumerable:!0,value:a[e]})}),i)r.React=i;else try{delete r.React}catch(s){r.React=void 0}}).call(t,function(){return this}())},function(e,t,n){e.exports={IndexFilters:{filters:"{quantity, plural,\n =0 {Filtros}\n =1 {um filtro}\n other {# filtros}\n}"},Active:"Ativos",Alerts:"Alertas",All:"Todos",Category:"Categoria",Cleared:"Livre",Completed:"Completado",created:"Criado",Critical:"Crítico",Disabled:"Desabilitado",Error:"Erro",loginInvalidPassword:"Por favor, informe Usuário e Senha.","Log In":"Logar",Logout:"Deslogar",model:"Modelo",modified:"Modificado",Name:"Nome",OK:"OK",Password:"Senha","Remember me":"Lembrar Usuário",Resource:"Recurso",Running:"Executando",Search:"Buscar",State:"Estado",Status:"Situaçāo",Tasks:"Tarefas",Time:"Data",Total:"Total",Unknown:"Desconhecido",Username:"Usuário",uri:"URI",Warning:"Alerta"}},function(e,t,n){function r(){}function i(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function a(e){return e===Object(e)}function s(e){if(!a(e))return e;var t=[];for(var n in e)null!=e[n]&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}function o(e){for(var t,n,r={},i=e.split("&"),a=0,s=i.length;s>a;++a)n=i[a],t=n.split("="),r[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return r}function l(e){var t,n,r,i,a=e.split(/\r?\n/),s={};a.pop();for(var o=0,l=a.length;l>o;++o)n=a[o],t=n.indexOf(":"),r=n.slice(0,t).toLowerCase(),i=y(n.slice(t+1)),s[r]=i;return s}function c(e){return e.split(/ *; */).shift()}function u(e){return f(e.split(/ *; */),function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e},{})}function p(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=l(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function h(e,t){var n=this;d.call(this),this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new p(n)}catch(r){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=r,n.callback(e)}if(n.emit("response",t),e)return n.callback(e,t);if(t.status>=200&&t.status<300)return n.callback(e,t);var i=new Error(t.statusText||"Unsuccessful HTTP response");i.original=e,i.response=t,i.status=t.status,n.callback(e||i,t)})}function m(e,t){return"function"==typeof t?new h("GET",e).end(t):1==arguments.length?new h("GET",e):new h(e,t)}var d=n(83),f=n(84),g="undefined"==typeof window?this||self:window;m.getXHR=function(){if(!(!g.XMLHttpRequest||g.location&&"file:"==g.location.protocol&&g.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var y="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};m.serializeObject=s,m.parseString=o,m.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},m.serialize={"application/x-www-form-urlencoded":s,"application/json":JSON.stringify},m.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},p.prototype.get=function(e){return this.header[e.toLowerCase()]},p.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=c(t);var n=u(t);for(var r in n)this[r]=n[r]},p.prototype.parseBody=function(e){var t=m.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},p.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},p.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},m.Response=p,d(h.prototype),h.prototype.use=function(e){return e(this),this},h.prototype.timeout=function(e){return this._timeout=e,this},h.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},h.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},h.prototype.set=function(e,t){if(a(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},h.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},h.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},h.prototype.type=function(e){return this.set("Content-Type",m.types[e]||e),this},h.prototype.accept=function(e){return this.set("Accept",m.types[e]||e),this},h.prototype.auth=function(e,t){var n=btoa(e+":"+t);return this.set("Authorization","Basic "+n),this},h.prototype.query=function(e){return"string"!=typeof e&&(e=s(e)),e&&this._query.push(e),this},h.prototype.field=function(e,t){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t),this},h.prototype.attach=function(e,t,n){return this._formData||(this._formData=new g.FormData),this._formData.append(e,t,n),this},h.prototype.send=function(e){var t=a(e),n=this.getHeader("Content-Type");if(t&&a(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||i(e)?this:(n||this.type("json"),this)},h.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),n(e,t)},h.prototype.crossDomainError=function(){var e=new Error("Origin is not allowed by Access-Control-Allow-Origin");e.crossDomain=!0,this.callback(e)},h.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},h.prototype.withCredentials=function(){return this._withCredentials=!0,this},h.prototype.end=function(e){var t=this,n=this.xhr=m.getXHR(),a=this._query.join("&"),s=this._timeout,o=this._formData||this._data;this._callback=e||r,n.onreadystatechange=function(){if(4==n.readyState){var e;try{e=n.status}catch(r){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var l=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.emit("progress",e)};this.hasListeners("progress")&&(n.onprogress=l);try{n.upload&&this.hasListeners("progress")&&(n.upload.onprogress=l)}catch(c){}if(s&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},s)),a&&(a=m.serializeObject(a),this.url+=~this.url.indexOf("?")?"&"+a:"?"+a),n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof o&&!i(o)){var u=m.serialize[this.getHeader("Content-Type")];u&&(o=u(o))}for(var p in this.header)null!=this.header[p]&&n.setRequestHeader(p,this.header[p]);return this.emit("request",this),n.send(o),this},m.Request=h,m.get=function(e,t,n){var r=m("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},m.head=function(e,t,n){var r=m("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.del=function(e,t){var n=m("DELETE",e);return t&&n.end(t),n},m.patch=function(e,t,n){var r=m("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.post=function(e,t,n){var r=m("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.put=function(e,t,n){var r=m("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},e.exports=m},function(e,t,n){var r,i;(function(a){/** + * @license Copyright 2013 Andy Earnshaw, MIT License + * + * Implements the ECMAScript Internationalization API in ES5-compatible environments, + * following the ECMA-402 specification as closely as possible + * + * ECMA-402: http://ecma-international.org/ecma-402/1.0/ + * + * CLDR format locale data should be provided using IntlPolyfill.__addLocaleData(). + */ +!function(a,s){var o=s();r=o,i="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==i&&(e.exports=i)),e.exports=o,a.Intl||(a.Intl=o,o.__applyLocaleSensitivePrototypes()),a.IntlPolyfill=o}("undefined"!=typeof a?a:this,function(){"use strict";function e(e){return B.test(e)?G.test(e)?!1:U.test(e)?!1:!0:!1}function t(e){var t,n;e=e.toLowerCase(),n=e.split("-");for(var r=1,i=n.length;i>r;r++)if(2===n[r].length)n[r]=n[r].toUpperCase();else if(4===n[r].length)n[r]=n[r].charAt(0).toUpperCase()+n[r].slice(1);else if(1===n[r].length&&"x"!=n[r])break;e=te.call(n,"-"),(t=e.match(H))&&t.length>1&&(t.sort(),e=e.replace(RegExp("(?:"+H.source+")+","i"),te.call(t,""))),$.call(pe.tags,e)&&(e=pe.tags[e]),n=e.split("-");for(var r=1,i=n.length;i>r;r++)$.call(pe.subtags,n[r])?n[r]=pe.subtags[n[r]]:$.call(pe.extLang,n[r])&&(n[r]=pe.extLang[n[r]][0],1===r&&pe.extLang[n[1]][1]===n[0]&&(n=V.call(n,r++),i-=1));return te.call(n,"-")}function n(){return z}function r(e){var t=String(e),n=K(t);return ce.test(n)===!1?!1:!0}function i(n){if(void 0===n)return new D;for(var r=new D,n="string"==typeof n?[n]:n,i=O(n),a=i.length,s=0;a>s;){var o=String(s),l=o in i;if(l){var c=i[o];if(null==c||"string"!=typeof c&&"object"!=typeof c)throw new TypeError("String or Object type expected");var u=String(c);if(!e(u))throw new RangeError("'"+u+"' is not a structurally valid language tag");u=t(u),-1===X.call(r,u)&&ee.call(r,u)}s++}return r}function a(e,t){for(var n=t;;){if(X.call(e,n)>-1)return n;var r=n.lastIndexOf("-");if(0>r)return;r>=2&&"-"==n.charAt(r-2)&&(r-=2),n=n.substring(0,r)}}function s(e,t){for(var r,i=0,s=t.length;s>i&&!r;){var o=t[i],l=String(o).replace(ue,""),r=a(e,l);i++}var c=new A;if(void 0!==r){if(c["[[locale]]"]=r,String(o)!==String(l)){var u=o.match(ue)[0],p=o.indexOf("-u-");c["[[extension]]"]=u,c["[[extensionIndex]]"]=p}}else c["[[locale]]"]=n();return c}function o(e,t){return s(e,t)}function l(e,t,n,r,i){if(0===e.length)throw new ReferenceError("No locale data has been provided for this object yet.");var a=n["[[localeMatcher]]"];if("lookup"===a)var l=s(e,t);else var l=o(e,t);var c=l["[[locale]]"];if($.call(l,"[[extension]]"))var u=l["[[extension]]"],p=l["[[extensionIndex]]"],h=String.prototype.split,m=h.call(u,"-"),d=m.length;var f=new A;f["[[dataLocale]]"]=c;for(var g="-u",y=0,v=r.length;v>y;){var b=r[y],_=i[c],T=_[b],k=T[0],E="",w=X;if(void 0!==m){var x=w.call(m,b);if(-1!==x)if(d>x+1&&m[x+1].length>2){var N=m[x+1],S=w.call(T,N);if(-1!==S)var k=N,E="-"+b+"-"+k}else{var S=w(T,"true");if(-1!==S)var k="true"}}if($.call(n,"[["+b+"]]")){var P=n["[["+b+"]]"];-1!==w.call(T,P)&&P!==k&&(k=P,E="")}f["[["+b+"]]"]=k,g+=E,y++}if(g.length>2)var C=c.substring(0,p),M=c.substring(p),c=C+g+M;return f["[[locale]]"]=c,f}function c(e,t){for(var n=t.length,r=new D,i=0;n>i;){var s=t[i],o=String(s).replace(ue,""),l=a(e,o);void 0!==l&&ee.call(r,s),i++}var c=V.call(r);return c}function u(e,t){return c(e,t)}function p(e,t,n){if(void 0!==n){var n=new A(O(n)),r=n.localeMatcher;if(void 0!==r&&(r=String(r),"lookup"!==r&&"best fit"!==r))throw new RangeError('matcher should be "lookup" or "best fit"')}if(void 0===r||"best fit"===r)var i=u(e,t);else var i=c(e,t);for(var a in i)$.call(i,a)&&Z(i,a,{writable:!1,configurable:!1,value:i[a]});return Z(i,"length",{writable:!1}),i}function h(e,t,n,r,i){var a=e[t];if(void 0!==a){if(a="boolean"===n?Boolean(a):"string"===n?String(a):a,void 0!==r&&-1===X.call(r,a))throw new RangeError("'"+a+"' is not an allowed value for `"+t+"`");return a}return i}function m(e,t,n,r,i){var a=e[t];if(void 0!==a){if(a=Number(a),isNaN(a)||n>a||a>r)throw new RangeError("Value is not a number or outside accepted range");return Math.floor(a)}return i}function d(){var e=arguments[0],t=arguments[1];return this&&this!==W?f(O(this),e,t):new W.NumberFormat(e,t)}function f(e,t,n){var a=R(e),s=I();if(a["[[initializedIntlObject]]"]===!0)throw new TypeError("`this` object has already been initialized as an Intl object");Z(e,"__getInternalProperties",{value:function(){return arguments[0]===ae?a:void 0}}),a["[[initializedIntlObject]]"]=!0;var o=i(t);n=void 0===n?{}:O(n);var c=new A,u=h(n,"localeMatcher","string",new D("lookup","best fit"),"best fit");c["[[localeMatcher]]"]=u;var p=ie.NumberFormat["[[localeData]]"],d=l(ie.NumberFormat["[[availableLocales]]"],o,c,ie.NumberFormat["[[relevantExtensionKeys]]"],p);a["[[locale]]"]=d["[[locale]]"],a["[[numberingSystem]]"]=d["[[nu]]"],a["[[dataLocale]]"]=d["[[dataLocale]]"];var f=d["[[dataLocale]]"],v=h(n,"style","string",new D("decimal","percent","currency"),"decimal");a["[[style]]"]=v;var b=h(n,"currency","string");if(void 0!==b&&!r(b))throw new RangeError("'"+b+"' is not a valid currency code");if("currency"===v&&void 0===b)throw new TypeError("Currency code is required when style is currency");if("currency"===v){b=b.toUpperCase(),a["[[currency]]"]=b;var _=g(b)}var T=h(n,"currencyDisplay","string",new D("code","symbol","name"),"symbol");"currency"===v&&(a["[[currencyDisplay]]"]=T);var k=m(n,"minimumIntegerDigits",1,21,1);a["[[minimumIntegerDigits]]"]=k;var E="currency"===v?_:0,w=m(n,"minimumFractionDigits",0,20,E);a["[[minimumFractionDigits]]"]=w;var x="currency"===v?Math.max(w,_):"percent"===v?Math.max(w,0):Math.max(w,3),N=m(n,"maximumFractionDigits",w,20,x);a["[[maximumFractionDigits]]"]=N;var S=n.minimumSignificantDigits,P=n.maximumSignificantDigits;(void 0!==S||void 0!==P)&&(S=m(n,"minimumSignificantDigits",1,21,1),P=m(n,"maximumSignificantDigits",S,21,21),a["[[minimumSignificantDigits]]"]=S,a["[[maximumSignificantDigits]]"]=P);var C=h(n,"useGrouping","boolean",void 0,!0);a["[[useGrouping]]"]=C;var M=p[f],j=M.patterns,L=j[v];return a["[[positivePattern]]"]=L.positivePattern,a["[[negativePattern]]"]=L.negativePattern,a["[[boundFormat]]"]=void 0,a["[[initializedNumberFormat]]"]=!0,J&&(e.format=y.call(e)),s.exp.test(s.input),e}function g(e){return void 0!==he[e]?he[e]:2}function y(){var e=null!=this&&"object"==typeof this&&R(this);if(!e||!e["[[initializedNumberFormat]]"])throw new TypeError("`this` value for format() is not an initialized Intl.NumberFormat object.");if(void 0===e["[[boundFormat]]"]){var t=function(e){return v(this,Number(e))},n=re.call(t,this);e["[[boundFormat]]"]=n}return e["[[boundFormat]]"]}function v(e,t){var n,r=I(),i=R(e),a=i["[[dataLocale]]"],s=i["[[numberingSystem]]"],o=ie.NumberFormat["[[localeData]]"][a],l=o.symbols[s]||o.symbols.latn,c=!1;if(isFinite(t)===!1)isNaN(t)?n=l.nan:(n=l.infinity,0>t&&(c=!0));else{if(0>t&&(c=!0,t=-t),"percent"===i["[[style]]"]&&(t*=100),n=$.call(i,"[[minimumSignificantDigits]]")&&$.call(i,"[[maximumSignificantDigits]]")?b(t,i["[[minimumSignificantDigits]]"],i["[[maximumSignificantDigits]]"]):_(t,i["[[minimumIntegerDigits]]"],i["[[minimumFractionDigits]]"],i["[[maximumFractionDigits]]"]),me[s]){var u=me[i["[[numberingSystem]]"]];n=String(n).replace(/\d/g,function(e){return u[e]})}else n=String(n);if(n=n.replace(/\./g,l.decimal),i["[[useGrouping]]"]===!0){var p=n.split(l.decimal),h=p[0],m=o.patterns.primaryGroupSize||3,d=o.patterns.secondaryGroupSize||m;if(h.length>m){var f=new D,g=h.length-m,y=g%d,v=h.slice(0,y);for(v.length&&ee.call(f,v);g>y;)ee.call(f,h.slice(y,y+d)),y+=d;ee.call(f,h.slice(g)),p[0]=te.call(f,l.group)}n=te.call(p,l.decimal)}}var T=i[c===!0?"[[negativePattern]]":"[[positivePattern]]"];if(T=T.replace("{number}",n),"currency"===i["[[style]]"]){var k,E=i["[[currency]]"],w=o.currencies[E];switch(i["[[currencyDisplay]]"]){case"symbol":k=w||E;break;default:case"code":case"name":k=E}T=T.replace("{currency}",k)}return r.exp.test(r.input),T}function b(e,t,n){var r=n;if(0===e)var i=te.call(Array(r+1),"0"),a=0;else var a=j(Math.abs(e)),s=Math.round(Math.exp(Math.abs(a-r+1)*Math.LN10)),i=String(Math.round(0>a-r+1?e*s:e/s));if(a>=r)return i+te.call(Array(a-r+1+1),"0");if(a===r-1)return i;if(a>=0?i=i.slice(0,a+1)+"."+i.slice(a+1):0>a&&(i="0."+te.call(Array(-(a+1)+1),"0")+i),i.indexOf(".")>=0&&n>t){for(var o=n-t;o>0&&"0"===i.charAt(i.length-1);)i=i.slice(0,-1),o--;"."===i.charAt(i.length-1)&&(i=i.slice(0,-1))}return i}function _(e,t,n,r){var i,a=Number.prototype.toFixed.call(e,r),s=a.split(".")[0].length,o=r-n,l=(i=a.indexOf("e"))>-1?a.slice(i+1):0;for(l&&(a=a.slice(0,i).replace(".",""),a+=te.call(Array(l-(a.length-1)+1),"0")+"."+te.call(Array(r+1),"0"),s=a.length);o>0&&"0"===a.slice(-1);)a=a.slice(0,-1),o--;if("."===a.slice(-1)&&(a=a.slice(0,-1)),t>s)var c=te.call(Array(t-s+1),"0");return(c?c:"")+a}function T(){var e=arguments[0],t=arguments[1];return this&&this!==W?k(O(this),e,t):new W.DateTimeFormat(e,t)}function k(e,t,n){var r=R(e),a=I();if(r["[[initializedIntlObject]]"]===!0)throw new TypeError("`this` object has already been initialized as an Intl object");Z(e,"__getInternalProperties",{value:function(){return arguments[0]===ae?r:void 0}}),r["[[initializedIntlObject]]"]=!0;var s=i(t),n=E(n,"any","date"),o=new A;_=h(n,"localeMatcher","string",new D("lookup","best fit"),"best fit"),o["[[localeMatcher]]"]=_;var c=ie.DateTimeFormat,u=c["[[localeData]]"],p=l(c["[[availableLocales]]"],s,o,c["[[relevantExtensionKeys]]"],u);r["[[locale]]"]=p["[[locale]]"],r["[[calendar]]"]=p["[[ca]]"],r["[[numberingSystem]]"]=p["[[nu]]"],r["[[dataLocale]]"]=p["[[dataLocale]]"];var m=p["[[dataLocale]]"],d=n.timeZone;if(void 0!==d&&(d=K(d),"UTC"!==d))throw new RangeError("timeZone is not supported.");r["[[timeZone]]"]=d,o=new A;for(var f in de)if($.call(de,f)){var g=h(n,f,"string",de[f]);o["[["+f+"]]"]=g}var y,v=u[m],b=v.formats,_=h(n,"formatMatcher","string",new D("basic","best fit"),"best fit");y="basic"===_?w(o,b):N(o,b);for(var f in de)if($.call(de,f)&&$.call(y,f)){var T=y[f];r["[["+f+"]]"]=T}var k,x=h(n,"hour12","boolean");if(r["[[hour]]"])if(x=void 0===x?v.hour12:x,r["[[hour12]]"]=x,x===!0){var P=v.hourNo0;r["[[hourNo0]]"]=P,k=y.pattern12}else k=y.pattern;else k=y.pattern;return r["[[pattern]]"]=k,r["[[boundFormat]]"]=void 0,r["[[initializedDateTimeFormat]]"]=!0,J&&(e.format=S.call(e)),a.exp.test(a.input),e}function E(e,t,n){if(void 0===e)e=null;else{var r=O(e);e=new A;for(var i in r)e[i]=r[i]}var a=Y,e=a(e),s=!0;return("date"===t||"any"===t)&&(void 0!==e.weekday||void 0!==e.year||void 0!==e.month||void 0!==e.day)&&(s=!1),("time"===t||"any"===t)&&(void 0!==e.hour||void 0!==e.minute||void 0!==e.second)&&(s=!1),!s||"date"!==n&&"all"!==n||(e.year=e.month=e.day="numeric"),!s||"time"!==n&&"all"!==n||(e.hour=e.minute=e.second="numeric"),e}function w(e,t){return x(e,t)}function x(e,t,n){for(var r,i=8,a=120,s=20,o=8,l=6,c=6,u=3,p=-(1/0),h=0,m=t.length;m>h;){var d=t[h],f=0;for(var g in de)if($.call(de,g)){var y=e["[["+g+"]]"],v=$.call(d,g)?d[g]:void 0;if(void 0===y&&void 0!==v)f-=s;else if(void 0!==y&&void 0===v)f-=a;else{var b=["2-digit","numeric","narrow","short","long"],_=X.call(b,y),T=X.call(b,v),k=Math.max(Math.min(T-_,2),-2);!n||("numeric"!==y&&"2-digit"!==y||"numeric"===v||"2-digit"===v)&&("numeric"===y||"2-digit"===y||"2-digit"!==v&&"numeric"!==v)||(f-=i),2===k?f-=l:1===k?f-=u:-1===k?f-=c:-2===k&&(f-=o)}}f>p&&(p=f,r=d),h++}return r}function N(e,t){return x(e,t,!0)}function S(){var e=null!=this&&"object"==typeof this&&R(this);if(!e||!e["[[initializedDateTimeFormat]]"])throw new TypeError("`this` value for format() is not an initialized Intl.DateTimeFormat object.");if(void 0===e["[[boundFormat]]"]){var t=function(){var e=Number(0===arguments.length?Date.now():arguments[0]);return P(this,e)},n=re.call(t,this);e["[[boundFormat]]"]=n}return e["[[boundFormat]]"]}function P(e,t){if(!isFinite(t))throw new RangeError("Invalid valid date passed to format");var n=e.__getInternalProperties(ae),r=I(),i=n["[[locale]]"],a=new W.NumberFormat([i],{useGrouping:!1}),s=new W.NumberFormat([i],{minimumIntegerDigits:2,useGrouping:!1}),o=C(t,n["[[calendar]]"],n["[[timeZone]]"]),l=n["[[pattern]]"],c=n["[[dataLocale]]"],u=ie.DateTimeFormat["[[localeData]]"][c].calendars,p=n["[[calendar]]"];for(var h in de)if($.call(n,"[["+h+"]]")){var m,d,f=n["[["+h+"]]"],g=o["[["+h+"]]"];if("year"===h&&0>=g?g=1-g:"month"===h?g++:"hour"===h&&n["[[hour12]]"]===!0&&(g%=12,m=g!==o["[["+h+"]]"],0===g&&n["[[hourNo0]]"]===!0&&(g=12)),"numeric"===f)d=v(a,g);else if("2-digit"===f)d=v(s,g),d.length>2&&(d=d.slice(-2));else if(f in se)switch(h){case"month":d=F(u,p,"months",f,o["[["+h+"]]"]);break;case"weekday":try{d=F(u,p,"days",f,o["[["+h+"]]"])}catch(y){throw new Error("Could not find weekday data for locale "+i)}break;case"timeZoneName":d="";break;default:d=o["[["+h+"]]"]}l=l.replace("{"+h+"}",d)}return n["[[hour12]]"]===!0&&(d=F(u,p,"dayPeriods",m?"pm":"am"),l=l.replace("{ampm}",d)),r.exp.test(r.input),l}function C(e,t,n){var r=new Date(e),i="get"+(n||"");return new A({"[[weekday]]":r[i+"Day"](),"[[era]]":+(r[i+"FullYear"]()>=0),"[[year]]":r[i+"FullYear"](),"[[month]]":r[i+"Month"](),"[[day]]":r[i+"Date"](),"[[hour]]":r[i+"Hours"](),"[[minute]]":r[i+"Minutes"](),"[[second]]":r[i+"Seconds"](),"[[inDST]]":!1})}function M(e,t){if(!e.number)throw new Error("Object passed doesn't contain locale data for Intl.NumberFormat");var n,r=[t],i=t.split("-");for(i.length>2&&4==i[1].length&&ee.call(r,i[0]+"-"+i[2]);n=ne.call(r);)ee.call(ie.NumberFormat["[[availableLocales]]"],n),ie.NumberFormat["[[localeData]]"][n]=e.number,e.date&&(e.date.nu=e.number.nu,ee.call(ie.DateTimeFormat["[[availableLocales]]"],n),ie.DateTimeFormat["[[localeData]]"][n]=e.date);void 0===z&&(z=t),oe||(f(W.NumberFormat.prototype),oe=!0),e.date&&!le&&(k(W.DateTimeFormat.prototype),le=!0)}function j(e){if("function"==typeof Math.log10)return Math.floor(Math.log10(e));var t=Math.round(Math.log(e)*Math.LOG10E);return t-(Number("1e"+t)>e)}function L(e){if(!$.call(this,"[[availableLocales]]"))throw new TypeError("supportedLocalesOf() is not a constructor");var t=I(),n=arguments[1],r=this["[[availableLocales]]"],a=i(e);return t.exp.test(t.input),p(r,a,n)}function F(e,t,n,r,i){var a=e[t]&&e[t][n]?e[t][n]:e.gregory[n],s={narrow:["short","long"],"short":["long","narrow"],"long":["short","narrow"]},o=$.call(a,r)?a[r]:$.call(a,s[r][0])?a[s[r][0]]:a[s[r][1]];return null!=i?o[i]:o}function A(e){for(var t in e)(e instanceof A||$.call(e,t))&&Z(this,t,{value:e[t],enumerable:!0,writable:!0,configurable:!0})}function D(){Z(this,"length",{writable:!0,value:0}),arguments.length&&ee.apply(this,V.call(arguments))}function I(){for(var e=/[.?*+^$[\]\\(){}|-]/g,t=RegExp.lastMatch,n=RegExp.multiline?"m":"",r={input:RegExp.input},i=new D,a=!1,s={},o=1;9>=o;o++)a=(s["$"+o]=RegExp["$"+o])||a;if(t=t.replace(e,"\\$&"),a)for(var o=1;9>=o;o++){var l=s["$"+o];l?(l=l.replace(e,"\\$&"),t=t.replace(l,"("+l+")")):t="()"+t,ee.call(i,t.slice(0,t.indexOf("(")+1)),t=t.slice(t.indexOf("(")+1)}return r.exp=new RegExp(te.call(i,"")+t,n),r}function K(e){for(var t=e.length;t--;){var n=e.charAt(t);n>="a"&&"z">=n&&(e=e.slice(0,t)+n.toUpperCase()+e.slice(t+1))}return e}function O(e){if(null==e)throw new TypeError("Cannot convert null or undefined to object");return Object(e)}function R(e){return $.call(e,"__getInternalProperties")?e.__getInternalProperties(ae):Y(null)}var z,B,H,G,U,W={},q=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),J=!q&&!Object.prototype.__defineGetter__,$=Object.prototype.hasOwnProperty,Z=q?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!$.call(e,t)||"value"in n)&&(e[t]=n.value)},X=Array.prototype.indexOf||function(e){var t=this;if(!t.length)return-1;for(var n=arguments[1]||0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},Y=Object.create||function(e,t){function n(){}var r;n.prototype=e,r=new n;for(var i in t)$.call(t,i)&&Z(r,i,t[i]);return r},V=Array.prototype.slice,Q=Array.prototype.concat,ee=Array.prototype.push,te=Array.prototype.join,ne=Array.prototype.shift,re=(Array.prototype.unshift,Function.prototype.bind||function(e){var t=this,n=V.call(arguments,1);return 1===t.length?function(r){return t.apply(e,Q.call(n,V.call(arguments)))}:function(){return t.apply(e,Q.call(n,V.call(arguments)))}}),ie=Y(null),ae=Math.random(),se=Y(null,{narrow:{},"short":{},"long":{}}),oe=!1,le=!1,ce=/^[A-Z]{3}$/,ue=/-u(?:-[0-9a-z]{2,8})+/gi,pe={tags:{"art-lojban":"jbo","i-ami":"ami","i-bnn":"bnn","i-hak":"hak","i-klingon":"tlh","i-lux":"lb","i-navajo":"nv","i-pwn":"pwn","i-tao":"tao","i-tay":"tay","i-tsu":"tsu","no-bok":"nb","no-nyn":"nn","sgn-BE-FR":"sfb","sgn-BE-NL":"vgt","sgn-CH-DE":"sgg","zh-guoyu":"cmn","zh-hakka":"hak","zh-min-nan":"nan","zh-xiang":"hsn","sgn-BR":"bzs","sgn-CO":"csn","sgn-DE":"gsg","sgn-DK":"dsl","sgn-ES":"ssp","sgn-FR":"fsl","sgn-GB":"bfi","sgn-GR":"gss","sgn-IE":"isg","sgn-IT":"ise","sgn-JP":"jsl","sgn-MX":"mfs","sgn-NI":"ncs","sgn-NL":"dse","sgn-NO":"nsl","sgn-PT":"psr","sgn-SE":"swl","sgn-US":"ase","sgn-ZA":"sfs","zh-cmn":"cmn","zh-cmn-Hans":"cmn-Hans","zh-cmn-Hant":"cmn-Hant","zh-gan":"gan","zh-wuu":"wuu","zh-yue":"yue"},subtags:{BU:"MM",DD:"DE",FX:"FR",TP:"TL",YD:"YE",ZR:"CD",heploc:"alalc97","in":"id",iw:"he",ji:"yi",jw:"jv",mo:"ro",ayx:"nun",bjd:"drl",ccq:"rki",cjr:"mom",cka:"cmr",cmk:"xch",drh:"khk",drw:"prs",gav:"dev",hrr:"jal",ibi:"opa",kgh:"kml",lcq:"ppr",mst:"mry",myt:"mry",sca:"hle",tie:"ras",tkk:"twm",tlw:"weo",tnf:"prs",ybd:"rki",yma:"lrr"},extLang:{aao:["aao","ar"],abh:["abh","ar"],abv:["abv","ar"],acm:["acm","ar"],acq:["acq","ar"],acw:["acw","ar"],acx:["acx","ar"],acy:["acy","ar"],adf:["adf","ar"],ads:["ads","sgn"],aeb:["aeb","ar"],aec:["aec","ar"],aed:["aed","sgn"],aen:["aen","sgn"],afb:["afb","ar"],afg:["afg","sgn"],ajp:["ajp","ar"],apc:["apc","ar"],apd:["apd","ar"],arb:["arb","ar"],arq:["arq","ar"],ars:["ars","ar"],ary:["ary","ar"],arz:["arz","ar"],ase:["ase","sgn"],asf:["asf","sgn"],asp:["asp","sgn"],asq:["asq","sgn"],asw:["asw","sgn"],auz:["auz","ar"],avl:["avl","ar"],ayh:["ayh","ar"],ayl:["ayl","ar"],ayn:["ayn","ar"],ayp:["ayp","ar"],bbz:["bbz","ar"],bfi:["bfi","sgn"],bfk:["bfk","sgn"],bjn:["bjn","ms"],bog:["bog","sgn"],bqn:["bqn","sgn"],bqy:["bqy","sgn"],btj:["btj","ms"],bve:["bve","ms"],bvl:["bvl","sgn"],bvu:["bvu","ms"],bzs:["bzs","sgn"],cdo:["cdo","zh"],cds:["cds","sgn"],cjy:["cjy","zh"],cmn:["cmn","zh"],coa:["coa","ms"],cpx:["cpx","zh"],csc:["csc","sgn"],csd:["csd","sgn"],cse:["cse","sgn"],csf:["csf","sgn"],csg:["csg","sgn"],csl:["csl","sgn"],csn:["csn","sgn"],csq:["csq","sgn"],csr:["csr","sgn"],czh:["czh","zh"],czo:["czo","zh"],doq:["doq","sgn"],dse:["dse","sgn"],dsl:["dsl","sgn"],dup:["dup","ms"],ecs:["ecs","sgn"],esl:["esl","sgn"],esn:["esn","sgn"],eso:["eso","sgn"],eth:["eth","sgn"],fcs:["fcs","sgn"],fse:["fse","sgn"],fsl:["fsl","sgn"],fss:["fss","sgn"],gan:["gan","zh"],gds:["gds","sgn"],gom:["gom","kok"],gse:["gse","sgn"],gsg:["gsg","sgn"],gsm:["gsm","sgn"],gss:["gss","sgn"],gus:["gus","sgn"],hab:["hab","sgn"],haf:["haf","sgn"],hak:["hak","zh"],hds:["hds","sgn"],hji:["hji","ms"],hks:["hks","sgn"],hos:["hos","sgn"],hps:["hps","sgn"],hsh:["hsh","sgn"],hsl:["hsl","sgn"],hsn:["hsn","zh"],icl:["icl","sgn"],ils:["ils","sgn"],inl:["inl","sgn"],ins:["ins","sgn"],ise:["ise","sgn"],isg:["isg","sgn"],isr:["isr","sgn"],jak:["jak","ms"],jax:["jax","ms"],jcs:["jcs","sgn"],jhs:["jhs","sgn"],jls:["jls","sgn"],jos:["jos","sgn"],jsl:["jsl","sgn"],jus:["jus","sgn"],kgi:["kgi","sgn"],knn:["knn","kok"],kvb:["kvb","ms"],kvk:["kvk","sgn"],kvr:["kvr","ms"],kxd:["kxd","ms"],lbs:["lbs","sgn"],lce:["lce","ms"],lcf:["lcf","ms"],liw:["liw","ms"],lls:["lls","sgn"],lsg:["lsg","sgn"],lsl:["lsl","sgn"],lso:["lso","sgn"],lsp:["lsp","sgn"],lst:["lst","sgn"],lsy:["lsy","sgn"],ltg:["ltg","lv"],lvs:["lvs","lv"],lzh:["lzh","zh"],max:["max","ms"],mdl:["mdl","sgn"],meo:["meo","ms"],mfa:["mfa","ms"],mfb:["mfb","ms"],mfs:["mfs","sgn"],min:["min","ms"],mnp:["mnp","zh"],mqg:["mqg","ms"],mre:["mre","sgn"],msd:["msd","sgn"],msi:["msi","ms"],msr:["msr","sgn"],mui:["mui","ms"],mzc:["mzc","sgn"],mzg:["mzg","sgn"],mzy:["mzy","sgn"],nan:["nan","zh"],nbs:["nbs","sgn"],ncs:["ncs","sgn"],nsi:["nsi","sgn"],nsl:["nsl","sgn"],nsp:["nsp","sgn"],nsr:["nsr","sgn"],nzs:["nzs","sgn"],okl:["okl","sgn"],orn:["orn","ms"],ors:["ors","ms"],pel:["pel","ms"],pga:["pga","ar"],pks:["pks","sgn"],prl:["prl","sgn"],prz:["prz","sgn"],psc:["psc","sgn"],psd:["psd","sgn"],pse:["pse","ms"],psg:["psg","sgn"],psl:["psl","sgn"],pso:["pso","sgn"],psp:["psp","sgn"],psr:["psr","sgn"],pys:["pys","sgn"],rms:["rms","sgn"],rsi:["rsi","sgn"],rsl:["rsl","sgn"],sdl:["sdl","sgn"],sfb:["sfb","sgn"],sfs:["sfs","sgn"],sgg:["sgg","sgn"],sgx:["sgx","sgn"],shu:["shu","ar"],slf:["slf","sgn"],sls:["sls","sgn"],sqk:["sqk","sgn"],sqs:["sqs","sgn"],ssh:["ssh","ar"],ssp:["ssp","sgn"],ssr:["ssr","sgn"],svk:["svk","sgn"],swc:["swc","sw"],swh:["swh","sw"],swl:["swl","sgn"],syy:["syy","sgn"],tmw:["tmw","ms"],tse:["tse","sgn"],tsm:["tsm","sgn"],tsq:["tsq","sgn"],tss:["tss","sgn"],tsy:["tsy","sgn"],tza:["tza","sgn"],ugn:["ugn","sgn"],ugy:["ugy","sgn"],ukl:["ukl","sgn"],uks:["uks","sgn"],urk:["urk","ms"],uzn:["uzn","uz"],uzs:["uzs","uz"],vgt:["vgt","sgn"],vkk:["vkk","ms"],vkt:["vkt","ms"],vsi:["vsi","sgn"],vsl:["vsl","sgn"],vsv:["vsv","sgn"],wuu:["wuu","zh"],xki:["xki","sgn"],xml:["xml","sgn"],xmm:["xmm","ms"],xms:["xms","sgn"],yds:["yds","sgn"],ysl:["ysl","sgn"],yue:["yue","zh"],zib:["zib","sgn"],zlm:["zlm","ms"],zmi:["zmi","ms"],zsl:["zsl","sgn"],zsm:["zsm","ms"]}},he={BHD:3,BYR:0,XOF:0,BIF:0,XAF:0,CLF:0,CLP:0,KMF:0,DJF:0,XPF:0,GNF:0,ISK:0,IQD:3,JPY:0,JOD:3,KRW:0,KWD:3,LYD:3,OMR:3,PYG:0,RWF:0,TND:3,UGX:0,UYI:0,VUV:0,VND:0};!function(){var e="[a-z]{3}(?:-[a-z]{3}){0,2}",t="(?:[a-z]{2,3}(?:-"+e+")?|[a-z]{4}|[a-z]{5,8})",n="[a-z]{4}",r="(?:[a-z]{2}|\\d{3})",i="(?:[a-z0-9]{5,8}|\\d[a-z0-9]{3})",a="[0-9a-wy-z]",s=a+"(?:-[a-z0-9]{2,8})+",o="x(?:-[a-z0-9]{1,8})+",l="(?:en-GB-oed|i-(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)|sgn-(?:BE-FR|BE-NL|CH-DE))",c="(?:art-lojban|cel-gaulish|no-bok|no-nyn|zh-(?:guoyu|hakka|min|min-nan|xiang))",u="(?:"+l+"|"+c+")",p=t+"(?:-"+n+")?(?:-"+r+")?(?:-"+i+")*(?:-"+s+")*(?:-"+o+")?";B=RegExp("^(?:"+p+"|"+o+"|"+u+")$","i"),G=RegExp("^(?!x).*?-("+i+")-(?:\\w{4,8}-(?!x-))*\\1\\b","i"),U=RegExp("^(?!x).*?-("+a+")-(?:\\w+-(?!x-))*\\1\\b","i"),H=RegExp("-"+s,"ig")}(),Z(W,"NumberFormat",{configurable:!0,writable:!0,value:d}),Z(W.NumberFormat,"prototype",{writable:!1}),ie.NumberFormat={"[[availableLocales]]":[],"[[relevantExtensionKeys]]":["nu"],"[[localeData]]":{}},Z(W.NumberFormat,"supportedLocalesOf",{configurable:!0,writable:!0,value:re.call(L,ie.NumberFormat)}),Z(W.NumberFormat.prototype,"format",{configurable:!0,get:y});var me={arab:["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],arabext:["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],bali:["᭐","᭑","᭒","᭓","᭔","᭕","᭖","᭗","᭘","᭙"],beng:["০","১","২","৩","৪","৫","৬","৭","৮","৯"],deva:["०","१","२","३","४","५","६","७","८","९"],fullwide:["0","1","2","3","4","5","6","7","8","9"],gujr:["૦","૧","૨","૩","૪","૫","૬","૭","૮","૯"],guru:["੦","੧","੨","੩","੪","੫","੬","੭","੮","੯"],hanidec:["〇","一","二","三","四","五","六","七","八","九"],khmr:["០","១","២","៣","៤","៥","៦","៧","៨","៩"],knda:["೦","೧","೨","೩","೪","೫","೬","೭","೮","೯"],laoo:["໐","໑","໒","໓","໔","໕","໖","໗","໘","໙"],latn:["0","1","2","3","4","5","6","7","8","9"],limb:["᥆","᥇","᥈","᥉","᥊","᥋","᥌","᥍","᥎","᥏"],mlym:["൦","൧","൨","൩","൪","൫","൬","൭","൮","൯"],mong:["᠐","᠑","᠒","᠓","᠔","᠕","᠖","᠗","᠘","᠙"],mymr:["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],orya:["୦","୧","୨","୩","୪","୫","୬","୭","୮","୯"],tamldec:["௦","௧","௨","௩","௪","௫","௬","௭","௮","௯"],telu:["౦","౧","౨","౩","౪","౫","౬","౭","౮","౯"],thai:["๐","๑","๒","๓","๔","๕","๖","๗","๘","๙"],tibt:["༠","༡","༢","༣","༤","༥","༦","༧","༨","༩"]};Z(W.NumberFormat.prototype,"resolvedOptions",{configurable:!0,writable:!0,value:function(){var e,t=new A,n=["locale","numberingSystem","style","currency","currencyDisplay","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","useGrouping"],r=null!=this&&"object"==typeof this&&R(this);if(!r||!r["[[initializedNumberFormat]]"])throw new TypeError("`this` value for resolvedOptions() is not an initialized Intl.NumberFormat object.");for(var i=0,a=n.length;a>i;i++)$.call(r,e="[["+n[i]+"]]")&&(t[n[i]]={value:r[e],writable:!0,configurable:!0,enumerable:!0});return Y({},t)}}),Z(W,"DateTimeFormat",{configurable:!0,writable:!0,value:T}),Z(T,"prototype",{writable:!1});var de={weekday:["narrow","short","long"],era:["narrow","short","long"],year:["2-digit","numeric"],month:["2-digit","numeric","narrow","short","long"],day:["2-digit","numeric"],hour:["2-digit","numeric"],minute:["2-digit","numeric"],second:["2-digit","numeric"],timeZoneName:["short","long"]};ie.DateTimeFormat={"[[availableLocales]]":[],"[[relevantExtensionKeys]]":["ca","nu"],"[[localeData]]":{}},Z(W.DateTimeFormat,"supportedLocalesOf",{configurable:!0,writable:!0,value:re.call(L,ie.DateTimeFormat)}),Z(W.DateTimeFormat.prototype,"format",{configurable:!0,get:S}),Z(W.DateTimeFormat.prototype,"resolvedOptions",{writable:!0,configurable:!0,value:function(){var e,t=new A,n=["locale","calendar","numberingSystem","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"],r=null!=this&&"object"==typeof this&&R(this);if(!r||!r["[[initializedDateTimeFormat]]"])throw new TypeError("`this` value for resolvedOptions() is not an initialized Intl.DateTimeFormat object.");for(var i=0,a=n.length;a>i;i++)$.call(r,e="[["+n[i]+"]]")&&(t[n[i]]={value:r[e],writable:!0,configurable:!0,enumerable:!0});return Y({},t)}});var fe=W.__localeSensitiveProtos={Number:{},Date:{}};return fe.Number.toLocaleString=function(){if("[object Number]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a number for Number.prototype.toLocaleString()");return v(new d(arguments[0],arguments[1]),this)},fe.Date.toLocaleString=function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleString()");var e=+this;if(isNaN(e))return"Invalid Date";var t=arguments[0],n=arguments[1],n=E(n,"any","all"),r=new T(t,n);return P(r,e)},fe.Date.toLocaleDateString=function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleDateString()");var e=+this;if(isNaN(e))return"Invalid Date";var t=arguments[0],n=arguments[1],n=E(n,"date","date"),r=new T(t,n);return P(r,e)},fe.Date.toLocaleTimeString=function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleTimeString()");var e=+this;if(isNaN(e))return"Invalid Date";var t=arguments[0],n=arguments[1],n=E(n,"time","time"),r=new T(t,n);return P(r,e)},Z(W,"__applyLocaleSensitivePrototypes",{writable:!0,configurable:!0,value:function(){Z(Number.prototype,"toLocaleString",{writable:!0,configurable:!0,value:fe.Number.toLocaleString});for(var e in fe.Date)$.call(fe.Date,e)&&Z(Date.prototype,e,{writable:!0,configurable:!0,value:fe.Date[e]})}}),Z(W,"__addLocaleData",{value:function(t){if(!e(t.locale))throw new Error("Object passed doesn't identify itself with a valid language tag");M(t,t.locale)}}),A.prototype=Y(null),D.prototype=Y(null),W})}).call(t,function(){return this}())},function(e,t,n){t.ActionMethods=n(69),t.ListenerMethods=n(70),t.PublisherMethods=n(71),t.StoreMethods=n(72),t.createAction=n(73),t.createStore=n(74),t.connect=n(75),t.connectFilter=n(76),t.ListenerMixin=n(77),t.listenTo=n(78),t.listenToMany=n(79);var r=n(80).staticJoinCreator;t.joinTrailing=t.all=r("last"),t.joinLeading=r("first"),t.joinStrict=r("strict"),t.joinConcat=r("all");var i=n(81);t.EventEmitter=i.EventEmitter,t.Promise=i.Promise,t.createActions=function(e){var n={};for(var r in e)if(e.hasOwnProperty(r)){var a=e[r],s=i.isObject(a)?r:a;n[s]=t.createAction(a)}return n},t.setEventEmitter=function(e){var r=n(81);t.EventEmitter=r.EventEmitter=e},t.setPromise=function(e){var r=n(81);t.Promise=r.Promise=e},t.setPromiseFactory=function(e){var t=n(81);t.createPromise=e},t.nextTick=function(e){var t=n(81);t.nextTick=e},t.__keep=n(82),Function.prototype.bind||console.error("Function.prototype.bind not available. ES5 shim required. https://github.com/spoike/refluxjs#es5")},function(e,t,n){e.exports={locale:"en-US",date:{ca:["gregory","buddhist","chinese","coptic","ethioaa","ethiopic","generic","hebrew","indian","islamic","japanese","persian","roc"],hourNo0:!0,hour12:!0,formats:[{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{weekday}, {month} {day}, {year}, {hour}:{minute}:{second}",pattern12:"{weekday}, {month} {day}, {year}, {hour}:{minute}:{second} {ampm}"},{weekday:"long",month:"long",day:"numeric",year:"numeric",pattern:"{weekday}, {month} {day}, {year}"},{month:"long",day:"numeric",year:"numeric",pattern:"{month} {day}, {year}"},{month:"numeric",day:"numeric",year:"numeric",pattern:"{month}/{day}/{year}"},{month:"numeric",year:"numeric",pattern:"{month}/{year}"},{month:"long",year:"numeric",pattern:"{month} {year}"},{month:"long",day:"numeric",pattern:"{month} {day}"},{month:"numeric",day:"numeric",pattern:"{month}/{day}"},{hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{hour}:{minute}:{second}",pattern12:"{hour}:{minute}:{second} {ampm}"},{hour:"numeric",minute:"2-digit",pattern:"{hour}:{minute}",pattern12:"{hour}:{minute} {ampm}"}],calendars:{buddhist:{eras:{"short":["BE"]}},chinese:{months:{"short":["Mo1","Mo2","Mo3","Mo4","Mo5","Mo6","Mo7","Mo8","Mo9","Mo10","Mo11","Mo12"],"long":["Month1","Month2","Month3","Month4","Month5","Month6","Month7","Month8","Month9","Month10","Month11","Month12"]}},coptic:{months:{"long":["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"]},eras:{"short":["ERA0","ERA1"]}},ethiopic:{months:{"long":["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},eras:{"short":["ERA0","ERA1"]}},ethioaa:{eras:{"short":["ERA0"]}},generic:{months:{"long":["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},eras:{"short":["ERA0","ERA1"]}},gregory:{months:{"short":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"long":["January","February","March","April","May","June","July","August","September","October","November","December"]},days:{narrow:["Su","Mo","Tu","We","Th","Fr","Sa"],"short":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"long":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},eras:{narrow:["B","A"],"short":["BC","AD","BCE","CE"],"long":["Before Christ","Anno Domini","Before Common Era","Common Era"]},dayPeriods:{am:"AM",pm:"PM"}},hebrew:{months:{"long":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"]},eras:{"short":["AM"]}},indian:{months:{"long":["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"]},eras:{"short":["Saka"]}},islamic:{months:{"short":["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],"long":["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},eras:{"short":["AH"]}},japanese:{eras:{narrow:["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchũ (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchũ (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","M","T","S","H"], +"short":["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchū (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchū (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","Meiji","Taishō","Shōwa","Heisei"]}},persian:{months:{"long":["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"]},eras:{"short":["AP"]}},roc:{eras:{"short":["Before R.O.C.","Minguo"]}}}},number:{nu:["latn"],patterns:{decimal:{positivePattern:"{number}",negativePattern:"-{number}"},currency:{positivePattern:"{currency}{number}",negativePattern:"-{currency}{number}"},percent:{positivePattern:"{number}%",negativePattern:"-{number}%"}},symbols:{latn:{decimal:".",group:",",nan:"NaN",percent:"%",infinity:"∞"}},currencies:{AUD:"A$",BRL:"R$",CAD:"CA$",CNY:"CN¥",EUR:"€",GBP:"£",HKD:"HK$",ILS:"₪",INR:"₹",JPY:"¥",KRW:"₩",MXN:"MX$",NZD:"NZ$",THB:"฿",TWD:"NT$",USD:"$",VND:"₫",XAF:"FCFA",XCD:"EC$",XOF:"CFA",XPF:"CFPF"}}}},function(e,t,n){e.exports={locale:"pt-BR",date:{ca:["gregory","buddhist","chinese","coptic","ethioaa","ethiopic","generic","hebrew","indian","islamic","japanese","persian","roc"],hourNo0:!0,hour12:!1,formats:[{weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{weekday}, {day} de {month} de {year} {hour}:{minute}:{second}",pattern12:"{weekday}, {day} de {month} de {year} {hour}:{minute}:{second} {ampm}"},{weekday:"long",day:"numeric",month:"long",year:"numeric",pattern:"{weekday}, {day} de {month} de {year}"},{day:"numeric",month:"long",year:"numeric",pattern:"{day} de {month} de {year}"},{day:"2-digit",month:"2-digit",year:"numeric",pattern:"{day}/{month}/{year}"},{month:"2-digit",year:"numeric",pattern:"{month}/{year}"},{month:"long",year:"numeric",pattern:"{month} de {year}"},{day:"numeric",month:"long",pattern:"{day} de {month}"},{day:"numeric",month:"numeric",pattern:"{day}/{month}"},{hour:"numeric",minute:"2-digit",second:"2-digit",pattern:"{hour}:{minute}:{second}",pattern12:"{hour}:{minute}:{second} {ampm}"},{hour:"numeric",minute:"2-digit",pattern:"{hour}:{minute}",pattern12:"{hour}:{minute} {ampm}"}],calendars:{buddhist:{eras:{"short":["BE"]}},chinese:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],"short":["1","2","3","4","5","6","7","8","9","10","11","12"],"long":["Mês 1","Mês 2","Mês 3","Mês 4","Mês 5","Mês 6","Mês 7","Mês 8","Mês 9","Mês 10","Mês 11","Mês 12"]}},coptic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],"short":["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"],"long":["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"]},eras:{"short":["ERA0","ERA1"]}},ethiopic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],"short":["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],"long":["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},eras:{"short":["ERA0","ERA1"]}},ethioaa:{eras:{"short":["ERA0"]}},generic:{months:{"long":["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},eras:{"short":["ERA0","ERA1"]}},gregory:{months:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],"short":["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],"long":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},days:{narrow:["dom","seg","ter","qua","qui","sex","sáb"],"short":["dom","seg","ter","qua","qui","sex","sáb"],"long":["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},eras:{"short":["a.C.","d.C."],"long":["Antes de Cristo","Ano do Senhor"]},dayPeriods:{am:"AM",pm:"PM"}},hebrew:{months:{"short":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"],"long":["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"]},eras:{"short":["AM"]}},indian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],"short":["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"],"long":["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"]},eras:{"short":["Saka"]}},islamic:{months:{"short":["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],"long":["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},eras:{"short":["AH"]}},japanese:{eras:{narrow:["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchũ (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchũ (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","M","T","S","H"],"short":["Taika (645-650)","Hakuchi (650-671)","Hakuhō (672-686)","Shuchō (686-701)","Taihō (701-704)","Keiun (704-708)","Wadō (708-715)","Reiki (715-717)","Yōrō (717-724)","Jinki (724-729)","Tempyō (729-749)","Tempyō-kampō (749-749)","Tempyō-shōhō (749-757)","Tempyō-hōji (757-765)","Temphō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770-780)","Ten-ō (781-782)","Enryaku (782-806)","Daidō (806-810)","Kōnin (810-824)","Tenchō (824-834)","Jōwa (834-848)","Kajō (848-851)","Ninju (851-854)","Saiko (854-857)","Tennan (857-859)","Jōgan (859-877)","Genkei (877-885)","Ninna (885-889)","Kampyō (889-898)","Shōtai (898-901)","Engi (901-923)","Enchō (923-931)","Shōhei (931-938)","Tengyō (938-947)","Tenryaku (947-957)","Tentoku (957-961)","Ōwa (961-964)","Kōhō (964-968)","Anna (968-970)","Tenroku (970-973)","Ten-en (973-976)","Jōgen (976-978)","Tengen (978-983)","Eikan (983-985)","Kanna (985-987)","Ei-en (987-989)","Eiso (989-990)","Shōryaku (990-995)","Chōtoku (995-999)","Chōhō (999-1004)","Kankō (1004-1012)","Chōwa (1012-1017)","Kannin (1017-1021)","Jian (1021-1024)","Manju (1024-1028)","Chōgen (1028-1037)","Chōryaku (1037-1040)","Chōkyū (1040-1044)","Kantoku (1044-1046)","Eishō (1046-1053)","Tengi (1053-1058)","Kōhei (1058-1065)","Jiryaku (1065-1069)","Enkyū (1069-1074)","Shōho (1074-1077)","Shōryaku (1077-1081)","Eiho (1081-1084)","Ōtoku (1084-1087)","Kanji (1087-1094)","Kaho (1094-1096)","Eichō (1096-1097)","Shōtoku (1097-1099)","Kōwa (1099-1104)","Chōji (1104-1106)","Kashō (1106-1108)","Tennin (1108-1110)","Ten-ei (1110-1113)","Eikyū (1113-1118)","Gen-ei (1118-1120)","Hoan (1120-1124)","Tenji (1124-1126)","Daiji (1126-1131)","Tenshō (1131-1132)","Chōshō (1132-1135)","Hoen (1135-1141)","Eiji (1141-1142)","Kōji (1142-1144)","Tenyō (1144-1145)","Kyūan (1145-1151)","Ninpei (1151-1154)","Kyūju (1154-1156)","Hogen (1156-1159)","Heiji (1159-1160)","Eiryaku (1160-1161)","Ōho (1161-1163)","Chōkan (1163-1165)","Eiman (1165-1166)","Nin-an (1166-1169)","Kaō (1169-1171)","Shōan (1171-1175)","Angen (1175-1177)","Jishō (1177-1181)","Yōwa (1181-1182)","Juei (1182-1184)","Genryuku (1184-1185)","Bunji (1185-1190)","Kenkyū (1190-1199)","Shōji (1199-1201)","Kennin (1201-1204)","Genkyū (1204-1206)","Ken-ei (1206-1207)","Shōgen (1207-1211)","Kenryaku (1211-1213)","Kenpō (1213-1219)","Shōkyū (1219-1222)","Jōō (1222-1224)","Gennin (1224-1225)","Karoku (1225-1227)","Antei (1227-1229)","Kanki (1229-1232)","Jōei (1232-1233)","Tempuku (1233-1234)","Bunryaku (1234-1235)","Katei (1235-1238)","Ryakunin (1238-1239)","En-ō (1239-1240)","Ninji (1240-1243)","Kangen (1243-1247)","Hōji (1247-1249)","Kenchō (1249-1256)","Kōgen (1256-1257)","Shōka (1257-1259)","Shōgen (1259-1260)","Bun-ō (1260-1261)","Kōchō (1261-1264)","Bun-ei (1264-1275)","Kenji (1275-1278)","Kōan (1278-1288)","Shōō (1288-1293)","Einin (1293-1299)","Shōan (1299-1302)","Kengen (1302-1303)","Kagen (1303-1306)","Tokuji (1306-1308)","Enkei (1308-1311)","Ōchō (1311-1312)","Shōwa (1312-1317)","Bunpō (1317-1319)","Genō (1319-1321)","Genkyō (1321-1324)","Shōchū (1324-1326)","Kareki (1326-1329)","Gentoku (1329-1331)","Genkō (1331-1334)","Kemmu (1334-1336)","Engen (1336-1340)","Kōkoku (1340-1346)","Shōhei (1346-1370)","Kentoku (1370-1372)","Bunchū (1372-1375)","Tenju (1375-1379)","Kōryaku (1379-1381)","Kōwa (1381-1384)","Genchū (1384-1392)","Meitoku (1384-1387)","Kakei (1387-1389)","Kōō (1389-1390)","Meitoku (1390-1394)","Ōei (1394-1428)","Shōchō (1428-1429)","Eikyō (1429-1441)","Kakitsu (1441-1444)","Bun-an (1444-1449)","Hōtoku (1449-1452)","Kyōtoku (1452-1455)","Kōshō (1455-1457)","Chōroku (1457-1460)","Kanshō (1460-1466)","Bunshō (1466-1467)","Ōnin (1467-1469)","Bunmei (1469-1487)","Chōkyō (1487-1489)","Entoku (1489-1492)","Meiō (1492-1501)","Bunki (1501-1504)","Eishō (1504-1521)","Taiei (1521-1528)","Kyōroku (1528-1532)","Tenmon (1532-1555)","Kōji (1555-1558)","Eiroku (1558-1570)","Genki (1570-1573)","Tenshō (1573-1592)","Bunroku (1592-1596)","Keichō (1596-1615)","Genwa (1615-1624)","Kan-ei (1624-1644)","Shōho (1644-1648)","Keian (1648-1652)","Shōō (1652-1655)","Meiryaku (1655-1658)","Manji (1658-1661)","Kanbun (1661-1673)","Enpō (1673-1681)","Tenwa (1681-1684)","Jōkyō (1684-1688)","Genroku (1688-1704)","Hōei (1704-1711)","Shōtoku (1711-1716)","Kyōhō (1716-1736)","Genbun (1736-1741)","Kanpō (1741-1744)","Enkyō (1744-1748)","Kan-en (1748-1751)","Hōryaku (1751-1764)","Meiwa (1764-1772)","An-ei (1772-1781)","Tenmei (1781-1789)","Kansei (1789-1801)","Kyōwa (1801-1804)","Bunka (1804-1818)","Bunsei (1818-1830)","Tenpō (1830-1844)","Kōka (1844-1848)","Kaei (1848-1854)","Ansei (1854-1860)","Man-en (1860-1861)","Bunkyū (1861-1864)","Genji (1864-1865)","Keiō (1865-1868)","Meiji","Taishō","Shōwa","Heisei"]}},persian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],"short":["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],"long":["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"]},eras:{"short":["AP"]}},roc:{eras:{"short":["Antes de R.O.C.","R.O.C."]}}}},number:{nu:["latn"],patterns:{decimal:{positivePattern:"{number}",negativePattern:"-{number}"},currency:{positivePattern:"{currency}{number}",negativePattern:"-{currency}{number}"},percent:{positivePattern:"{number}%",negativePattern:"-{number}%"}},symbols:{latn:{decimal:",",group:".",nan:"NaN",percent:"%",infinity:"∞"}},currencies:{AUD:"AU$",BRL:"R$",CAD:"CA$",CNY:"CN¥",EUR:"€",GBP:"£",HKD:"HK$",ILS:"₪",INR:"₹",JPY:"JP¥",KRW:"₩",MXN:"MX$",NZD:"NZ$",PTE:"Esc.",THB:"฿",TWD:"NT$",USD:"US$",VND:"₫",XAF:"FCFA",XCD:"EC$",XOF:"CFA",XPF:"CFPF"}}}},function(e,t,n){},function(e,t,n){"use strict";function r(e){i["default"].__addLocaleData(e),a["default"].__addLocaleData(e)}t.__addLocaleData=r;var i=n(95),a=n(96),s=n(85),o=n(86),l=n(87),c=n(88),u=n(89),p=n(90),h=n(91),m=n(92);r(s["default"]),t.IntlMixin=o["default"],t.FormattedDate=l["default"],t.FormattedTime=c["default"],t.FormattedRelative=u["default"],t.FormattedNumber=p["default"],t.FormattedMessage=h["default"],t.FormattedHTMLMessage=m["default"]},function(e,t,n){e.exports={}},function(e,t,n){var r=n(81),i=n(80).instanceJoinCreator,a=function(e){for(var t,n=0,r={};n<(e.children||[]).length;++n)t=e.children[n],e[t]&&(r[t]=e[t]);return r},s=function(e){var t={};for(var n in e){var i=e[n],o=a(i),l=s(o);t[n]=i;for(var c in l){var u=l[c];t[n+r.capitalize(c)]=u}}return t};e.exports={hasListener:function(e){for(var t,n,r,i=0;i<(this.subscriptions||[]).length;++i)for(r=[].concat(this.subscriptions[i].listenable),t=0;t=0&&this.children.indexOf("failed")>=0;if(!n)throw new Error('Publisher must have "completed" and "failed" child publishers');e.then(function(e){return t.completed(e)},function(e){return t.failed(e)})},listenAndPromise:function(e,t){var n=this;t=t||this,this.willCallPromise=(this.willCallPromise||0)+1;var r=this.listen(function(){if(!e)throw new Error("Expected a function returning a promise but got "+e);var r=arguments,i=e.apply(t,r);return n.promise.call(n,i)},t);return function(){n.willCallPromise--,r.call(n)}},trigger:function(){var e=arguments,t=this.preEmit.apply(this,e);e=void 0===t?e:r.isArguments(t)?t:[].concat(t),this.shouldEmit.apply(this,e)&&this.emitter.emit(this.eventLabel,e)},triggerAsync:function(){var e=arguments,t=this;r.nextTick(function(){t.trigger.apply(t,e)})},triggerPromise:function(){var e=this,t=arguments,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0,i=r.createPromise(function(i,a){if(e.willCallPromise)return void r.nextTick(function(){var n=e.promise;e.promise=function(t){return t.then(i,a),e.promise=n,e.promise.apply(e,arguments)},e.trigger.apply(e,t)});if(n)var s=e.completed.listen(function(e){s(),o(),i(e)}),o=e.failed.listen(function(e){s(),o(),a(e)});e.triggerAsync.apply(e,t),n||i()});return i}}},function(e,t,n){e.exports={}},function(e,t,n){var r=n(81),i=n(64),a=n(82),s={preEmit:1,shouldEmit:1},o=function(e){e=e||{},r.isObject(e)||(e={actionName:e});for(var t in i.ActionMethods)if(!s[t]&&i.PublisherMethods[t])throw new Error("Cannot override API method "+t+" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");for(var n in e)if(!s[n]&&i.PublisherMethods[n])throw new Error("Cannot override API method "+n+" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");e.children=e.children||[],e.asyncResult&&(e.children=e.children.concat(["completed","failed"]));for(var l=0,c={};lt;t++)l.throwIf(this.validateListening(s[t]));for(t=0;u>t;t++)h.push(s[t].listen(a(t,p),this));return i(p),n={listenable:s},n.stop=r(n,h,this),this.subscriptions=(this.subscriptions||[]).concat(n),n}}},function(e,t,n){var r=t.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e};t.extend=function(e){if(!r(e))return e;for(var t,n,i=1,a=arguments.length;a>i;i++){t=arguments[i];for(n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s)}else e[n]=t[n]}return e},t.isFunction=function(e){return"function"==typeof e},t.EventEmitter=n(97),t.nextTick=function(e){setTimeout(e,0)},t.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.callbackName=function(e){return"on"+t.capitalize(e)},t.object=function(e,t){for(var n={},r=0;rr;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){e.exports=function(e,t,n){for(var r=0,i=e.length,a=3==arguments.length?n:e[r++];i>r;)a=t.call(null,a,e[r],++r,e);return a}},function(e,t,n){"use strict";t["default"]={locale:"en",pluralRuleFunction:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,a=i&&n[0].slice(-1),s=i&&n[0].slice(-2);return t?1==a&&11!=s?"one":2==a&&12!=s?"two":3==a&&13!=s?"few":"other":1==e&&r?"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"}}}}}},function(e,t,n){"use strict";function r(e,t){if(!isFinite(e))throw new TypeError(t)}var i=n(98),a=n(95),s=n(96),o=n(104),l={locales:i["default"].PropTypes.oneOfType([i["default"].PropTypes.string,i["default"].PropTypes.array]),formats:i["default"].PropTypes.object,messages:i["default"].PropTypes.object};t["default"]={statics:{filterFormatOptions:function(e,t){return t||(t={}),(this.formatOptions||[]).reduce(function(n,r){return e.hasOwnProperty(r)?n[r]=e[r]:t.hasOwnProperty(r)&&(n[r]=t[r]),n},{})}},propTypes:l,contextTypes:l,childContextTypes:l,getNumberFormat:o["default"](Intl.NumberFormat),getDateTimeFormat:o["default"](Intl.DateTimeFormat),getMessageFormat:o["default"](a["default"]),getRelativeFormat:o["default"](s["default"]),getChildContext:function(){var e=this.context,t=this.props;return{locales:t.locales||e.locales,formats:t.formats||e.formats,messages:t.messages||e.messages}},formatDate:function(e,t){return e=new Date(e),r(e,"A date or timestamp must be provided to formatDate()"),this._format("date",e,t)},formatTime:function(e,t){return e=new Date(e),r(e,"A date or timestamp must be provided to formatTime()"),this._format("time",e,t)},formatRelative:function(e,t,n){return e=new Date(e),r(e,"A date or timestamp must be provided to formatRelative()"),this._format("relative",e,t,n)},formatNumber:function(e,t){return this._format("number",e,t)},formatMessage:function(e,t){var n=this.props.locales||this.context.locales,r=this.props.formats||this.context.formats;return"function"==typeof e?e(t):("string"==typeof e&&(e=this.getMessageFormat(e,n,r)),e.format(t))},getIntlMessage:function(e){var t,n=this.props.messages||this.context.messages,r=e.split(".");try{t=r.reduce(function(e,t){return e[t]},n)}finally{if(void 0===t)throw new ReferenceError("Could not find Intl message: "+e)}return t},getNamedFormat:function(e,t){var n=this.props.formats||this.context.formats,r=null;try{r=n[e][t]}finally{if(!r)throw new ReferenceError("No "+e+" format named: "+t)}return r},_format:function(e,t,n,r){var i=this.props.locales||this.context.locales;switch(n&&"string"==typeof n&&(n=this.getNamedFormat(e,n)),e){case"date":case"time":return this.getDateTimeFormat(i,n).format(t);case"number":return this.getNumberFormat(i,n).format(t);case"relative":return this.getRelativeFormat(i,n).format(t,r);default:throw new Error("Unrecognized format type: "+e)}}}},function(e,t,n){"use strict";var r=n(98),i=n(86),a=r["default"].createClass({displayName:"FormattedDate",mixins:[i["default"]],statics:{formatOptions:["localeMatcher","timeZone","hour12","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("date",n),s=a.filterFormatOptions(e,i);return r["default"].DOM.span(null,this.formatDate(t,s))}});t["default"]=a},function(e,t,n){"use strict";var r=n(98),i=n(86),a=r["default"].createClass({displayName:"FormattedTime",mixins:[i["default"]],statics:{formatOptions:["localeMatcher","timeZone","hour12","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("time",n),s=a.filterFormatOptions(e,i);return r["default"].DOM.span(null,this.formatTime(t,s))}});t["default"]=a},function(e,t,n){"use strict";var r=n(98),i=n(86),a=r["default"].createClass({displayName:"FormattedRelative",mixins:[i["default"]],statics:{formatOptions:["style","units"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired,now:r["default"].PropTypes.any},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("relative",n),s=a.filterFormatOptions(e,i),o=this.formatRelative(t,s,{now:e.now});return r["default"].DOM.span(null,o)}});t["default"]=a},function(e,t,n){"use strict";var r=n(98),i=n(86),a=r["default"].createClass({displayName:"FormattedNumber",mixins:[i["default"]],statics:{formatOptions:["localeMatcher","style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"]},propTypes:{format:r["default"].PropTypes.string,value:r["default"].PropTypes.any.isRequired},render:function(){var e=this.props,t=e.value,n=e.format,i=n&&this.getNamedFormat("number",n),s=a.filterFormatOptions(e,i);return r["default"].DOM.span(null,this.formatNumber(t,s))}});t["default"]=a},function(e,t,n){"use strict";var r=n(98),i=n(86),a=r["default"].createClass({displayName:"FormattedMessage",mixins:[i["default"]],propTypes:{tagName:r["default"].PropTypes.string,message:r["default"].PropTypes.string.isRequired},getDefaultProps:function(){return{tagName:"span"}},render:function(){var e=this.props,t=e.tagName,n=e.message,i=Math.floor(1099511627776*Math.random()).toString(16),a=new RegExp("(@__ELEMENT-"+i+"-\\d+__@)","g"),s={},o=function(){var e=0;return function(){return"@__ELEMENT-"+i+"-"+(e+=1)+"__@"}}(),l=Object.keys(e).reduce(function(t,n){var i,a=e[n];return r["default"].isValidElement(a)?(i=o(),t[n]=i,s[i]=a):t[n]=a,t},{}),c=this.formatMessage(n,l),u=c.split(a).filter(function(e){return!!e}).map(function(e){return s[e]||e}),p=[t,null].concat(u);return r["default"].createElement.apply(null,p)}});t["default"]=a},function(e,t,n){"use strict";var r=n(98),i=n(99),a=n(86),s=r["default"].createClass({displayName:"FormattedHTMLMessage",mixins:[a["default"]],propTypes:{tagName:r["default"].PropTypes.string,message:r["default"].PropTypes.string.isRequired},getDefaultProps:function(){return{tagName:"span"}},render:function(){var e=this.props,t=e.tagName,n=e.message,a=Object.keys(e).reduce(function(t,n){var a=e[n];return"string"==typeof a?a=i["default"](a):r["default"].isValidElement(a)&&(a=r["default"].renderToStaticMarkup(a)),t[n]=a,t},{});return r["default"].DOM[t]({dangerouslySetInnerHTML:{__html:this.formatMessage(n,a)}})}});t["default"]=s},function(e,t,n){var r=n(81);e.exports=function(e){var t={init:[],preEmit:[],shouldEmit:[]},n=function i(e){var n={};return e.mixins&&e.mixins.forEach(function(e){r.extend(n,i(e))}),r.extend(n,e),Object.keys(t).forEach(function(n){e.hasOwnProperty(n)&&t[n].push(e[n])}),n}(e);return t.init.length>1&&(n.init=function(){var e=arguments;t.init.forEach(function(t){t.apply(this,e)},this)}),t.preEmit.length>1&&(n.preEmit=function(){return t.preEmit.reduce(function(e,t){var n=t.apply(this,e);return void 0===n?e:[n]}.bind(this),arguments)}),t.shouldEmit.length>1&&(n.shouldEmit=function(){var e=arguments;return!t.shouldEmit.some(function(t){return!t.apply(this,e)},this)}),Object.keys(t).forEach(function(e){1===t[e].length&&(n[e]=t[e][0])}),n}},function(e,t,n){e.exports=function(e,t){for(var n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var r=Object.getOwnPropertyDescriptor(t,n);if(!r.value||"function"!=typeof r.value||!t.hasOwnProperty(n))continue;e[n]=t[n].bind(e)}else{var i=t[n];if("function"!=typeof i||!t.hasOwnProperty(n))continue;e[n]=i.bind(e)}return e}},function(e,t,n){"use strict";var r=n(105)["default"];n(101),t=e.exports=r,t["default"]=t},function(e,t,n){"use strict";var r=n(103)["default"];n(102),t=e.exports=r,t["default"]=t},function(e,t,n){"use strict";function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(){}i.prototype._events=void 0,i.prototype.listeners=function(e){if(!this._events||!this._events[e])return[];if(this._events[e].fn)return[this._events[e].fn];for(var t=0,n=this._events[e].length,r=new Array(n);n>t;t++)r[t]=this._events[e][t].fn;return r},i.prototype.emit=function(e,t,n,r,i,a){if(!this._events||!this._events[e])return!1;var s,o,l=this._events[e],c=arguments.length;if("function"==typeof l.fn){switch(l.once&&this.removeListener(e,l.fn,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,r),!0;case 5:return l.fn.call(l.context,t,n,r,i),!0;case 6:return l.fn.call(l.context,t,n,r,i,a),!0}for(o=1,s=new Array(c-1);c>o;o++)s[o-1]=arguments[o];l.fn.apply(l.context,s)}else{var u,p=l.length;for(o=0;p>o;o++)switch(l[o].once&&this.removeListener(e,l[o].fn,!0),c){case 1:l[o].fn.call(l[o].context);break;case 2:l[o].fn.call(l[o].context,t);break;case 3:l[o].fn.call(l[o].context,t,n);break;default:if(!s)for(u=1,s=new Array(c-1);c>u;u++)s[u-1]=arguments[u];l[o].fn.apply(l[o].context,s)}}return!0},i.prototype.on=function(e,t,n){var i=new r(t,n||this);return this._events||(this._events={}),this._events[e]?this._events[e].fn?this._events[e]=[this._events[e],i]:this._events[e].push(i):this._events[e]=i,this},i.prototype.once=function(e,t,n){var i=new r(t,n||this,!0);return this._events||(this._events={}),this._events[e]?this._events[e].fn?this._events[e]=[this._events[e],i]:this._events[e].push(i):this._events[e]=i,this},i.prototype.removeListener=function(e,t,n){if(!this._events||!this._events[e])return this;var r=this._events[e],i=[];if(t&&(r.fn&&(r.fn!==t||n&&!r.once)&&i.push(r),!r.fn))for(var a=0,s=r.length;s>a;a++)(r[a].fn!==t||n&&!r[a].once)&&i.push(r[a]);return i.length?this._events[e]=1===i.length?i[0]:i:delete this._events[e],this},i.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[e]:this._events={},this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.EventEmitter=i,i.EventEmitter2=i,i.EventEmitter3=i,e.exports=i},function(e,t,n){"use strict";t["default"]=React},function(e,t,n){"use strict";var r={"&":"&",">":">","<":"<",'"':""","'":"'"},i=/[&><"']/g;t["default"]=function(e){return(""+e).replace(i,function(e){return r[e]})}},function(e,t,n){var r;(function(i,a){/*! Native Promise Only v0.7.6-a (c) Kyle Simpson MIT License: http://getify.mit-license.org */ -!function(s,i,o){i[s]=i[s]||o(),"undefined"!=typeof e&&e.exports?e.exports=i[s]:!0&&n(78)&&(r=function(){return i[s]}.call(t,n,t,e),!(void 0!==r&&(e.exports=r)))}("Promise","undefined"!=typeof s?s:this,function(){"use strict";function e(e,t){d.add(e,t),h||(h=f(d.drain))}function t(e){var t,n=typeof e;return null==e||"object"!=n&&"function"!=n||(t=e.then),"function"==typeof t?t:!1}function n(){for(var e=0;e0&&e(n,c))}catch(p){o.call(a||new l(c),p)}}}function o(t){var r=this;r.triggered||(r.triggered=!0,r.def&&(r=r.def),r.msg=t,r.state=2,r.chain.length>0&&e(n,r))}function a(e,t,n,r){for(var s=0;s=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=arguments.length<2?!1:a.call(arguments,1);return l[n]=!0,i(function(){l[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete l[e]}}).call(t,n(79).setImmediate,n(79).clearImmediate)},function(e,t,n){function r(){p=!1,a.length?c=a.concat(c):u=-1,c.length&&s()}function s(){if(!p){var e=setTimeout(r);p=!0;for(var t=c.length;t;){for(a=c,c=[];++u1)for(var n=1;n0&&e(n,c))}catch(u){s.call(o||new l(c),u)}}}function s(t){var r=this;r.triggered||(r.triggered=!0,r.def&&(r=r.def),r.msg=t,r.state=2,r.chain.length>0&&e(n,r))}function o(e,t,n,r){for(var i=0;io?"past":"future"})},r.prototype._isValidUnits=function(e){if(!e||s.arrIndexOf.call(o,e)>=0)return!0;if("string"==typeof e){var t=/s$/.test(e)&&e.substr(0,e.length-1);if(t&&s.arrIndexOf.call(o,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: "'+o.join('", "')+'"')},r.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(r.defaultLocale);var t,n,i,a,s=r.__localeData__;for(t=0,n=e.length;n>t;t+=1)for(i=e[t].toLowerCase().split("-");i.length;){if(a=s[i.join("-")])return a.locale;i.pop()}var o=e.pop();throw new Error("No locale data has been added to IntlRelativeFormat for: "+e.join(", ")+", or the default locale: "+o)},r.prototype._resolveStyle=function(e){if(!e)return l[0];if(s.arrIndexOf.call(l,e)>=0)return e;throw new Error('"'+e+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+l.join('", "')+'"')},r.prototype._selectUnits=function(e){var t,n,i;for(t=0,n=o.length;n>t&&(i=o[t],!(Math.abs(e[i])t;t+=1)r=e[t],r&&"object"==typeof r?i.push(a(r)):i.push(r);return JSON.stringify(i)}}function a(e){var t,n,r,i,a=[],s=[];for(t in e)e.hasOwnProperty(t)&&s.push(t);var o=s.sort();for(n=0,r=o.length;r>n;n+=1)t=o[n],i={},i[t]=e[t],a[n]=i;return a}var s=n(118);t["default"]=r},function(e,t,n){(function(t){e.exports=t}).call(t,{})},function(e,t,n){(function(e,r){function i(e,t){this._id=e,this._clearFn=t}var a=n(120).nextTick,s=Function.prototype.apply,o=Array.prototype.slice,l={},c=0;t.setTimeout=function(){return new i(s.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(s.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=arguments.length<2?!1:o.call(arguments,1);return l[n]=!0,a(function(){l[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete l[e]}}).call(t,n(110).setImmediate,n(110).clearImmediate)},function(e,t,n){"use strict";function r(e,t,n){var i="string"==typeof e?r.__parse(e):e;if(!i||"messageFormatPattern"!==i.type)throw new TypeError("A message must be provided as a String or AST.");n=this._mergeFormats(r.formats,n),a.defineProperty(this,"_locale",{value:this._resolveLocale(t)});var s=this._findPluralRuleFunction(this._locale),o=this._compilePattern(i,t,n,s),l=this;this.format=function(e){return l._format(o,e)}}var i=n(115),a=n(116),s=n(117),o=n(119);t["default"]=r,a.defineProperty(r,"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"}}}}),a.defineProperty(r,"__localeData__",{value:a.objCreate(null)}),a.defineProperty(r,"__addLocaleData",{value:function(e){if(!e||!e.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");r.__localeData__[e.locale.toLowerCase()]=e}}),a.defineProperty(r,"__parse",{value:o["default"].parse}),a.defineProperty(r,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),r.prototype.resolvedOptions=function(){return{locale:this._locale}},r.prototype._compilePattern=function(e,t,n,r){var i=new s["default"](t,n,r);return i.compile(e)},r.prototype._findPluralRuleFunction=function(e){for(var t=r.__localeData__,n=t[e.toLowerCase()];n;){if(n.pluralRuleFunction)return n.pluralRuleFunction;n=n.parentLocale&&t[n.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+e)},r.prototype._format=function(e,t){var n,r,a,s,o,l="";for(n=0,r=e.length;r>n;n+=1)if(a=e[n],"string"!=typeof a){if(s=a.id,!t||!i.hop.call(t,s))throw new Error("A value must be provided for: "+s);o=t[s],l+=a.options?this._format(a.getOption(o),t):a.format(o)}else l+=a;return l},r.prototype._mergeFormats=function(e,t){var n,r,s={};for(n in e)i.hop.call(e,n)&&(s[n]=r=a.objCreate(e[n]),t&&i.hop.call(t,n)&&i.extend(r,t[n]));return s},r.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(r.defaultLocale);var t,n,i,a,s=r.__localeData__;for(t=0,n=e.length;n>t;t+=1)for(i=e[t].toLowerCase().split("-");i.length;){if(a=s[i.join("-")])return a.locale;i.pop()}var o=e.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+e.join(", ")+", or the default locale: "+o)}},function(e,t,n){"use strict";t["default"]={locale:"en",pluralRuleFunction:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,a=i&&n[0].slice(-1),s=i&&n[0].slice(-2);return t?1==a&&11!=s?"one":2==a&&12!=s?"two":3==a&&13!=s?"few":"other":1==e&&r?"one":"other"}}},function(e,t,n){"use strict";function r(e){return 400*e/146097}var i=Math.round;t["default"]=function(e,t){e=+e,t=+t;var n=i(t-e),a=i(n/1e3),s=i(a/60),o=i(s/60),l=i(o/24),c=i(l/7),u=r(l),p=i(12*u),h=i(u);return{millisecond:n,second:a,minute:s,hour:o,day:l,week:c,month:p,year:h}}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),s=(!a&&!Object.prototype.__defineGetter__,a?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!r.call(e,t)||"value"in n)&&(e[t]=n.value)}),o=Object.create||function(e,t){function n(){}var i,a;n.prototype=e,i=new n;for(a in t)r.call(t,a)&&s(i,a,t[a]);return i},l=Array.prototype.indexOf||function(e,t){var n=this;if(!n.length)return-1;for(var r=t||0,i=n.length;i>r;r++)if(n[r]===e)return r;return-1},c=Array.isArray||function(e){return"[object Array]"===i.call(e)},u=Date.now||function(){return(new Date).getTime()};t.defineProperty=s,t.objCreate=o,t.arrIndexOf=l,t.isArray=c,t.dateNow=u},function(e,t,n){"use strict";function r(e){var t,n,r,a,s=Array.prototype.slice.call(arguments,1);for(t=0,n=s.length;n>t;t+=1)if(r=s[t])for(a in r)i.call(r,a)&&(e[a]=r[a]);return e}t.extend=r;var i=Object.prototype.hasOwnProperty;t.hop=i},function(e,t,n){"use strict";var r=n(115),i=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),a=(!i&&!Object.prototype.__defineGetter__,i?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!r.hop.call(e,t)||"value"in n)&&(e[t]=n.value)}),s=Object.create||function(e,t){function n(){}var i,s;n.prototype=e,i=new n;for(s in t)r.hop.call(t,s)&&a(i,s,t[s]);return i};t.defineProperty=a,t.objCreate=s},function(e,t,n){"use strict";function r(e,t,n){this.locales=e,this.formats=t,this.pluralFn=n}function i(e){this.id=e}function a(e,t,n,r,i){this.id=e,this.useOrdinal=t,this.offset=n,this.options=r,this.pluralFn=i}function s(e,t,n,r){this.id=e,this.offset=t,this.numberFormat=n,this.string=r}function o(e,t){this.id=e,this.options=t}t["default"]=r,r.prototype.compile=function(e){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(e)},r.prototype.compileMessage=function(e){if(!e||"messageFormatPattern"!==e.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var t,n,r,i=e.elements,a=[];for(t=0,n=i.length;n>t;t+=1)switch(r=i[t],r.type){case"messageTextElement":a.push(this.compileMessageText(r));break;case"argumentElement":a.push(this.compileArgument(r));break;default:throw new Error("Message element does not have a valid type")}return a},r.prototype.compileMessageText=function(e){return this.currentPlural&&/(^|[^\\])#/g.test(e.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new s(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,e.value)):e.value.replace(/\\#/g,"#")},r.prototype.compileArgument=function(e){var t=e.format;if(!t)return new i(e.id);var n,r=this.formats,s=this.locales,l=this.pluralFn;switch(t.type){case"numberFormat":return n=r.number[t.style],{id:e.id,format:new Intl.NumberFormat(s,n).format};case"dateFormat":return n=r.date[t.style],{id:e.id,format:new Intl.DateTimeFormat(s,n).format};case"timeFormat":return n=r.time[t.style],{id:e.id,format:new Intl.DateTimeFormat(s,n).format};case"pluralFormat":return n=this.compileOptions(e),new a(e.id,t.ordinal,t.offset,n,l);case"selectFormat":return n=this.compileOptions(e),new o(e.id,n);default:throw new Error("Message element does not have a valid format type")}},r.prototype.compileOptions=function(e){var t=e.format,n=t.options,r={};this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===t.type?e:null;var i,a,s;for(i=0,a=n.length;a>i;i+=1)s=n[i],r[s.selector]=this.compileMessage(s.value);return this.currentPlural=this.pluralStack.pop(),r},i.prototype.format=function(e){return e?"string"==typeof e?e:String(e):""},a.prototype.getOption=function(e){var t=this.options,n=t["="+e]||t[this.pluralFn(e-this.offset,this.useOrdinal)];return n||t.other},s.prototype.format=function(e){var t=this.numberFormat.format(e-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+t).replace(/\\#/g,"#")},o.prototype.getOption=function(e){var t=this.options;return t[e]||t.other}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),a=(!i&&!Object.prototype.__defineGetter__,i?Object.defineProperty:function(e,t,n){"get"in n&&e.__defineGetter__?e.__defineGetter__(t,n.get):(!r.call(e,t)||"value"in n)&&(e[t]=n.value)}),s=Object.create||function(e,t){function n(){}var i,s;n.prototype=e,i=new n;for(s in t)r.call(t,s)&&a(i,s,t[s]);return i};t.defineProperty=a,t.objCreate=s},function(e,t,n){"use strict";t=e.exports=n(121)["default"],t["default"]=t},function(e,t,n){function r(){u=!1,o.length?c=o.concat(c):p=-1,c.length&&i()}function i(){if(!u){var e=setTimeout(r);u=!0;for(var t=c.length;t;){for(o=c,c=[];++p1)for(var n=1;ni;i++)a=e.charAt(i),"\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 qe!==t&&(qe>t&&(qe=0,Je={line:1,column:1,seenCR:!1}),n(Je,qe,t),qe=t),Je}function r(e){$e>Ue||(Ue>$e&&($e=Ue,Ze=[]),Ze.push(e))}function i(r,i,a){function s(e){var t=1;for(e.sort(function(e,t){return e.descriptiont.description?1:0});t1?s.slice(0,-1).join(", ")+" or "+s[e.length-1]:s[0],i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}var l=n(a),c=a1?arguments[1]:{},M={},j={start:a},L=a,F=function(e){return{type:"messageFormatPattern",elements:e}},A=M,D=function(e){var t,n,r,i,a,s="";for(t=0,r=e.length;r>t;t+=1)for(i=e[t],n=0,a=i.length;a>n;n+=1)s+=i[n];return s},I=function(e){return{type:"messageTextElement",value:e}},K=/^[^ \t\n\r,.+={}#]/,O={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},R="{",z={type:"literal",value:"{",description:'"{"'},B=null,H=",",G={type:"literal",value:",",description:'","'},U="}",W={type:"literal",value:"}",description:'"}"'},q=function(e,t){return{type:"argumentElement",id:e,format:t&&t[2]}},J="number",$={type:"literal",value:"number",description:'"number"'},Z="date",X={type:"literal",value:"date",description:'"date"'},Y="time",V={type:"literal",value:"time",description:'"time"'},Q=function(e,t){return{type:e+"Format",style:t&&t[2]}},ee="plural",te={type:"literal",value:"plural",description:'"plural"'},ne=function(e){return{type:e.type,ordinal:!1,offset:e.offset||0,options:e.options}},re="selectordinal",ie={type:"literal",value:"selectordinal",description:'"selectordinal"'},ae=function(e){return{type:e.type,ordinal:!0,offset:e.offset||0,options:e.options}},se="select",oe={type:"literal",value:"select",description:'"select"'},le=function(e){return{type:"selectFormat",options:e}},ce="=",ue={type:"literal",value:"=",description:'"="'},pe=function(e,t){return{type:"optionalFormatPattern",selector:e,value:t}},he="offset:",me={type:"literal",value:"offset:",description:'"offset:"'},de=function(e){return e},fe=function(e,t){return{type:"pluralFormat",offset:e,options:t}},ge={type:"other",description:"whitespace"},ye=/^[ \t\n\r]/,ve={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},be={type:"other",description:"optionalWhitespace"},_e=/^[0-9]/,Te={type:"class",value:"[0-9]",description:"[0-9]"},ke=/^[0-9a-f]/i,Ee={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},we="0",xe={type:"literal",value:"0",description:'"0"'},Ne=/^[1-9]/,Se={type:"class",value:"[1-9]",description:"[1-9]"},Pe=function(e){return parseInt(e,10)},Ce=/^[^{}\\\0-\x1F \t\n\r]/,Me={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},je="\\#",Le={type:"literal",value:"\\#",description:'"\\\\#"'},Fe=function(){return"\\#"},Ae="\\{",De={type:"literal",value:"\\{",description:'"\\\\{"'},Ie=function(){return"{"},Ke="\\}",Oe={type:"literal",value:"\\}",description:'"\\\\}"'},Re=function(){return"}"},ze="\\u",Be={type:"literal",value:"\\u",description:'"\\\\u"'},He=function(e){return String.fromCharCode(parseInt(e,16))},Ge=function(e){return e.join("")},Ue=0,We=0,qe=0,Je={line:1,column:1,seenCR:!1},$e=0,Ze=[],Xe=0;if("startRule"in C){if(!(C.startRule in j))throw new Error("Can't start parsing from rule \""+C.startRule+'".');L=j[C.startRule]}if(P=L(),P!==M&&Ue===e.length)return P;throw P!==M&&Ue