├── .babelrc ├── .gitignore ├── .npmignore ├── README.md ├── dist └── react-stars.js ├── example ├── bundle.js ├── index.html └── index.js ├── package.json ├── src └── react-stars.js ├── webpack.config.js └── webpack.production.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "react"], 3 | "plugins": [ 4 | "transform-object-assign" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | npm-debug.log 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-stars :star: 2 | ###### A simple star rating component for your React projects (now with half stars and custom characters) 3 | 4 | ![react-stars](http://i.imgur.com/VDbzbqF.gif) 5 | 6 | ### Get started quickly 7 | 8 | ###### Install react-stars package with NPM: 9 | `npm install react-stars --save` 10 | 11 | Then in your project include the component: 12 | 13 | ```javascript 14 | import ReactStars from 'react-stars' 15 | import React from 'react' 16 | import { render } from 'react-dom' 17 | 18 | const ratingChanged = (newRating) => { 19 | console.log(newRating) 20 | } 21 | 22 | render(, 27 | 28 | document.getElementById('where-to-render') 29 | ); 30 | ``` 31 | ### API 32 | 33 | This a list of props that you can pass down to the component: 34 | 35 | | Property | Description | Default value | type | 36 | | -------- | ----------- | ------------- | ---- | 37 | | `className` | Name of parent class | `null` | string | 38 | | `count` | How many total stars you want | 5 | number | 39 | | `value` | Set rating value | 0 | number | 40 | | `char` | Which character you want to use as a star | ★ | string | 41 | | `color1` | Color of inactive star (this supports any CSS valid value) | `gray` | string | 42 | | `color2` | Color of selected or active star | `#ffd700` | string | 43 | | `size` | Size of stars (in px) | `15px` | string | 44 | | `edit` | Should you be able to select rating or just see rating (for reusability) | `true` | boolean | 45 | | `half` | Should component use half stars, if not the decimal part will be dropped otherwise normal algebra rools will apply to round to half stars | `true` | boolean 46 | | `onChange(new_rating)` | Will be invoked any time the rating is changed | `null` | function | 47 | 48 | ### Help improve the component 49 | ###### Build on your machine: 50 | ```bash 51 | # Clone the repo 52 | git clone git@github.com:n49/react-stars.git 53 | # Go into project folder 54 | cd react-stars 55 | # Install dependancies 56 | npm install 57 | ``` 58 | Build the component: 59 | ```bash 60 | npm build 61 | ``` 62 | Run the examples (dev): 63 | ```bash 64 | npm run dev-example 65 | ``` 66 | Build the examples (production): 67 | ```bash 68 | npm run build-example 69 | ``` 70 | 71 | Then in your browser go to: [http://127.0.0.1:8080/example](http://127.0.0.1:8080/example) 72 | 73 | ### Requirements 74 | 75 | You will need to have React in your project in order to use the component, I didn't bundle React in the build, because it seemed like a crazy idea. 76 | 77 | ### Todo 78 | 79 | * Make better docs 80 | * Better state management 81 | * Write tests 82 | -------------------------------------------------------------------------------- /dist/react-stars.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | 7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 8 | 9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 10 | 11 | var _react = require('react'); 12 | 13 | var _react2 = _interopRequireDefault(_react); 14 | 15 | var _propTypes = require('prop-types'); 16 | 17 | var _propTypes2 = _interopRequireDefault(_propTypes); 18 | 19 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 20 | 21 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 22 | 23 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 24 | 25 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 26 | 27 | var parentStyles = { 28 | overflow: 'hidden', 29 | position: 'relative' 30 | }; 31 | 32 | var defaultStyles = { 33 | position: 'relative', 34 | overflow: 'hidden', 35 | cursor: 'pointer', 36 | display: 'block', 37 | float: 'left' 38 | }; 39 | 40 | var getHalfStarStyles = function getHalfStarStyles(color, uniqueness) { 41 | return '\n .react-stars-' + uniqueness + ':before {\n position: absolute;\n overflow: hidden;\n display: block;\n z-index: 1;\n top: 0; left: 0;\n width: 50%;\n content: attr(data-forhalf);\n color: ' + color + ';\n }'; 42 | }; 43 | 44 | var ReactStars = function (_Component) { 45 | _inherits(ReactStars, _Component); 46 | 47 | function ReactStars(props) { 48 | _classCallCheck(this, ReactStars); 49 | 50 | // set defaults 51 | 52 | var _this = _possibleConstructorReturn(this, (ReactStars.__proto__ || Object.getPrototypeOf(ReactStars)).call(this, props)); 53 | 54 | props = _extends({}, props); 55 | 56 | _this.state = { 57 | uniqueness: (Math.random() + '').replace('.', ''), 58 | value: props.value || 0, 59 | stars: [], 60 | halfStar: { 61 | at: Math.floor(props.value), 62 | hidden: props.half && props.value % 1 < 0.5 63 | } 64 | }; 65 | 66 | _this.state.config = { 67 | count: props.count, 68 | size: props.size, 69 | char: props.char, 70 | // default color of inactive star 71 | color1: props.color1, 72 | // color of an active star 73 | color2: props.color2, 74 | half: props.half, 75 | edit: props.edit 76 | }; 77 | 78 | return _this; 79 | } 80 | 81 | _createClass(ReactStars, [{ 82 | key: 'componentDidMount', 83 | value: function componentDidMount() { 84 | this.setState({ 85 | stars: this.getStars(this.state.value) 86 | }); 87 | } 88 | }, { 89 | key: 'componentWillReceiveProps', 90 | value: function componentWillReceiveProps(props) { 91 | this.setState({ 92 | stars: this.getStars(props.value), 93 | value: props.value, 94 | halfStar: { 95 | at: Math.floor(props.value), 96 | hidden: this.state.config.half && props.value % 1 < 0.5 97 | } 98 | }); 99 | } 100 | }, { 101 | key: 'isDecimal', 102 | value: function isDecimal(value) { 103 | return value % 1 !== 0; 104 | } 105 | }, { 106 | key: 'getRate', 107 | value: function getRate() { 108 | var stars = void 0; 109 | if (this.state.config.half) { 110 | stars = Math.floor(this.state.value); 111 | } else { 112 | stars = Math.round(this.state.value); 113 | } 114 | return stars; 115 | } 116 | }, { 117 | key: 'getStars', 118 | value: function getStars(activeCount) { 119 | if (typeof activeCount === 'undefined') { 120 | activeCount = this.getRate(); 121 | } 122 | var stars = []; 123 | for (var i = 0; i < this.state.config.count; i++) { 124 | stars.push({ 125 | active: i <= activeCount - 1 126 | }); 127 | } 128 | return stars; 129 | } 130 | }, { 131 | key: 'mouseOver', 132 | value: function mouseOver(event) { 133 | var _state = this.state, 134 | config = _state.config, 135 | halfStar = _state.halfStar; 136 | 137 | if (!config.edit) return; 138 | var index = Number(event.target.getAttribute('data-index')); 139 | if (config.half) { 140 | var isAtHalf = this.moreThanHalf(event, config.size); 141 | halfStar.hidden = isAtHalf; 142 | if (isAtHalf) index = index + 1; 143 | halfStar.at = index; 144 | } else { 145 | index = index + 1; 146 | } 147 | this.setState({ 148 | stars: this.getStars(index) 149 | }); 150 | } 151 | }, { 152 | key: 'moreThanHalf', 153 | value: function moreThanHalf(event, size) { 154 | var target = event.target; 155 | 156 | var mouseAt = event.clientX - target.getBoundingClientRect().left; 157 | mouseAt = Math.round(Math.abs(mouseAt)); 158 | return mouseAt > size / 2; 159 | } 160 | }, { 161 | key: 'mouseLeave', 162 | value: function mouseLeave() { 163 | var _state2 = this.state, 164 | value = _state2.value, 165 | halfStar = _state2.halfStar, 166 | config = _state2.config; 167 | 168 | if (!config.edit) return; 169 | if (config.half) { 170 | halfStar.hidden = !this.isDecimal(value); 171 | halfStar.at = Math.floor(this.state.value); 172 | } 173 | this.setState({ 174 | stars: this.getStars() 175 | }); 176 | } 177 | }, { 178 | key: 'clicked', 179 | value: function clicked(event) { 180 | var _state3 = this.state, 181 | config = _state3.config, 182 | halfStar = _state3.halfStar; 183 | 184 | if (!config.edit) return; 185 | var index = Number(event.target.getAttribute('data-index')); 186 | var value = void 0; 187 | if (config.half) { 188 | var isAtHalf = this.moreThanHalf(event, config.size); 189 | halfStar.hidden = isAtHalf; 190 | if (isAtHalf) index = index + 1; 191 | value = isAtHalf ? index : index + .5; 192 | halfStar.at = index; 193 | } else { 194 | value = index = index + 1; 195 | } 196 | this.setState({ 197 | value: value, 198 | stars: this.getStars(index) 199 | }); 200 | this.props.onChange(value); 201 | } 202 | }, { 203 | key: 'renderHalfStarStyleElement', 204 | value: function renderHalfStarStyleElement() { 205 | var _state4 = this.state, 206 | config = _state4.config, 207 | uniqueness = _state4.uniqueness; 208 | 209 | return _react2.default.createElement('style', { dangerouslySetInnerHTML: { 210 | __html: getHalfStarStyles(config.color2, uniqueness) 211 | } }); 212 | } 213 | }, { 214 | key: 'renderStars', 215 | value: function renderStars() { 216 | var _this2 = this; 217 | 218 | var _state5 = this.state, 219 | halfStar = _state5.halfStar, 220 | stars = _state5.stars, 221 | uniqueness = _state5.uniqueness, 222 | config = _state5.config; 223 | var color1 = config.color1, 224 | color2 = config.color2, 225 | size = config.size, 226 | char = config.char, 227 | half = config.half, 228 | edit = config.edit; 229 | 230 | return stars.map(function (star, i) { 231 | var starClass = ''; 232 | if (half && !halfStar.hidden && halfStar.at === i) { 233 | starClass = 'react-stars-' + uniqueness; 234 | } 235 | var style = _extends({}, defaultStyles, { 236 | color: star.active ? color2 : color1, 237 | cursor: edit ? 'pointer' : 'default', 238 | fontSize: size + 'px' 239 | }); 240 | return _react2.default.createElement( 241 | 'span', 242 | { 243 | className: starClass, 244 | style: style, 245 | key: i, 246 | 'data-index': i, 247 | 'data-forhalf': char, 248 | onMouseOver: _this2.mouseOver.bind(_this2), 249 | onMouseMove: _this2.mouseOver.bind(_this2), 250 | onMouseLeave: _this2.mouseLeave.bind(_this2), 251 | onClick: _this2.clicked.bind(_this2) }, 252 | char 253 | ); 254 | }); 255 | } 256 | }, { 257 | key: 'render', 258 | value: function render() { 259 | var className = this.props.className; 260 | 261 | 262 | return _react2.default.createElement( 263 | 'div', 264 | { className: className, style: parentStyles }, 265 | this.state.config.half ? this.renderHalfStarStyleElement() : '', 266 | this.renderStars() 267 | ); 268 | } 269 | }]); 270 | 271 | return ReactStars; 272 | }(_react.Component); 273 | 274 | ReactStars.propTypes = { 275 | className: _propTypes2.default.string, 276 | edit: _propTypes2.default.bool, 277 | half: _propTypes2.default.bool, 278 | value: _propTypes2.default.number, 279 | count: _propTypes2.default.number, 280 | char: _propTypes2.default.string, 281 | size: _propTypes2.default.number, 282 | color1: _propTypes2.default.string, 283 | color2: _propTypes2.default.string 284 | }; 285 | 286 | ReactStars.defaultProps = { 287 | edit: true, 288 | half: true, 289 | value: 0, 290 | count: 5, 291 | char: '★', 292 | size: 15, 293 | color1: 'gray', 294 | color2: '#ffd700', 295 | 296 | onChange: function onChange() {} 297 | }; 298 | 299 | exports.default = ReactStars; -------------------------------------------------------------------------------- /example/bundle.js: -------------------------------------------------------------------------------- 1 | !function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([/*!******************!*\ 2 | !*** multi main ***! 3 | \******************/ 4 | function(e,t,n){e.exports=n(/*! ./example/index.js */79)},/*!*********************************!*\ 5 | !*** ./~/fbjs/lib/invariant.js ***! 6 | \*********************************/ 7 | function(e,t,n){"use strict";function r(e,t,n,r,a,i,s,u){if(o(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,i,s,u],p=0;l=new Error(t.replace(/%s/g,function(){return c[p++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};e.exports=r},/*!*******************************!*\ 8 | !*** ./~/fbjs/lib/warning.js ***! 9 | \*******************************/ 10 | function(e,t,n){"use strict";var r=n(/*! ./emptyFunction */7),o=r;e.exports=o},/*!***********************************************!*\ 11 | !*** ./~/react-dom/lib/reactProdInvariant.js ***! 12 | \***********************************************/ 13 | function(e,t){"use strict";function n(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r1){for(var m=Array(v),g=0;g1){for(var _=Array(y),b=0;b]/;e.exports=r},/*!*****************************************!*\ 91 | !*** ./~/react-dom/lib/setInnerHTML.js ***! 92 | \*****************************************/ 93 | function(e,t,n){"use strict";var r,o=n(/*! fbjs/lib/ExecutionEnvironment */6),a=n(/*! ./DOMNamespaces */31),i=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(/*! ./createMicrosoftUnsafeLocalFunction */39),l=u(function(e,t){if(e.namespaceURI!==a.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML=""+t+"";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(o.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(l=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),i.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=l},/*!************************************!*\ 94 | !*** ./~/fbjs/lib/shallowEqual.js ***! 95 | \************************************/ 96 | function(e,t){"use strict";function n(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function r(e,t){if(n(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var i=0;i-1?void 0:i("96",e),!l.plugins[n]){t.extractEvents?void 0:i("97",e),l.plugins[n]=t;var r=t.eventTypes;for(var a in r)o(r[a],t,a)?void 0:i("98",a,e)}}}function o(e,t,n){l.eventNameDispatchConfigs.hasOwnProperty(n)?i("99",n):void 0,l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){var s=r[o];a(s,t,n)}return!0}return!!e.registrationName&&(a(e.registrationName,t,n),!0)}function a(e,t,n){l.registrationNameModules[e]?i("100",e):void 0,l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var i=n(/*! ./reactProdInvariant */3),s=(n(/*! fbjs/lib/invariant */1),null),u={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){s?i("101"):void 0,s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];u.hasOwnProperty(n)&&u[n]===o||(u[n]?i("102",n):void 0,u[n]=o,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=l.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};e.exports=l},/*!*********************************************!*\ 106 | !*** ./~/react-dom/lib/EventPluginUtils.js ***! 107 | \*********************************************/ 108 | function(e,t,n){"use strict";function r(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function o(e){return"topMouseMove"===e||"topTouchMove"===e}function a(e){return"topMouseDown"===e||"topTouchStart"===e}function i(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=g.getNodeFromInstance(r),t?v.invokeGuardedCallbackWithCatch(o,n,e):v.invokeGuardedCallback(o,n,e),e.currentTarget=null}function s(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function a(e,t){var n=s.get(e);return n?n:null}var i=n(/*! ./reactProdInvariant */3),s=(n(/*! react/lib/ReactCurrentOwner */11),n(/*! ./ReactInstanceMap */20)),u=(n(/*! ./ReactInstrumentation */8),n(/*! ./ReactUpdates */9)),l=(n(/*! fbjs/lib/invariant */1),n(/*! fbjs/lib/warning */2),{isMounted:function(e){var t=s.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){l.validateCallback(t,n);var o=a(e);return o?(o._pendingCallbacks?o._pendingCallbacks.push(t):o._pendingCallbacks=[t],void r(o)):null},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=a(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t,n){var o=a(e,"replaceState");o&&(o._pendingStateQueue=[t],o._pendingReplaceState=!0,void 0!==n&&null!==n&&(l.validateCallback(n,"replaceState"),o._pendingCallbacks?o._pendingCallbacks.push(n):o._pendingCallbacks=[n]),r(o))},enqueueSetState:function(e,t){var n=a(e,"setState");if(n){var o=n._pendingStateQueue||(n._pendingStateQueue=[]);o.push(t),r(n)}},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,r(e)},validateCallback:function(e,t){e&&"function"!=typeof e?i("122",t,o(e)):void 0}});e.exports=l},/*!***************************************************************!*\ 124 | !*** ./~/react-dom/lib/createMicrosoftUnsafeLocalFunction.js ***! 125 | \***************************************************************/ 126 | function(e,t){"use strict";var n=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e};e.exports=n},/*!*********************************************!*\ 127 | !*** ./~/react-dom/lib/getEventCharCode.js ***! 128 | \*********************************************/ 129 | function(e,t){"use strict";function n(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}e.exports=n},/*!**************************************************!*\ 130 | !*** ./~/react-dom/lib/getEventModifierState.js ***! 131 | \**************************************************/ 132 | function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return!!r&&!!n[r]}function r(e){return n}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=r},/*!*******************************************!*\ 133 | !*** ./~/react-dom/lib/getEventTarget.js ***! 134 | \*******************************************/ 135 | function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}e.exports=n},/*!*********************************************!*\ 136 | !*** ./~/react-dom/lib/isEventSupported.js ***! 137 | \*********************************************/ 138 | function(e,t,n){"use strict";/** 139 | * Checks if an event is supported in the current execution environment. 140 | * 141 | * NOTE: This will not work correctly for non-generic events such as `change`, 142 | * `reset`, `load`, `error`, and `select`. 143 | * 144 | * Borrows from Modernizr. 145 | * 146 | * @param {string} eventNameSuffix Event name, e.g. "click". 147 | * @param {?boolean} capture Check if the capture phase is supported. 148 | * @return {boolean} True if the event is supported. 149 | * @internal 150 | * @license Modernizr 3.0.0pre (Custom Build) | MIT 151 | */ 152 | function r(e,t){if(!a.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var i=document.createElement("div");i.setAttribute(n,"return;"),r="function"==typeof i[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,a=n(/*! fbjs/lib/ExecutionEnvironment */6);a.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=r},/*!*******************************************************!*\ 153 | !*** ./~/react-dom/lib/shouldUpdateReactComponent.js ***! 154 | \*******************************************************/ 155 | function(e,t){"use strict";function n(e,t){var n=null===e||e===!1,r=null===t||t===!1;if(n||r)return n===r;var o=typeof e,a=typeof t;return"string"===o||"number"===o?"string"===a||"number"===a:"object"===a&&e.type===t.type&&e.key===t.key}e.exports=n},/*!***********************************************!*\ 156 | !*** ./~/react-dom/lib/validateDOMNesting.js ***! 157 | \***********************************************/ 158 | function(e,t,n){"use strict";var r=(n(/*! object-assign */4),n(/*! fbjs/lib/emptyFunction */7)),o=(n(/*! fbjs/lib/warning */2),r);e.exports=o},/*!*************************************!*\ 159 | !*** ./~/fbjs/lib/EventListener.js ***! 160 | \*************************************/ 161 | function(e,t,n){"use strict";var r=n(/*! ./emptyFunction */7),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=o},/*!*********************************!*\ 162 | !*** ./~/fbjs/lib/focusNode.js ***! 163 | \*********************************/ 164 | function(e,t){"use strict";function n(e){try{e.focus()}catch(e){}}e.exports=n},/*!****************************************!*\ 165 | !*** ./~/fbjs/lib/getActiveElement.js ***! 166 | \****************************************/ 167 | function(e,t){"use strict";function n(e){if(e=e||("undefined"!=typeof document?document:void 0),"undefined"==typeof e)return null;try{return e.activeElement||e.body}catch(t){return e.body}}e.exports=n},/*!******************************!*\ 168 | !*** ./~/process/browser.js ***! 169 | \******************************/ 170 | function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function a(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function i(){v&&f&&(v=!1,f.length?h=f.concat(h):m=-1,h.length&&s())}function s(){if(!v){var e=o(i);v=!0;for(var t=h.length;t;){for(f=h,h=[];++m1)for(var n=1;n.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or .":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var i,s=m.createElement(F,{child:t});if(e){var u=E.get(e);i=u._processChildContext(u._context)}else i=P;var c=d(n);if(c){var p=c._currentElement,h=p.props.child;if(M(h,t)){var v=c._renderedComponent.getPublicInstance(),g=r&&function(){r.call(v)};return j._updateRootComponent(c,s,i,n,g),v}j.unmountComponentAtNode(n)}var y=o(n),_=y&&!!a(y),b=l(n),C=_&&!c&&!b,x=j._renderNewRootComponent(s,n,C,i)._renderedComponent.getPublicInstance();return r&&r.call(x),x},render:function(e,t,n){return j._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){c(e)?void 0:f("40");var t=d(e);return t?(delete L[t._instance.rootID],T.batchedUpdates(u,t,e,!1),!0):(l(e),1===e.nodeType&&e.hasAttribute(O),!1)},_mountImageIntoNode:function(e,t,n,a,i){if(c(t)?void 0:f("41"),a){var s=o(t);if(x.canReuseMarkup(e,s))return void y.precacheNode(n,s);var u=s.getAttribute(x.CHECKSUM_ATTR_NAME);s.removeAttribute(x.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(x.CHECKSUM_ATTR_NAME,u);var p=e,d=r(p,l),v=" (client) "+p.substring(d-20,d+20)+"\n (server) "+l.substring(d-20,d+20);t.nodeType===R?f("42",v):void 0}if(t.nodeType===R?f("43"):void 0,i.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);h.insertTreeBefore(t,e,null)}else N(t,e),y.precacheNode(n,t.firstChild)}};e.exports=j},/*!*******************************************!*\ 207 | !*** ./~/react-dom/lib/ReactNodeTypes.js ***! 208 | \*******************************************/ 209 | function(e,t,n){"use strict";var r=n(/*! ./reactProdInvariant */3),o=n(/*! react/lib/React */16),a=(n(/*! fbjs/lib/invariant */1),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||e===!1?a.EMPTY:o.isValidElement(e)?"function"==typeof e.type?a.COMPOSITE:a.HOST:void r("26",e)}});e.exports=a},/*!********************************************!*\ 210 | !*** ./~/react-dom/lib/ViewportMetrics.js ***! 211 | \********************************************/ 212 | function(e,t){"use strict";var n={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){n.currentScrollLeft=e.x,n.currentScrollTop=e.y}};e.exports=n},/*!*******************************************!*\ 213 | !*** ./~/react-dom/lib/accumulateInto.js ***! 214 | \*******************************************/ 215 | function(e,t,n){"use strict";function r(e,t){return null==t?o("30"):void 0,null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}var o=n(/*! ./reactProdInvariant */3);n(/*! fbjs/lib/invariant */1),e.exports=r},/*!***********************************************!*\ 216 | !*** ./~/react-dom/lib/forEachAccumulated.js ***! 217 | \***********************************************/ 218 | function(e,t){"use strict";function n(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}e.exports=n},/*!**********************************************************!*\ 219 | !*** ./~/react-dom/lib/getHostComponentFromComposite.js ***! 220 | \**********************************************************/ 221 | function(e,t,n){"use strict";function r(e){for(var t;(t=e._renderedNodeType)===o.COMPOSITE;)e=e._renderedComponent;return t===o.HOST?e._renderedComponent:t===o.EMPTY?null:void 0}var o=n(/*! ./ReactNodeTypes */62);e.exports=r},/*!***************************************************!*\ 222 | !*** ./~/react-dom/lib/getTextContentAccessor.js ***! 223 | \***************************************************/ 224 | function(e,t,n){"use strict";function r(){return!a&&o.canUseDOM&&(a="textContent"in document.documentElement?"textContent":"innerText"),a}var o=n(/*! fbjs/lib/ExecutionEnvironment */6),a=null;e.exports=r},/*!***********************************************!*\ 225 | !*** ./~/react-dom/lib/inputValueTracking.js ***! 226 | \***********************************************/ 227 | function(e,t,n){"use strict";function r(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function o(e){return e._wrapperState.valueTracker}function a(e,t){e._wrapperState.valueTracker=t}function i(e){delete e._wrapperState.valueTracker}function s(e){var t;return e&&(t=r(e)?""+e.checked:e.value),t}var u=n(/*! ./ReactDOMComponentTree */5),l={_getTrackerFromNode:function(e){return o(u.getInstanceFromNode(e))},track:function(e){if(!o(e)){var t=u.getNodeFromInstance(e),n=r(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),l=""+t[n];t.hasOwnProperty(n)||"function"!=typeof s.get||"function"!=typeof s.set||(Object.defineProperty(t,n,{enumerable:s.enumerable,configurable:!0,get:function(){return s.get.call(this)},set:function(e){l=""+e,s.set.call(this,e)}}),a(e,{getValue:function(){return l},setValue:function(e){l=""+e},stopTracking:function(){i(e),delete t[n]}}))}},updateValueIfChanged:function(e){if(!e)return!1;var t=o(e);if(!t)return l.track(e),!0;var n=t.getValue(),r=s(u.getNodeFromInstance(e));return r!==n&&(t.setValue(r),!0)},stopTracking:function(e){var t=o(e);t&&t.stopTracking()}};e.exports=l},/*!******************************************************!*\ 228 | !*** ./~/react-dom/lib/instantiateReactComponent.js ***! 229 | \******************************************************/ 230 | function(e,t,n){"use strict";function r(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function o(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function a(e,t){var n;if(null===e||e===!1)n=l.create(a);else if("object"==typeof e){var s=e,u=s.type;if("function"!=typeof u&&"string"!=typeof u){var d="";d+=r(s._owner),i("130",null==u?u:typeof u,d)}"string"==typeof s.type?n=c.createInternalComponent(s):o(s.type)?(n=new s.type(s),n.getHostNode||(n.getHostNode=n.getNativeNode)):n=new p(s)}else"string"==typeof e||"number"==typeof e?n=c.createInstanceForText(e):i("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}var i=n(/*! ./reactProdInvariant */3),s=n(/*! object-assign */4),u=n(/*! ./ReactCompositeComponent */111),l=n(/*! ./ReactEmptyComponent */57),c=n(/*! ./ReactHostComponent */59),p=(n(/*! react/lib/getNextDebugID */170),n(/*! fbjs/lib/invariant */1),n(/*! fbjs/lib/warning */2),function(e){this.construct(e)});s(p.prototype,u,{_instantiateReactComponent:a}),e.exports=a},/*!***********************************************!*\ 231 | !*** ./~/react-dom/lib/isTextInputElement.js ***! 232 | \***********************************************/ 233 | function(e,t){"use strict";function n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!r[e.type]:"textarea"===t}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=n},/*!*******************************************!*\ 234 | !*** ./~/react-dom/lib/setTextContent.js ***! 235 | \*******************************************/ 236 | function(e,t,n){"use strict";var r=n(/*! fbjs/lib/ExecutionEnvironment */6),o=n(/*! ./escapeTextContentForBrowser */27),a=n(/*! ./setInnerHTML */28),i=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(i=function(e,t){return 3===e.nodeType?void(e.nodeValue=t):void a(e,o(t))})),e.exports=i},/*!************************************************!*\ 237 | !*** ./~/react-dom/lib/traverseAllChildren.js ***! 238 | \************************************************/ 239 | function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?l.escape(e.key):t.toString(36)}function o(e,t,n,a){var d=typeof e;if("undefined"!==d&&"boolean"!==d||(e=null),null===e||"string"===d||"number"===d||"object"===d&&e.$$typeof===s)return n(a,e,""===t?c+r(e,0):t),1;var f,h,v=0,m=""===t?c:t+p;if(Array.isArray(e))for(var g=0;gt/2}},{key:"mouseLeave",value:function(){var e=this.state,t=e.value,n=e.halfStar,r=e.config;r.edit&&(r.half&&(n.hidden=!this.isDecimal(t),n.at=Math.floor(this.state.value)),this.setState({stars:this.getStars()}))}},{key:"clicked",value:function(e){var t=this.state,n=t.config,r=t.halfStar;if(n.edit){var o=Number(e.target.getAttribute("data-index")),a=void 0;if(n.half){var i=this.moreThanHalf(e,n.size);r.hidden=i,i&&(o+=1),a=i?o:o+.5,r.at=o}else a=o+=1;this.setState({value:a,stars:this.getStars(o)}),this.props.onChange(a)}}},{key:"renderHalfStarStyleElement",value:function(){var e=this.state,t=e.config,n=e.uniqueness;return c.default.createElement("style",{dangerouslySetInnerHTML:{__html:v(t.color2,n)}})}},{key:"renderStars",value:function(){var e=this,t=this.state,n=t.halfStar,r=t.stars,o=t.uniqueness,a=t.config,i=a.color1,u=a.color2,l=a.size,p=a.char,d=a.half,f=a.edit;return r.map(function(t,r){var a="";d&&!n.hidden&&n.at===r&&(a="react-stars-"+o);var v=s({},h,{color:t.active?u:i,cursor:f?"pointer":"default",fontSize:l+"px"});return c.default.createElement("span",{className:a,style:v,key:r,"data-index":r,"data-forhalf":p,onMouseOver:e.mouseOver.bind(e),onMouseMove:e.mouseOver.bind(e),onMouseLeave:e.mouseLeave.bind(e),onClick:e.clicked.bind(e)},p)})}},{key:"render",value:function(){var e=this.props.className;return c.default.createElement("div",{className:e,style:f},this.state.config.half?this.renderHalfStarStyleElement():"",this.renderStars())}}]),t}(l.Component);m.propTypes={className:d.default.string,edit:d.default.bool,half:d.default.bool,value:d.default.number,count:d.default.number,char:d.default.string,size:d.default.number,color1:d.default.string,color2:d.default.string},t.default=m},/*!*****************************************!*\ 264 | !*** ./~/create-react-class/factory.js ***! 265 | \*****************************************/ 266 | function(e,t,n){"use strict";function r(e){return e}function o(e,t,n){function o(e,t){var n=y.hasOwnProperty(t)?y[t]:null;E.hasOwnProperty(t)&&u("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&u("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function a(e,n){if(n){u("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),u(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,a=r.__reactAutoBindPairs;n.hasOwnProperty(l)&&_.mixins(e,n.mixins);for(var i in n)if(n.hasOwnProperty(i)&&i!==l){var s=n[i],c=r.hasOwnProperty(i);if(o(c,i),_.hasOwnProperty(i))_[i](e,s);else{var p=y.hasOwnProperty(i),h="function"==typeof s,v=h&&!p&&!c&&n.autobind!==!1;if(v)a.push(i,s),r[i]=s;else if(c){var m=y[i];u(p&&("DEFINE_MANY_MERGED"===m||"DEFINE_MANY"===m),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",m,i),"DEFINE_MANY_MERGED"===m?r[i]=d(r[i],s):"DEFINE_MANY"===m&&(r[i]=f(r[i],s))}else r[i]=s}}}}function c(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in _;u(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var a=n in e;u(!a,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function p(e,t){u(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(u(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function d(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return p(o,n),p(o,r),o}}function f(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function h(e,t){var n=t.bind(e);return n}function v(e){for(var t=e.__reactAutoBindPairs,n=0;n":i.innerHTML="<"+e+">",s[e]=!i.firstChild),s[e]?d[e]:null}var o=n(/*! ./ExecutionEnvironment */6),a=n(/*! ./invariant */1),i=o.canUseDOM?document.createElement("div"):null,s={},u=[1,'"],l=[1,"","
"],c=[3,"","
"],p=[1,'',""],d={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c},f=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];f.forEach(function(e){d[e]=p,s[e]=!0}),e.exports=r},/*!**************************************************!*\ 285 | !*** ./~/fbjs/lib/getUnboundedScrollPosition.js ***! 286 | \**************************************************/ 287 | function(e,t){"use strict";function n(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=n},/*!*********************************!*\ 288 | !*** ./~/fbjs/lib/hyphenate.js ***! 289 | \*********************************/ 290 | function(e,t){"use strict";function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;e.exports=n},/*!******************************************!*\ 291 | !*** ./~/fbjs/lib/hyphenateStyleName.js ***! 292 | \******************************************/ 293 | function(e,t,n){"use strict";function r(e){return o(e).replace(a,"-ms-")}var o=n(/*! ./hyphenate */89),a=/^ms-/;e.exports=r},/*!******************************!*\ 294 | !*** ./~/fbjs/lib/isNode.js ***! 295 | \******************************/ 296 | function(e,t){"use strict";function n(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=n},/*!**********************************!*\ 297 | !*** ./~/fbjs/lib/isTextNode.js ***! 298 | \**********************************/ 299 | function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=n(/*! ./isNode */91);e.exports=r},/*!*****************************************!*\ 300 | !*** ./~/fbjs/lib/memoizeStringOnly.js ***! 301 | \*****************************************/ 302 | function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=n},/*!****************************************!*\ 303 | !*** ./~/prop-types/checkPropTypes.js ***! 304 | \****************************************/ 305 | function(e,t,n){"use strict";function r(e,t,n,r,o){}e.exports=r},/*!**************************************************!*\ 306 | !*** ./~/prop-types/factoryWithThrowingShims.js ***! 307 | \**************************************************/ 308 | function(e,t,n){"use strict";var r=n(/*! fbjs/lib/emptyFunction */7),o=n(/*! fbjs/lib/invariant */1),a=n(/*! ./lib/ReactPropTypesSecret */51);e.exports=function(){function e(e,t,n,r,i,s){s!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},/*!*************************************************!*\ 309 | !*** ./~/prop-types/factoryWithTypeCheckers.js ***! 310 | \*************************************************/ 311 | function(e,t,n){"use strict";var r=n(/*! fbjs/lib/emptyFunction */7),o=n(/*! fbjs/lib/invariant */1),a=n(/*! fbjs/lib/warning */2),i=n(/*! ./lib/ReactPropTypesSecret */51),s=n(/*! ./checkPropTypes */94);e.exports=function(e,t){function n(e){var t=e&&(P&&e[P]||e[S]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function c(e){function n(n,r,a,s,u,c,p){return s=s||N,c=c||a,p!==i&&t&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"),null==r[a]?n?new l(null===r[a]?"The "+u+" `"+c+"` is marked as required "+("in `"+s+"`, but its value is `null`."):"The "+u+" `"+c+"` is marked as required in "+("`"+s+"`, but its value is `undefined`.")):null:e(r,a,s,u,c)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function p(e){function t(t,n,r,o,a,i){var s=t[n],u=x(s);if(u!==e){var c=w(s);return new l("Invalid "+o+" `"+a+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return c(t)}function d(){return c(r.thatReturnsNull)}function f(e){function t(t,n,r,o,a){if("function"!=typeof e)return new l("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var u=x(s);return new l("Invalid "+o+" `"+a+"` of type "+("`"+u+"` supplied to `"+r+"`, expected an array."))}for(var c=0;c8&&C<=11),w=32,k=String.fromCharCode(w),T={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},P=!1,S=null,N={eventTypes:T,extractEvents:function(e,t,n,r){return[l(e,t,n,r),d(e,t,n,r)]}};e.exports=N},/*!**************************************************!*\ 327 | !*** ./~/react-dom/lib/CSSPropertyOperations.js ***! 328 | \**************************************************/ 329 | function(e,t,n){"use strict";var r=n(/*! ./CSSProperty */52),o=n(/*! fbjs/lib/ExecutionEnvironment */6),a=(n(/*! ./ReactInstrumentation */8),n(/*! fbjs/lib/camelizeStyleName */83),n(/*! ./dangerousStyleValue */153)),i=n(/*! fbjs/lib/hyphenateStyleName */90),s=n(/*! fbjs/lib/memoizeStringOnly */93),u=(n(/*! fbjs/lib/warning */2),s(function(e){return i(e)})),l=!1,c="cssFloat";if(o.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){l=!0}void 0===document.documentElement.style.cssFloat&&(c="styleFloat")}var d={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=0===r.indexOf("--"),i=e[r];null!=i&&(n+=u(r)+":",n+=a(r,i,t,o)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var i in t)if(t.hasOwnProperty(i)){var s=0===i.indexOf("--"),u=a(i,t[i],n,s);if("float"!==i&&"cssFloat"!==i||(i=c),s)o.setProperty(i,u);else if(u)o[i]=u;else{var p=l&&r.shorthandPropertyExpansions[i];if(p)for(var d in p)o[d]="";else o[i]=""}}}};e.exports=d},/*!**********************************************!*\ 330 | !*** ./~/react-dom/lib/ChangeEventPlugin.js ***! 331 | \**********************************************/ 332 | function(e,t,n){"use strict";function r(e,t,n){var r=T.getPooled(I.change,e,t,n);return r.type="change",E.accumulateTwoPhaseDispatches(r),r}function o(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function a(e){var t=r(A,e,S(e));k.batchedUpdates(i,t)}function i(e){C.enqueueEvents(e),C.processEventQueue(!1)}function s(e,t){O=e,A=t,O.attachEvent("onchange",a)}function u(){O&&(O.detachEvent("onchange",a),O=null,A=null)}function l(e,t){var n=P.updateValueIfChanged(e),r=t.simulated===!0&&L._allowSimulatedPassThrough;if(n||r)return e}function c(e,t){if("topChange"===e)return t}function p(e,t,n){"topFocus"===e?(u(),s(t,n)):"topBlur"===e&&u()}function d(e,t){O=e,A=t,O.attachEvent("onpropertychange",h)}function f(){O&&(O.detachEvent("onpropertychange",h),O=null,A=null)}function h(e){"value"===e.propertyName&&l(A,e)&&a(e)}function v(e,t,n){"topFocus"===e?(f(),d(t,n)):"topBlur"===e&&f()}function m(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return l(A,n)}function g(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function y(e,t,n){if("topClick"===e)return l(t,n)}function _(e,t,n){if("topInput"===e||"topChange"===e)return l(t,n)}function b(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}var C=n(/*! ./EventPluginHub */18),E=n(/*! ./EventPropagators */19),x=n(/*! fbjs/lib/ExecutionEnvironment */6),w=n(/*! ./ReactDOMComponentTree */5),k=n(/*! ./ReactUpdates */9),T=n(/*! ./SyntheticEvent */10),P=n(/*! ./inputValueTracking */68),S=n(/*! ./getEventTarget */42),N=n(/*! ./isEventSupported */43),M=n(/*! ./isTextInputElement */70),I={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}},O=null,A=null,R=!1;x.canUseDOM&&(R=N("change")&&(!document.documentMode||document.documentMode>8));var D=!1;x.canUseDOM&&(D=N("input")&&(!("documentMode"in document)||document.documentMode>9));var L={eventTypes:I,_allowSimulatedPassThrough:!0,_isInputEventSupported:D,extractEvents:function(e,t,n,a){var i,s,u=t?w.getNodeFromInstance(t):window;if(o(u)?R?i=c:s=p:M(u)?D?i=_:(i=m,s=v):g(u)&&(i=y),i){var l=i(e,t,n);if(l){var d=r(l,n,a);return d}}s&&s(e,u,t),"topBlur"===e&&b(t,u)}};e.exports=L},/*!***********************************!*\ 333 | !*** ./~/react-dom/lib/Danger.js ***! 334 | \***********************************/ 335 | function(e,t,n){"use strict";var r=n(/*! ./reactProdInvariant */3),o=n(/*! ./DOMLazyTree */13),a=n(/*! fbjs/lib/ExecutionEnvironment */6),i=n(/*! fbjs/lib/createNodesFromMarkup */86),s=n(/*! fbjs/lib/emptyFunction */7),u=(n(/*! fbjs/lib/invariant */1),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(a.canUseDOM?void 0:r("56"),t?void 0:r("57"),"HTML"===e.nodeName?r("58"):void 0,"string"==typeof t){var n=i(t,s)[0];e.parentNode.replaceChild(n,e)}else o.replaceChildWithTree(e,t)}});e.exports=u},/*!****************************************************!*\ 336 | !*** ./~/react-dom/lib/DefaultEventPluginOrder.js ***! 337 | \****************************************************/ 338 | function(e,t){"use strict";var n=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"];e.exports=n},/*!**************************************************!*\ 339 | !*** ./~/react-dom/lib/EnterLeaveEventPlugin.js ***! 340 | \**************************************************/ 341 | function(e,t,n){"use strict";var r=n(/*! ./EventPropagators */19),o=n(/*! ./ReactDOMComponentTree */5),a=n(/*! ./SyntheticMouseEvent */25),i={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},s={eventTypes:i,extractEvents:function(e,t,n,s){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var u;if(s.window===s)u=s;else{var l=s.ownerDocument;u=l?l.defaultView||l.parentWindow:window}var c,p;if("topMouseOut"===e){c=t;var d=n.relatedTarget||n.toElement;p=d?o.getClosestInstanceFromNode(d):null}else c=null,p=t;if(c===p)return null;var f=null==c?u:o.getNodeFromInstance(c),h=null==p?u:o.getNodeFromInstance(p),v=a.getPooled(i.mouseLeave,c,n,s);v.type="mouseleave",v.target=f,v.relatedTarget=h;var m=a.getPooled(i.mouseEnter,p,n,s);return m.type="mouseenter",m.target=h,m.relatedTarget=f,r.accumulateEnterLeaveDispatches(v,m,c,p),[v,m]}};e.exports=s},/*!*****************************************************!*\ 342 | !*** ./~/react-dom/lib/FallbackCompositionState.js ***! 343 | \*****************************************************/ 344 | function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var o=n(/*! object-assign */4),a=n(/*! ./PooledClass */12),i=n(/*! ./getTextContentAccessor */67);o(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[i()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),a=o.length;for(e=0;e1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),a.addPoolingTo(r),e.exports=r},/*!**************************************************!*\ 345 | !*** ./~/react-dom/lib/HTMLDOMPropertyConfig.js ***! 346 | \**************************************************/ 347 | function(e,t,n){"use strict";var r=n(/*! ./DOMProperty */14),o=r.injection.MUST_USE_PROPERTY,a=r.injection.HAS_BOOLEAN_VALUE,i=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,l={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:a,allowTransparency:0,alt:0,as:0,async:a,autoComplete:0,autoPlay:a,capture:a,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|a,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:a,coords:0,crossOrigin:0,data:0,dateTime:0,default:a,defer:a,dir:0,disabled:a,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:a,formTarget:0,frameBorder:0,headers:0,height:0,hidden:a,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:a,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|a,muted:o|a,name:0,nonce:0,noValidate:a,open:a,optimum:0,pattern:0,placeholder:0,playsInline:a,poster:0,preload:0,profile:0,radioGroup:0,readOnly:a,referrerPolicy:0,rel:0,required:a,reversed:a,role:0,rows:s,rowSpan:i,sandbox:0,scope:0,scoped:a,scrolling:0,seamless:a,selected:o|a,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:i,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:a,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){return null==t?e.removeAttribute("value"):void("number"!==e.type||e.hasAttribute("value")===!1?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t))}}};e.exports=l},/*!*************************************************!*\ 348 | !*** ./~/react-dom/lib/ReactChildReconciler.js ***! 349 | \*************************************************/ 350 | function(e,t,n){(function(t){"use strict";function r(e,t,n,r){var o=void 0===e[n];null!=t&&o&&(e[n]=a(t,!0))}var o=n(/*! ./ReactReconciler */15),a=n(/*! ./instantiateReactComponent */69),i=(n(/*! ./KeyEscapeUtils */34),n(/*! ./shouldUpdateReactComponent */44)),s=n(/*! ./traverseAllChildren */72),u=(n(/*! fbjs/lib/warning */2),{instantiateChildren:function(e,t,n,o){if(null==e)return null;var a={};return s(e,r,a),a},updateChildren:function(e,t,n,r,s,u,l,c,p){if(t||e){var d,f;for(d in t)if(t.hasOwnProperty(d)){f=e&&e[d];var h=f&&f._currentElement,v=t[d];if(null!=f&&i(h,v))o.receiveComponent(f,v,s,c),t[d]=f;else{f&&(r[d]=o.getHostNode(f),o.unmountComponent(f,!1));var m=a(v,!0);t[d]=m;var g=o.mountComponent(m,s,u,l,c,p);n.push(g)}}for(d in e)!e.hasOwnProperty(d)||t&&t.hasOwnProperty(d)||(f=e[d],r[d]=o.getHostNode(f),o.unmountComponent(f,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];o.unmountComponent(r,t)}}});e.exports=u}).call(t,n(/*! ./../../process/browser.js */49))},/*!*************************************************************!*\ 351 | !*** ./~/react-dom/lib/ReactComponentBrowserEnvironment.js ***! 352 | \*************************************************************/ 353 | function(e,t,n){"use strict";var r=n(/*! ./DOMChildrenOperations */30),o=n(/*! ./ReactDOMIDOperations */117),a={processChildrenUpdates:o.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=a},/*!****************************************************!*\ 354 | !*** ./~/react-dom/lib/ReactCompositeComponent.js ***! 355 | \****************************************************/ 356 | function(e,t,n){"use strict";function r(e){}function o(e,t){}function a(e){return!(!e.prototype||!e.prototype.isReactComponent)}function i(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}var s=n(/*! ./reactProdInvariant */3),u=n(/*! object-assign */4),l=n(/*! react/lib/React */16),c=n(/*! ./ReactComponentEnvironment */36),p=n(/*! react/lib/ReactCurrentOwner */11),d=n(/*! ./ReactErrorUtils */37),f=n(/*! ./ReactInstanceMap */20),h=(n(/*! ./ReactInstrumentation */8),n(/*! ./ReactNodeTypes */62)),v=n(/*! ./ReactReconciler */15),m=n(/*! fbjs/lib/emptyObject */23),g=(n(/*! fbjs/lib/invariant */1),n(/*! fbjs/lib/shallowEqual */29)),y=n(/*! ./shouldUpdateReactComponent */44),_=(n(/*! fbjs/lib/warning */2),{ImpureClass:0,PureClass:1,StatelessFunctional:2});r.prototype.render=function(){var e=f.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return o(e,t),t};var b=1,C={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,u){this._context=u,this._mountOrder=b++,this._hostParent=t,this._hostContainerInfo=n;var c,p=this._currentElement.props,d=this._processContext(u),h=this._currentElement.type,v=e.getUpdateQueue(),g=a(h),y=this._constructComponent(g,p,d,v);g||null!=y&&null!=y.render?i(h)?this._compositeType=_.PureClass:this._compositeType=_.ImpureClass:(c=y,o(h,c),null===y||y===!1||l.isValidElement(y)?void 0:s("105",h.displayName||h.name||"Component"),y=new r(h),this._compositeType=_.StatelessFunctional),y.props=p,y.context=d,y.refs=m,y.updater=v,this._instance=y,f.set(y,this);var C=y.state;void 0===C&&(y.state=C=null),"object"!=typeof C||Array.isArray(C)?s("106",this.getName()||"ReactCompositeComponent"):void 0,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var E;return E=y.unstable_handleError?this.performInitialMountWithErrorHandling(c,t,n,e,u):this.performInitialMount(c,t,n,e,u),y.componentDidMount&&e.getReactMountReady().enqueue(y.componentDidMount,y),E},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var o=this._currentElement.type;return e?new o(t,n,r):o(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,o){var a,i=r.checkpoint();try{a=this.performInitialMount(e,t,n,r,o)}catch(s){r.rollback(i),this._instance.unstable_handleError(s),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),i=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(i),a=this.performInitialMount(e,t,n,r,o)}return a},performInitialMount:function(e,t,n,r,o){var a=this._instance,i=0;a.componentWillMount&&(a.componentWillMount(),this._pendingStateQueue&&(a.state=this._processPendingState(a.props,a.context))),void 0===e&&(e=this._renderValidatedComponent());var s=h.getType(e);this._renderedNodeType=s;var u=this._instantiateReactComponent(e,s!==h.EMPTY);this._renderedComponent=u;var l=v.mountComponent(u,r,t,n,this._processChildContext(o),i);return l},getHostNode:function(){return v.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";d.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(v.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,f.remove(t)}},_maskContext:function(e){var t=this._currentElement.type,n=t.contextTypes;if(!n)return m;var r={};for(var o in n)r[o]=e[o];return r},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t,n=this._currentElement.type,r=this._instance;if(r.getChildContext&&(t=r.getChildContext()),t){"object"!=typeof n.childContextTypes?s("107",this.getName()||"ReactCompositeComponent"):void 0;for(var o in t)o in n.childContextTypes?void 0:s("108",this.getName()||"ReactCompositeComponent",o);return u({},e,t)}return e},_checkContextTypes:function(e,t,n){},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?v.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,r,o){var a=this._instance;null==a?s("136",this.getName()||"ReactCompositeComponent"):void 0;var i,u=!1;this._context===o?i=a.context:(i=this._processContext(o),u=!0);var l=t.props,c=n.props;t!==n&&(u=!0),u&&a.componentWillReceiveProps&&a.componentWillReceiveProps(c,i);var p=this._processPendingState(c,i),d=!0;this._pendingForceUpdate||(a.shouldComponentUpdate?d=a.shouldComponentUpdate(c,p,i):this._compositeType===_.PureClass&&(d=!g(l,c)||!g(a.state,p))),this._updateBatchNumber=null,d?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,c,p,i,e,o)):(this._currentElement=n,this._context=o,a.props=c,a.state=p,a.context=i)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,o=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(o&&1===r.length)return r[0];for(var a=u({},o?r[0]:n.state),i=o?1:0;i=0||null!=t.is}function v(e){var t=e.type;f(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var m=n(/*! ./reactProdInvariant */3),g=n(/*! object-assign */4),y=n(/*! ./AutoFocusUtils */100),_=n(/*! ./CSSPropertyOperations */102),b=n(/*! ./DOMLazyTree */13),C=n(/*! ./DOMNamespaces */31),E=n(/*! ./DOMProperty */14),x=n(/*! ./DOMPropertyOperations */54),w=n(/*! ./EventPluginHub */18),k=n(/*! ./EventPluginRegistry */32),T=n(/*! ./ReactBrowserEventEmitter */24),P=n(/*! ./ReactDOMComponentFlags */55),S=n(/*! ./ReactDOMComponentTree */5),N=n(/*! ./ReactDOMInput */118),M=n(/*! ./ReactDOMOption */119),I=n(/*! ./ReactDOMSelect */56),O=n(/*! ./ReactDOMTextarea */122),A=(n(/*! ./ReactInstrumentation */8),n(/*! ./ReactMultiChild */131)),R=n(/*! ./ReactServerRenderingTransaction */136),D=(n(/*! fbjs/lib/emptyFunction */7),n(/*! ./escapeTextContentForBrowser */27)),L=(n(/*! fbjs/lib/invariant */1),n(/*! ./isEventSupported */43),n(/*! fbjs/lib/shallowEqual */29),n(/*! ./inputValueTracking */68)),U=(n(/*! ./validateDOMNesting */45),n(/*! fbjs/lib/warning */2),P),F=w.deleteListener,j=S.getNodeFromInstance,V=T.listenTo,B=k.registrationNameModules,W={string:!0,number:!0},H="style",q="__html",K={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},z=11,Y={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},X={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},G={listing:!0,pre:!0,textarea:!0},Q=g({menuitem:!0},X),$=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Z={},J={}.hasOwnProperty,ee=1;v.displayName="ReactDOMComponent",v.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=ee++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var a=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(p,this);break;case"input":N.mountWrapper(this,a,t),a=N.getHostProps(this,a),e.getReactMountReady().enqueue(c,this),e.getReactMountReady().enqueue(p,this);break;case"option":M.mountWrapper(this,a,t),a=M.getHostProps(this,a);break;case"select":I.mountWrapper(this,a,t),a=I.getHostProps(this,a),e.getReactMountReady().enqueue(p,this);break;case"textarea":O.mountWrapper(this,a,t),a=O.getHostProps(this,a),e.getReactMountReady().enqueue(c,this),e.getReactMountReady().enqueue(p,this)}o(this,a);var i,d;null!=t?(i=t._namespaceURI,d=t._tag):n._tag&&(i=n._namespaceURI,d=n._tag),(null==i||i===C.svg&&"foreignobject"===d)&&(i=C.html),i===C.html&&("svg"===this._tag?i=C.svg:"math"===this._tag&&(i=C.mathml)),this._namespaceURI=i;var f;if(e.useCreateElement){var h,v=n._ownerDocument;if(i===C.html)if("script"===this._tag){var m=v.createElement("div"),g=this._currentElement.type;m.innerHTML="<"+g+">",h=m.removeChild(m.firstChild)}else h=a.is?v.createElement(this._currentElement.type,a.is):v.createElement(this._currentElement.type);else h=v.createElementNS(i,this._currentElement.type);S.precacheNode(this,h),this._flags|=U.hasCachedChildNodes,this._hostParent||x.setAttributeForRoot(h),this._updateDOMProperties(null,a,e);var _=b(h);this._createInitialChildren(e,a,r,_),f=_}else{var E=this._createOpenTagMarkupAndPutListeners(e,a),w=this._createContentMarkup(e,a,r);f=!w&&X[this._tag]?E+"/>":E+">"+w+""}switch(this._tag){case"input":e.getReactMountReady().enqueue(s,this),a.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(u,this),a.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"select":a.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"button":a.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(l,this)}return f},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(null!=o)if(B.hasOwnProperty(r))o&&a(this,r,o,e);else{r===H&&(o&&(o=this._previousStyleCopy=g({},t.style)),o=_.createMarkupForStyles(o,this));var i=null;null!=this._tag&&h(this._tag,t)?K.hasOwnProperty(r)||(i=x.createMarkupForCustomAttribute(r,o)):i=x.createMarkupForProperty(r,o),i&&(n+=" "+i)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+x.createMarkupForRoot()),n+=" "+x.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var a=W[typeof t.children]?t.children:null,i=null!=a?null:t.children;if(null!=a)r=D(a);else if(null!=i){var s=this.mountChildren(i,e,n);r=s.join("")}}return G[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&b.queueHTML(r,o.__html);else{var a=W[typeof t.children]?t.children:null,i=null!=a?null:t.children;if(null!=a)""!==a&&b.queueText(r,a);else if(null!=i)for(var s=this.mountChildren(i,e,n),u=0;u"},receiveComponent:function(){},getHostNode:function(){return a.getNodeFromInstance(this)},unmountComponent:function(){a.uncacheNode(this)}}),e.exports=i},/*!*************************************************!*\ 369 | !*** ./~/react-dom/lib/ReactDOMFeatureFlags.js ***! 370 | \*************************************************/ 371 | function(e,t){"use strict";var n={useCreateElement:!0,useFiber:!1};e.exports=n},/*!*************************************************!*\ 372 | !*** ./~/react-dom/lib/ReactDOMIDOperations.js ***! 373 | \*************************************************/ 374 | function(e,t,n){"use strict";var r=n(/*! ./DOMChildrenOperations */30),o=n(/*! ./ReactDOMComponentTree */5),a={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=a},/*!******************************************!*\ 375 | !*** ./~/react-dom/lib/ReactDOMInput.js ***! 376 | \******************************************/ 377 | function(e,t,n){"use strict";function r(){this._rootNodeID&&d.updateWrapper(this)}function o(e){var t="checkbox"===e.type||"radio"===e.type;return t?null!=e.checked:null!=e.value}function a(e){var t=this._currentElement.props,n=l.executeOnChange(t,e);p.asap(r,this);var o=t.name;if("radio"===t.type&&null!=o){for(var a=c.getNodeFromInstance(this),s=a;s.parentNode;)s=s.parentNode;for(var u=s.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),d=0;dt.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,o=Math.min(t.start,r),a=void 0===t.end?o:Math.min(t.end,r);if(!n.extend&&o>a){var i=a;a=o,o=i}var s=l(e,o),u=l(e,a);if(s&&u){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),o>a?(n.addRange(p),n.extend(u.node,u.offset)):(p.setEnd(u.node,u.offset),n.addRange(p))}}}var u=n(/*! fbjs/lib/ExecutionEnvironment */6),l=n(/*! ./getNodeForCharacterOffset */158),c=n(/*! ./getTextContentAccessor */67),p=u.canUseDOM&&"selection"in document&&!("getSelection"in window),d={getOffsets:p?o:a,setOffsets:p?i:s};e.exports=d},/*!**************************************************!*\ 384 | !*** ./~/react-dom/lib/ReactDOMTextComponent.js ***! 385 | \**************************************************/ 386 | function(e,t,n){"use strict";var r=n(/*! ./reactProdInvariant */3),o=n(/*! object-assign */4),a=n(/*! ./DOMChildrenOperations */30),i=n(/*! ./DOMLazyTree */13),s=n(/*! ./ReactDOMComponentTree */5),u=n(/*! ./escapeTextContentForBrowser */27),l=(n(/*! fbjs/lib/invariant */1),n(/*! ./validateDOMNesting */45),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});o(l.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,a=" react-text: "+o+" ",l=" /react-text ";if(this._domID=o,this._hostParent=t,e.useCreateElement){var c=n._ownerDocument,p=c.createComment(a),d=c.createComment(l),f=i(c.createDocumentFragment());return i.queueChild(f,i(p)),this._stringText&&i.queueChild(f,i(c.createTextNode(this._stringText))),i.queueChild(f,i(d)),s.precacheNode(this,p),this._closingComment=d,f}var h=u(this._stringText);return e.renderToStaticMarkup?h:""+h+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();a.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this),n=t.nextSibling;;){if(null==n?r("67",this._domID):void 0,8===n.nodeType&&" /react-text "===n.nodeValue){this._closingComment=n;break}n=n.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),e.exports=l},/*!*********************************************!*\ 387 | !*** ./~/react-dom/lib/ReactDOMTextarea.js ***! 388 | \*********************************************/ 389 | function(e,t,n){"use strict";function r(){this._rootNodeID&&c.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);return l.asap(r,this),n}var a=n(/*! ./reactProdInvariant */3),i=n(/*! object-assign */4),s=n(/*! ./LinkedValueUtils */35),u=n(/*! ./ReactDOMComponentTree */5),l=n(/*! ./ReactUpdates */9),c=(n(/*! fbjs/lib/invariant */1),n(/*! fbjs/lib/warning */2),{getHostProps:function(e,t){null!=t.dangerouslySetInnerHTML?a("91"):void 0;var n=i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return n},mountWrapper:function(e,t){var n=s.getValue(t),r=n;if(null==n){var i=t.defaultValue,u=t.children;null!=u&&(null!=i?a("92"):void 0,Array.isArray(u)&&(u.length<=1?void 0:a("93"),u=u[0]),i=""+u),null==i&&(i=""),r=i}e._wrapperState={initialValue:""+r,listeners:null,onChange:o.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=u.getNodeFromInstance(e),r=s.getValue(t);if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=u.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}});e.exports=c},/*!**************************************************!*\ 390 | !*** ./~/react-dom/lib/ReactDOMTreeTraversal.js ***! 391 | \**************************************************/ 392 | function(e,t,n){"use strict";function r(e,t){"_hostNode"in e?void 0:u("33"),"_hostNode"in t?void 0:u("33");for(var n=0,r=e;r;r=r._hostParent)n++;for(var o=0,a=t;a;a=a._hostParent)o++;for(;n-o>0;)e=e._hostParent,n--;for(;o-n>0;)t=t._hostParent,o--;for(var i=n;i--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}function o(e,t){"_hostNode"in e?void 0:u("35"),"_hostNode"in t?void 0:u("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1}function a(e){return"_hostNode"in e?void 0:u("36"),e._hostParent}function i(e,t,n){for(var r=[];e;)r.push(e),e=e._hostParent;var o;for(o=r.length;o-- >0;)t(r[o],"captured",n);for(o=0;o0;)n(u[l],"captured",a)}var u=n(/*! ./reactProdInvariant */3);n(/*! fbjs/lib/invariant */1),e.exports={isAncestor:o,getLowestCommonAncestor:r,getParentInstance:a,traverseTwoPhase:i,traverseEnterLeave:s}},/*!*********************************************************!*\ 393 | !*** ./~/react-dom/lib/ReactDefaultBatchingStrategy.js ***! 394 | \*********************************************************/ 395 | function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var o=n(/*! object-assign */4),a=n(/*! ./ReactUpdates */9),i=n(/*! ./Transaction */26),s=n(/*! fbjs/lib/emptyFunction */7),u={initialize:s,close:function(){d.isBatchingUpdates=!1}},l={initialize:s,close:a.flushBatchedUpdates.bind(a)},c=[l,u];o(r.prototype,i,{getTransactionWrappers:function(){return c}});var p=new r,d={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,a){var i=d.isBatchingUpdates;return d.isBatchingUpdates=!0,i?e(t,n,r,o,a):p.perform(e,null,t,n,r,o,a)}};e.exports=d},/*!**************************************************!*\ 396 | !*** ./~/react-dom/lib/ReactDefaultInjection.js ***! 397 | \**************************************************/ 398 | function(e,t,n){"use strict";function r(){x||(x=!0,y.EventEmitter.injectReactEventListener(g),y.EventPluginHub.injectEventPluginOrder(s),y.EventPluginUtils.injectComponentTree(d),y.EventPluginUtils.injectTreeTraversal(h),y.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:E,EnterLeaveEventPlugin:u,ChangeEventPlugin:i,SelectEventPlugin:C,BeforeInputEventPlugin:a}),y.HostComponent.injectGenericComponentClass(p),y.HostComponent.injectTextComponentClass(v),y.DOMProperty.injectDOMPropertyConfig(o),y.DOMProperty.injectDOMPropertyConfig(l),y.DOMProperty.injectDOMPropertyConfig(b),y.EmptyComponent.injectEmptyComponentFactory(function(e){return new f(e)}),y.Updates.injectReconcileTransaction(_),y.Updates.injectBatchingStrategy(m),y.Component.injectEnvironment(c))}var o=n(/*! ./ARIADOMPropertyConfig */99),a=n(/*! ./BeforeInputEventPlugin */101),i=n(/*! ./ChangeEventPlugin */103),s=n(/*! ./DefaultEventPluginOrder */105),u=n(/*! ./EnterLeaveEventPlugin */106),l=n(/*! ./HTMLDOMPropertyConfig */108),c=n(/*! ./ReactComponentBrowserEnvironment */110),p=n(/*! ./ReactDOMComponent */113),d=n(/*! ./ReactDOMComponentTree */5),f=n(/*! ./ReactDOMEmptyComponent */115),h=n(/*! ./ReactDOMTreeTraversal */123),v=n(/*! ./ReactDOMTextComponent */121),m=n(/*! ./ReactDefaultBatchingStrategy */124),g=n(/*! ./ReactEventListener */128),y=n(/*! ./ReactInjection */129),_=n(/*! ./ReactReconcileTransaction */134),b=n(/*! ./SVGDOMPropertyConfig */139),C=n(/*! ./SelectEventPlugin */140),E=n(/*! ./SimpleEventPlugin */141),x=!1;e.exports={inject:r}},/*!***********************************************!*\ 399 | !*** ./~/react-dom/lib/ReactElementSymbol.js ***! 400 | \***********************************************/ 401 | function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=n},/*!***************************************************!*\ 402 | !*** ./~/react-dom/lib/ReactEventEmitterMixin.js ***! 403 | \***************************************************/ 404 | function(e,t,n){"use strict";function r(e){o.enqueueEvents(e),o.processEventQueue(!1)}var o=n(/*! ./EventPluginHub */18),a={handleTopLevel:function(e,t,n,a){var i=o.extractEvents(e,t,n,a);r(i)}};e.exports=a},/*!***********************************************!*\ 405 | !*** ./~/react-dom/lib/ReactEventListener.js ***! 406 | \***********************************************/ 407 | function(e,t,n){"use strict";function r(e){for(;e._hostParent;)e=e._hostParent;var t=p.getNodeFromInstance(e),n=t.parentNode;return p.getClosestInstanceFromNode(n)}function o(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function a(e){var t=f(e.nativeEvent),n=p.getClosestInstanceFromNode(t),o=n;do e.ancestors.push(o),o=o&&r(o);while(o);for(var a=0;a/,a=/^<\!\-\-/,i={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return a.test(e)?e:e.replace(o," "+i.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(i.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var o=r(e);return o===n}};e.exports=i},/*!********************************************!*\ 414 | !*** ./~/react-dom/lib/ReactMultiChild.js ***! 415 | \********************************************/ 416 | function(e,t,n){"use strict";function r(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}function o(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:d.getHostNode(e),toIndex:n,afterNode:t}}function a(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function i(e){return{type:"SET_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e){return{type:"TEXT_CONTENT",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e,t){return t&&(e=e||[],e.push(t)),e}function l(e,t){p.processChildrenUpdates(e,t)}var c=n(/*! ./reactProdInvariant */3),p=n(/*! ./ReactComponentEnvironment */36),d=(n(/*! ./ReactInstanceMap */20),n(/*! ./ReactInstrumentation */8),n(/*! react/lib/ReactCurrentOwner */11),n(/*! ./ReactReconciler */15)),f=n(/*! ./ReactChildReconciler */109),h=(n(/*! fbjs/lib/emptyFunction */7),n(/*! ./flattenChildren */155)),v=(n(/*! fbjs/lib/invariant */1),{Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return f.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o,a){var i,s=0;return i=h(t,s),f.updateChildren(e,i,n,r,o,this,this._hostContainerInfo,a,s),i},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],a=0;for(var i in r)if(r.hasOwnProperty(i)){var s=r[i],u=0,l=d.mountComponent(s,t,this,this._hostContainerInfo,n,u);s._mountIndex=a++,o.push(l)}return o},updateTextContent:function(e){var t=this._renderedChildren;f.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&c("118");var r=[s(e)];l(this,r)},updateMarkup:function(e){var t=this._renderedChildren;f.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&c("118");var r=[i(e)];l(this,r)},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},a=[],i=this._reconcilerUpdateChildren(r,e,a,o,t,n);if(i||r){var s,c=null,p=0,f=0,h=0,v=null;for(s in i)if(i.hasOwnProperty(s)){var m=r&&r[s],g=i[s];m===g?(c=u(c,this.moveChild(m,v,p,f)),f=Math.max(m._mountIndex,f),m._mountIndex=p):(m&&(f=Math.max(m._mountIndex,f)),c=u(c,this._mountChildAtIndex(g,a[h],v,p,t,n)),h++),p++,v=d.getHostNode(g)}for(s in o)o.hasOwnProperty(s)&&(c=u(c,this._unmountChild(r[s],o[s])));c&&l(this,c),this._renderedChildren=i}},unmountChildren:function(e){var t=this._renderedChildren;f.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex=t)return{node:o,offset:t-a};a=i}o=n(r(o))}}e.exports=o},/*!*******************************************************!*\ 498 | !*** ./~/react-dom/lib/getVendorPrefixedEventName.js ***! 499 | \*******************************************************/ 500 | function(e,t,n){"use strict";function r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function o(e){if(s[e])return s[e];if(!i[e])return e;var t=i[e];for(var n in t)if(t.hasOwnProperty(n)&&n in u)return s[e]=t[n];return""}var a=n(/*! fbjs/lib/ExecutionEnvironment */6),i={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},s={},u={};a.canUseDOM&&(u=document.createElement("div").style,"AnimationEvent"in window||(delete i.animationend.animation,delete i.animationiteration.animation,delete i.animationstart.animation),"TransitionEvent"in window||delete i.transitionend.transition),e.exports=o},/*!**********************************************************!*\ 501 | !*** ./~/react-dom/lib/quoteAttributeValueForBrowser.js ***! 502 | \**********************************************************/ 503 | function(e,t,n){"use strict";function r(e){return'"'+o(e)+'"'}var o=n(/*! ./escapeTextContentForBrowser */27);e.exports=r},/*!*******************************************************!*\ 504 | !*** ./~/react-dom/lib/renderSubtreeIntoContainer.js ***! 505 | \*******************************************************/ 506 | function(e,t,n){"use strict";var r=n(/*! ./ReactMount */61);e.exports=r.renderSubtreeIntoContainer},/*!***************************************!*\ 507 | !*** ./~/react/lib/KeyEscapeUtils.js ***! 508 | \***************************************/ 509 | function(e,t){"use strict";function n(e){var t=/[=:]/g,n={"=":"=0",":":"=2"},r=(""+e).replace(t,function(e){return n[e]});return"$"+r}function r(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"},r="."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1);return(""+r).replace(t,function(e){return n[e]})}var o={escape:n,unescape:r};e.exports=o},/*!************************************!*\ 510 | !*** ./~/react/lib/PooledClass.js ***! 511 | \************************************/ 512 | function(e,t,n){"use strict";var r=n(/*! ./reactProdInvariant */22),o=(n(/*! fbjs/lib/invariant */1),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),a=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},i=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r){var o=this;if(o.instancePool.length){var a=o.instancePool.pop();return o.call(a,e,t,n,r),a}return new o(e,t,n,r)},u=function(e){var t=this;e instanceof t?void 0:r("25"),e.destructor(),t.instancePool.length 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { render } from 'react-dom' 3 | import Stars from '../src/react-stars' 4 | 5 | const firstExample = { 6 | size: 30, 7 | value: 2.5, 8 | edit: false 9 | } 10 | 11 | const secondExample = { 12 | size: 50, 13 | count: 10, 14 | char: '', 15 | color1: '#ff9900', 16 | color2: '#6599ff', 17 | onChange: newValue => { 18 | console.log(`Example 2: new value is ${newValue}`) 19 | } 20 | } 21 | 22 | const thirdExample = { 23 | size: 40, 24 | count: 7, 25 | half: false, 26 | value: 4, 27 | onChange: newValue => { 28 | console.log(`Example 3: new value is ${newValue}`) 29 | } 30 | } 31 | 32 | render( 33 |
34 |

react-stars examples

35 |

Star rating component for your React projects

36 | Custom size, preset value, not editable 37 | 38 | Custom character, custom colors, 10 stars 39 | 40 | Editable, preset value, half stars off 41 | 42 | Github |  43 | NPM package 44 |
, 45 | document.getElementById('root') 46 | ) 47 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-stars", 3 | "version": "2.2.3", 4 | "description": "Simple star rating component for your React projects", 5 | "main": "dist/react-stars.js", 6 | "repository": "https://github.com/n49/react-stars.git", 7 | "babel": { 8 | "presets": [ 9 | "react", 10 | "es2015" 11 | ] 12 | }, 13 | "ava": { 14 | "babel": { 15 | "presets": [ 16 | "es2015", 17 | "react" 18 | ] 19 | }, 20 | "require": [ 21 | "babel-register" 22 | ] 23 | }, 24 | "scripts": { 25 | "build": "babel src --out-dir dist", 26 | "dev": "babel src --out-dir dist --watch", 27 | "build-example": "webpack -p --config=webpack.production.config.js", 28 | "dev-example": "webpack-dev-server . --hot --inline" 29 | }, 30 | "keywords": [ 31 | "star", 32 | "rating", 33 | "react", 34 | "star", 35 | "rating", 36 | "component", 37 | "raty" 38 | ], 39 | "author": "Oleg Berman", 40 | "license": "ISC", 41 | "devDependencies": { 42 | "ava": "^0.14.0", 43 | "babel-cli": "^6.6.5", 44 | "babel-loader": "^6.2.4", 45 | "babel-preset-es2015": "^6.6.0", 46 | "babel-preset-react": "^6.5.0", 47 | "prop-types": "^15.5.10", 48 | "react-addons-test-utils": "^15.0.1", 49 | "react-dom": "^15.4.1", 50 | "react": "^15.4.1", 51 | "webpack": "^1.12.15", 52 | "webpack-dev-server": "^1.14.1", 53 | "babel-plugin-transform-object-assign": "^6.8.0" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/react-stars.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | const parentStyles = { 5 | overflow: 'hidden', 6 | position: 'relative' 7 | } 8 | 9 | const defaultStyles = { 10 | position: 'relative', 11 | overflow: 'hidden', 12 | cursor: 'pointer', 13 | display: 'block', 14 | float: 'left' 15 | } 16 | 17 | const getHalfStarStyles = (color, uniqueness) => { 18 | return ` 19 | .react-stars-${uniqueness}:before { 20 | position: absolute; 21 | overflow: hidden; 22 | display: block; 23 | z-index: 1; 24 | top: 0; left: 0; 25 | width: 50%; 26 | content: attr(data-forhalf); 27 | color: ${color}; 28 | }` 29 | } 30 | 31 | class ReactStars extends Component { 32 | 33 | constructor(props) { 34 | 35 | super(props) 36 | 37 | // set defaults 38 | 39 | props = Object.assign({}, props) 40 | 41 | this.state = { 42 | uniqueness: (Math.random() + '').replace('.', ''), 43 | value: props.value || 0, 44 | stars: [], 45 | halfStar: { 46 | at: Math.floor(props.value), 47 | hidden: props.half && props.value % 1 < 0.5 48 | } 49 | } 50 | 51 | this.state.config = { 52 | count: props.count, 53 | size: props.size, 54 | char: props.char, 55 | // default color of inactive star 56 | color1: props.color1, 57 | // color of an active star 58 | color2: props.color2, 59 | half: props.half, 60 | edit: props.edit, 61 | } 62 | 63 | } 64 | 65 | componentDidMount() { 66 | this.setState({ 67 | stars: this.getStars(this.state.value) 68 | }) 69 | } 70 | 71 | componentWillReceiveProps(props) { 72 | this.setState({ 73 | stars: this.getStars(props.value), 74 | value: props.value, 75 | halfStar: { 76 | at: Math.floor(props.value), 77 | hidden: this.state.config.half && props.value % 1 < 0.5 78 | }, 79 | config: Object.assign({}, this.state.config, { 80 | count: props.count, 81 | size: props.size, 82 | char: props.char, 83 | color1: props.color1, 84 | color2: props.color2, 85 | half: props.half, 86 | edit: props.edit 87 | }) 88 | }) 89 | } 90 | 91 | isDecimal(value) { 92 | return value % 1 !== 0 93 | } 94 | 95 | getRate() { 96 | let stars 97 | if (this.state.config.half) { 98 | stars = Math.floor(this.state.value) 99 | } else { 100 | stars = Math.round(this.state.value) 101 | } 102 | return stars 103 | } 104 | 105 | getStars(activeCount) { 106 | if (typeof activeCount === 'undefined') { 107 | activeCount = this.getRate() 108 | } 109 | let stars = [] 110 | for (let i = 0; i < this.state.config.count; i++) { 111 | stars.push({ 112 | active: i <= activeCount - 1 113 | }) 114 | } 115 | return stars 116 | } 117 | 118 | mouseOver(event) { 119 | let { config, halfStar } = this.state 120 | if (!config.edit) return; 121 | let index = Number(event.target.getAttribute('data-index')) 122 | if (config.half) { 123 | const isAtHalf = this.moreThanHalf(event, config.size) 124 | halfStar.hidden = isAtHalf 125 | if (isAtHalf) index = index + 1 126 | halfStar.at = index 127 | } else { 128 | index = index + 1 129 | } 130 | this.setState({ 131 | stars: this.getStars(index) 132 | }) 133 | } 134 | 135 | moreThanHalf(event, size) { 136 | let { target } = event 137 | var mouseAt = event.clientX - target.getBoundingClientRect().left 138 | mouseAt = Math.round(Math.abs(mouseAt)) 139 | return mouseAt > size / 2 140 | } 141 | 142 | mouseLeave() { 143 | const { value, halfStar, config } = this.state 144 | if (!config.edit) return 145 | if (config.half) { 146 | halfStar.hidden = !this.isDecimal(value) 147 | halfStar.at = Math.floor(this.state.value) 148 | } 149 | this.setState({ 150 | stars: this.getStars() 151 | }) 152 | } 153 | 154 | clicked(event) { 155 | const { config, halfStar } = this.state 156 | if (!config.edit) return 157 | let index = Number(event.target.getAttribute('data-index')) 158 | let value 159 | if (config.half) { 160 | const isAtHalf = this.moreThanHalf(event, config.size) 161 | halfStar.hidden = isAtHalf 162 | if (isAtHalf) index = index + 1 163 | value = isAtHalf ? index : index + .5 164 | halfStar.at = index 165 | } else { 166 | value = index = index + 1 167 | } 168 | this.setState({ 169 | value: value, 170 | stars: this.getStars(index) 171 | }) 172 | this.props.onChange(value) 173 | } 174 | 175 | renderHalfStarStyleElement() { 176 | const { config, uniqueness } = this.state 177 | return ( 178 | 181 | ) 182 | } 183 | 184 | renderStars() { 185 | const { halfStar, stars, uniqueness, config } = this.state 186 | const { color1, color2, size, char, half, edit } = config 187 | return stars.map((star, i) => { 188 | let starClass = '' 189 | if (half && !halfStar.hidden && halfStar.at === i) { 190 | starClass = `react-stars-${uniqueness}` 191 | } 192 | const style = Object.assign({}, defaultStyles, { 193 | color: star.active ? color2 : color1, 194 | cursor: edit ? 'pointer' : 'default', 195 | fontSize: `${size}px` 196 | }) 197 | return ( 198 | 208 | {char} 209 | 210 | ) 211 | }) 212 | } 213 | 214 | render() { 215 | 216 | const { 217 | className 218 | } = this.props 219 | 220 | return ( 221 |
222 | {this.state.config.half ? 223 | this.renderHalfStarStyleElement() : ''} 224 | {this.renderStars()} 225 |
226 | ) 227 | } 228 | 229 | } 230 | 231 | ReactStars.propTypes = { 232 | className: PropTypes.string, 233 | edit: PropTypes.bool, 234 | half: PropTypes.bool, 235 | value: PropTypes.number, 236 | count: PropTypes.number, 237 | char: PropTypes.string, 238 | size: PropTypes.number, 239 | color1: PropTypes.string, 240 | color2: PropTypes.string 241 | } 242 | 243 | ReactStars.defaultProps = { 244 | edit: true, 245 | half: true, 246 | value: 0, 247 | count: 5, 248 | char: '★', 249 | size: 15, 250 | color1: 'gray', 251 | color2: '#ffd700', 252 | 253 | onChange: () => { } 254 | }; 255 | 256 | export default ReactStars 257 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | 5 | entry: ['./example/index.js'], 6 | 7 | debug: true, 8 | 9 | devtool: 'inline-source-map', 10 | 11 | output: { 12 | filename: './example/bundle.js', 13 | pathinfo: true 14 | }, 15 | 16 | module: { 17 | loaders: [{ 18 | loader: 'babel-loader', 19 | test: /\.js$/, 20 | exclude: /node_modules/, 21 | query: { 22 | cacheDirectory: true, 23 | presets: ['react', 'es2015'] 24 | } 25 | }] 26 | } 27 | 28 | }; 29 | -------------------------------------------------------------------------------- /webpack.production.config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var webpack = require('webpack') 4 | 5 | module.exports = { 6 | 7 | entry: ['./example/index.js'], 8 | 9 | debug: false, 10 | 11 | output: { 12 | filename: './example/bundle.js', 13 | pathinfo: true 14 | }, 15 | 16 | module: { 17 | loaders: [{ 18 | loader: 'babel-loader', 19 | test: /\.js$/, 20 | exclude: /node_modules/, 21 | query: { 22 | cacheDirectory: true, 23 | presets: ['react', 'es2015'] 24 | } 25 | }] 26 | }, 27 | 28 | plugins: [ 29 | new webpack.DefinePlugin({ 30 | 'process.env': { 31 | 'NODE_ENV': JSON.stringify('production') 32 | } 33 | }), 34 | new webpack.optimize.UglifyJsPlugin({minimize: true}) 35 | ] 36 | 37 | }; 38 | --------------------------------------------------------------------------------