diff options
| author | Yuval Adam <yuval@y3xz.com> | 2016-01-09 20:43:40 +0200 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2016-01-09 20:43:40 +0200 |
| commit | 8cce3a028b9d1ba99c5bb0c26232c933fc3d63ea (patch) | |
| tree | 2c40098788cb5df830a1e6581f7d90d0cf1b9222 | |
| parent | 5800d6a493132ceda7417eb5230e2dbe70f371a9 (diff) | |
| parent | 7d6aa9f1de5e0597a1942c0f4b7b97769b727f26 (diff) | |
Merge branch 'react'
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | geshem.js | 255 | ||||
| -rw-r--r-- | geshem.py | 38 | ||||
| -rw-r--r-- | package.json | 36 | ||||
| -rw-r--r-- | static/img/.keep (renamed from static/.keep) | 0 | ||||
| -rw-r--r-- | static/js/bundle.js | 31335 | ||||
| -rw-r--r-- | style.scss | 38 | ||||
| -rw-r--r-- | templates/index.html | 164 | ||||
| -rw-r--r-- | webpack.config.js | 14 |
9 files changed, 31710 insertions, 172 deletions
@@ -1,5 +1,5 @@ *.pyc __pycache__/ node_modules/ -static/ +static/img/ dump.rdb diff --git a/geshem.js b/geshem.js new file mode 100644 index 0000000..4e52fd3 --- /dev/null +++ b/geshem.js @@ -0,0 +1,255 @@ +import 'babel-polyfill' + +import React from 'react' +import ReactDOM from 'react-dom' + +import 'rc-slider/assets/index.css' +import Slider from 'rc-slider' + +// Need to directly script-load instead of proper import since GL JS doesn't support webpack +// https://github.com/mapbox/mapbox-gl-js/issues/1649 +require('script!mapbox-gl/dist/mapbox-gl.js') + +import './style.scss' + +class GLMap extends React.Component { + + // Adapted from Tim Welch's code that can be found at + // https://github.com/twelch/react-mapbox-gl-seed/blob/4d78eb0/src/components/GLMap.js + + static propTypes = { + view: React.PropTypes.object, // default map view + token: React.PropTypes.string // mapbox auth token + } + + + constructor (props) { + super(props) + this.state = { + 'res': '280', + 'slider': 0 + } + this.RASTER_COORDS = { + '140': [ + [33.35317413, 33.27232471], + [36.32243686, 33.27232471], + [36.32243686, 30.72293428], + [33.35317413, 30.72293428] + ], + '280': [ + [31.93095218, 34.5156862], + [37.86644267, 34.5156862], + [37.86644267, 29.42911589], + [31.93095218, 29.42911589] + ] + } + } + + _addRadarSource (res, i, url) { + this.map.addSource('radar-' + res + '-' + i, { + "type": "image", + "url": "/static/img/" + url, + "coordinates": this.RASTER_COORDS[res] + }) + } + + _addRadarLayer (res, i) { + this.map.addLayer({ + "id": 'radar-' + res + '-' + i, + "source": 'radar-' + res + '-' + i, + "type": "raster", + "paint": { + "raster-opacity": 0.85 + } + // "layout": { + // "visibility": "none" + // } + }) + } + + _removeRadarLayer (res, i) { + this.map.removeLayer('radar-' + res + '-' + i) + } + + componentDidMount () { + mapboxgl.accessToken = this.props.token + + this.map = new mapboxgl.Map(this.props.view) + + this.map.on('zoom', (e) => { + if (this.map.getZoom() > 7) { + // this.map.setPaintProperty('radar-140-' + this.state.slider, 'raster-opacity', 0.85) + // this.map.setPaintProperty('radar-280-' + this.state.slider, 'raster-opacity', 0) + this._removeRadarLayer('280', this.state.slider) + this._addRadarLayer('140', this.state.slider) + this.setState({ + 'res': '140', + 'slider': this.state.slider + }) + } + else { + // this.map.setPaintProperty('radar-140-' + this.state.slider, 'raster-opacity', 0) + // this.map.setPaintProperty('radar-280-' + this.state.slider, 'raster-opacity', 0.85) + this._removeRadarLayer('140', this.state.slider) + this._addRadarLayer('280', this.state.slider) + this.setState({ + 'res': '280', + 'slider': this.state.slider + }) + } + }) + + this.map.on('style.load', () => { + var i = 0; + for (let v of window.imgs['140']) { + this._addRadarSource('140', i++, v) + // this._addRadarLayer('140', i++) + } + + i = 0; + for (let v of window.imgs['280']) { + this._addRadarSource('280', i++, v) + // this._addRadarLayer('280', i++) + } + // this.map.setPaintProperty('radar-280-0', 'raster-opacity', 0.85) + this._addRadarLayer('280', '0') + }) + } + + componentWillReceiveProps (props) { + // this.map.setPaintProperty('radar-' + this.state.res + '-' + this.state.slider, 'raster-opacity', 0) + // this.map.setPaintProperty('radar-' + this.state.res + '-' + props.slider, 'raster-opacity', 0.85) + + this._removeRadarLayer(this.state.res, this.state.slider) + this._addRadarLayer(this.state.res, props.slider) + + this.setState({ + 'res': this.state.res, + 'slider': props.slider + }) + } + + componentWillUnmount () { + this.map.remove() + } + + render () { + return <div id='map'></div> + } + +} + +class Map extends React.Component { + onChangeHandler = (e) => { + this.setState({ + 'slider': 7-e + }) + } + + constructor (props) { + super(props); + this.state = { + 'slider': 0 + } + } + + render () { + var mapStyle = { + "version": 8, + "name": "Dark", + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-streets-v6" + } + }, + "sprite": "mapbox://sprites/mapbox/dark-v8", + "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": {"background-color": "#111"} + }, + { + "id": "boundaries", + "source": "mapbox", + "source-layer": "admin", + "type": "line", + "paint": {"line-color": "#797979"}, + "filter": ["all", ["<=", "admin_level", 2], ['==', 'maritime', 0]] + }, + { + "id": "water", + "source": "mapbox", + "source-layer": "water", + "type": "line", + "paint": {"line-color": "#797979"} + }, + { + "id": "water2", + "source": "mapbox", + "source-layer": "water", + "type": "fill", + "paint": {"fill-color": "#111122"} + }, + { + "id": "cities", + "source": "mapbox", + "source-layer": "place_label", + "type": "symbol", + "filter": ["all", ["<=", "localrank", 6]], + "layout": { + "text-field": "{name_en}", + "text-font": ["DIN Offc Pro Bold", "Arial Unicode MS Bold"], + "text-size": {"stops": [[4, 9], [6, 12]]} + }, + "paint": { + "text-color": "#969696", + "text-halo-width": 2, + "text-halo-color": "rgba(0, 0, 0, 0.85)" + } + }, + { + "id": "states", + "source": "mapbox", + "source-layer": "state_label", + "type": "symbol", + "layout": { + "text-transform": "uppercase", + "text-field": "{name_en}", + "text-font": ["DIN Offc Pro Bold", "Arial Unicode MS Bold"], + "text-letter-spacing": 0.15, + "text-max-width": 7, + "text-size": {"stops": [[4, 10], [6, 14]]} + }, + "filter": [">=", "area", 80000], + "paint": { + "text-color": "#969696", + "text-halo-width": 2, + "text-halo-color": "rgba(0, 0, 0, 0.85)" + } + } + ] + } + const view = { + container: 'map', + maxZoom: 10, + minZoom: 5, + zoom: 6.3, + center: [35, 31.9], + style: mapStyle, + hash: false + } + + return <div> + <GLMap + view={view} + slider={this.state.slider} + token='pk.eyJ1IjoieXV2YWRtIiwiYSI6ImNpaWRuaWFxazAwMTJ2b2tyZGRmaWpsNWYifQ.qf_V3CFP_NZtLjk5luNM4g' /> + <Slider step={1} min={1} max={7} defaultValue={7} tipFormatter={null} onChange={this.onChangeHandler} /> + </div> + } +} + +ReactDOM.render(<Map/>, document.getElementById('root')) @@ -2,8 +2,8 @@ import redis import requests from datetime import datetime -from flask import Flask, render_template -from os import environ +from flask import Flask, jsonify, render_template +from os import environ, listdir from pathlib import Path from pytz import utc, timezone from redis.exceptions import ConnectionError @@ -17,9 +17,14 @@ redis = redis.from_url(environ.get('REDIS_URL', 'redis://localhost')) def fetch_latest_images(local=False): maps_json = requests.get(MAPS_JSON).json() for r in ['images140', 'images280']: - imgs = sorted(maps_json[r].items(), key=lambda x: x[0], reverse=True)[:1] # only take latest + imgs = sorted(maps_json[r].items(), key=lambda x: x[0], reverse=True) res = r[-3:] for ts, url in imgs: + if not local: + if redis.get('processed:{}:{}'.format(res, ts)): + continue + else: + redis.set('processed:{}:{}'.format(res, ts), '1') dt = datetime.strptime(ts, '%Y:%m:%d:%H:%M').strftime('%Y%m%d_%H%M%S') image = requests.get('http://' + url) if not local: @@ -27,19 +32,28 @@ def fetch_latest_images(local=False): else: dt = 'dev' filename = '{}_{}.png'.format(dt, res) - with open(str(STATIC_DIR / filename), 'wb+') as f: + with open(str(STATIC_DIR / 'img' / filename), 'wb+') as f: f.write(image.content) +@app.route('/imgs') +def get_imgs(): + img_files = sorted( + filter( + lambda f: f.endswith('.png'), listdir(str(STATIC_DIR / 'img')) + ), reverse=True + ) + img_140_files = list(filter(lambda f: f.endswith('140.png'), img_files)) + img_280_files = list(filter(lambda f: f.endswith('280.png'), img_files)) + imgs = { + '140': img_140_files[:7], + '280': img_280_files[:7] + } + return imgs + @app.route('/') def home(): - try: - latests = redis.pipeline().get('latest_140').get('latest_280').execute() - latest_140, latest_280 = map(lambda x: x.decode(), latests) - ts = utc.localize(datetime.strptime(latest_280, '%Y%m%d_%H%M%S')).astimezone(timezone('Asia/Jerusalem')) - except ConnectionError: - latest_140, latest_280 = 'dev', 'dev' - ts = datetime.now() - return render_template('index.html', ts=ts, latest_140=latest_140, latest_280=latest_280) + return render_template('index.html', imgs=get_imgs()) + @app.after_request def update_images(response): diff --git a/package.json b/package.json new file mode 100644 index 0000000..4964228 --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "geshem", + "version": "0.1.0", + "description": "A rain radar clone running on Mapbox GL", + "main": "geshem.js", + "dependencies": { + "babel-loader": "^6.2.0", + "babel-polyfill": "^6.3.14", + "babel-preset-es2015": "^6.3.13", + "babel-preset-react": "^6.3.13", + "babel-preset-stage-0": "^6.3.13", + "css-loader": "^0.23.1", + "mapbox-gl": "^0.12.2", + "node-sass": "^3.4.2", + "rc-slider": "^3.3.1", + "react": "^0.14.5", + "react-dom": "^0.14.5", + "sass-loader": "^3.1.2", + "script-loader": "^0.6.1", + "style-loader": "^0.13.0" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/yuvadm/geshem.git" + }, + "author": "Yuval Adam", + "license": "ISC", + "bugs": { + "url": "https://github.com/yuvadm/geshem/issues" + }, + "homepage": "https://github.com/yuvadm/geshem#readme" +} diff --git a/static/.keep b/static/img/.keep index e69de29..e69de29 100644 --- a/static/.keep +++ b/static/img/.keep diff --git a/static/js/bundle.js b/static/js/bundle.js new file mode 100644 index 0000000..4c18844 --- /dev/null +++ b/static/js/bundle.js @@ -0,0 +1,31335 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + 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; }; })(); + + __webpack_require__(1); + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _reactDom = __webpack_require__(347); + + var _reactDom2 = _interopRequireDefault(_reactDom); + + __webpack_require__(348); + + var _rcSlider = __webpack_require__(352); + + var _rcSlider2 = _interopRequireDefault(_rcSlider); + + __webpack_require__(408); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + 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; } + + 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; } + + // Need to directly script-load instead of proper import since GL JS doesn't support webpack + // https://github.com/mapbox/mapbox-gl-js/issues/1649 + __webpack_require__(410); + + var GLMap = (function (_React$Component) { + _inherits(GLMap, _React$Component); + + // mapbox auth token + + function GLMap(props) { + _classCallCheck(this, GLMap); + + var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(GLMap).call(this, props)); + + _this.state = { + 'res': '280', + 'slider': 0 + }; + _this.RASTER_COORDS = { + '140': [[33.35317413, 33.27232471], [36.32243686, 33.27232471], [36.32243686, 30.72293428], [33.35317413, 30.72293428]], + '280': [[31.93095218, 34.5156862], [37.86644267, 34.5156862], [37.86644267, 29.42911589], [31.93095218, 29.42911589]] + }; + return _this; + } + + // Adapted from Tim Welch's code that can be found at + // https://github.com/twelch/react-mapbox-gl-seed/blob/4d78eb0/src/components/GLMap.js + + _createClass(GLMap, [{ + key: '_addRadarSource', + value: function _addRadarSource(res, i, url) { + this.map.addSource('radar-' + res + '-' + i, { + "type": "image", + "url": "/static/img/" + url, + "coordinates": this.RASTER_COORDS[res] + }); + } + }, { + key: '_addRadarLayer', + value: function _addRadarLayer(res, i) { + this.map.addLayer({ + "id": 'radar-' + res + '-' + i, + "source": 'radar-' + res + '-' + i, + "type": "raster", + "paint": { + "raster-opacity": 0.85 + } + // "layout": { + // "visibility": "none" + // } + }); + } + }, { + key: '_removeRadarLayer', + value: function _removeRadarLayer(res, i) { + this.map.removeLayer('radar-' + res + '-' + i); + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + var _this2 = this; + + mapboxgl.accessToken = this.props.token; + + this.map = new mapboxgl.Map(this.props.view); + + this.map.on('zoom', function (e) { + if (_this2.map.getZoom() > 7) { + // this.map.setPaintProperty('radar-140-' + this.state.slider, 'raster-opacity', 0.85) + // this.map.setPaintProperty('radar-280-' + this.state.slider, 'raster-opacity', 0) + _this2._removeRadarLayer('280', _this2.state.slider); + _this2._addRadarLayer('140', _this2.state.slider); + _this2.setState({ + 'res': '140', + 'slider': _this2.state.slider + }); + } else { + // this.map.setPaintProperty('radar-140-' + this.state.slider, 'raster-opacity', 0) + // this.map.setPaintProperty('radar-280-' + this.state.slider, 'raster-opacity', 0.85) + _this2._removeRadarLayer('140', _this2.state.slider); + _this2._addRadarLayer('280', _this2.state.slider); + _this2.setState({ + 'res': '280', + 'slider': _this2.state.slider + }); + } + }); + + this.map.on('style.load', function () { + var i = 0; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = window.imgs['140'][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var v = _step.value; + + _this2._addRadarSource('140', i++, v); + // this._addRadarLayer('140', i++) + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + i = 0; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = window.imgs['280'][Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var v = _step2.value; + + _this2._addRadarSource('280', i++, v); + // this._addRadarLayer('280', i++) + } + // this.map.setPaintProperty('radar-280-0', 'raster-opacity', 0.85) + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + _this2._addRadarLayer('280', '0'); + }); + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(props) { + // this.map.setPaintProperty('radar-' + this.state.res + '-' + this.state.slider, 'raster-opacity', 0) + // this.map.setPaintProperty('radar-' + this.state.res + '-' + props.slider, 'raster-opacity', 0.85) + + this._removeRadarLayer(this.state.res, this.state.slider); + this._addRadarLayer(this.state.res, props.slider); + + this.setState({ + 'res': this.state.res, + 'slider': props.slider + }); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.map.remove(); + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement('div', { id: 'map' }); + } + }]); + + return GLMap; + })(_react2.default.Component); + + GLMap.propTypes = { + view: _react2.default.PropTypes.object, // default map view + token: _react2.default.PropTypes.string }; + + var Map = (function (_React$Component2) { + _inherits(Map, _React$Component2); + + function Map(props) { + _classCallCheck(this, Map); + + var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(Map).call(this, props)); + + _this3.onChangeHandler = function (e) { + _this3.setState({ + 'slider': 7 - e + }); + }; + + _this3.state = { + 'slider': 0 + }; + return _this3; + } + + _createClass(Map, [{ + key: 'render', + value: function render() { + var mapStyle = { + "version": 8, + "name": "Dark", + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-streets-v6" + } + }, + "sprite": "mapbox://sprites/mapbox/dark-v8", + "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf", + "layers": [{ + "id": "background", + "type": "background", + "paint": { "background-color": "#111" } + }, { + "id": "boundaries", + "source": "mapbox", + "source-layer": "admin", + "type": "line", + "paint": { "line-color": "#797979" }, + "filter": ["all", ["<=", "admin_level", 2], ['==', 'maritime', 0]] + }, { + "id": "water", + "source": "mapbox", + "source-layer": "water", + "type": "line", + "paint": { "line-color": "#797979" } + }, { + "id": "water2", + "source": "mapbox", + "source-layer": "water", + "type": "fill", + "paint": { "fill-color": "#111122" } + }, { + "id": "cities", + "source": "mapbox", + "source-layer": "place_label", + "type": "symbol", + "filter": ["all", ["<=", "localrank", 6]], + "layout": { + "text-field": "{name_en}", + "text-font": ["DIN Offc Pro Bold", "Arial Unicode MS Bold"], + "text-size": { "stops": [[4, 9], [6, 12]] } + }, + "paint": { + "text-color": "#969696", + "text-halo-width": 2, + "text-halo-color": "rgba(0, 0, 0, 0.85)" + } + }, { + "id": "states", + "source": "mapbox", + "source-layer": "state_label", + "type": "symbol", + "layout": { + "text-transform": "uppercase", + "text-field": "{name_en}", + "text-font": ["DIN Offc Pro Bold", "Arial Unicode MS Bold"], + "text-letter-spacing": 0.15, + "text-max-width": 7, + "text-size": { "stops": [[4, 10], [6, 14]] } + }, + "filter": [">=", "area", 80000], + "paint": { + "text-color": "#969696", + "text-halo-width": 2, + "text-halo-color": "rgba(0, 0, 0, 0.85)" + } + }] + }; + var view = { + container: 'map', + maxZoom: 10, + minZoom: 5, + zoom: 6.3, + center: [35, 31.9], + style: mapStyle, + hash: false + }; + + return _react2.default.createElement( + 'div', + null, + _react2.default.createElement(GLMap, { + view: view, + slider: this.state.slider, + token: 'pk.eyJ1IjoieXV2YWRtIiwiYSI6ImNpaWRuaWFxazAwMTJ2b2tyZGRmaWpsNWYifQ.qf_V3CFP_NZtLjk5luNM4g' }), + _react2.default.createElement(_rcSlider2.default, { step: 1, min: 1, max: 7, defaultValue: 7, tipFormatter: null, onChange: this.onChangeHandler }) + ); + } + }]); + + return Map; + })(_react2.default.Component); + + _reactDom2.default.render(_react2.default.createElement(Map, null), document.getElementById('root')); + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {"use strict"; + + __webpack_require__(2); + + __webpack_require__(189); + + if (global._babelPolyfill) { + throw new Error("only one instance of babel-polyfill is allowed"); + } + global._babelPolyfill = true; + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(3); + __webpack_require__(36); + __webpack_require__(42); + __webpack_require__(44); + __webpack_require__(46); + __webpack_require__(48); + __webpack_require__(50); + __webpack_require__(52); + __webpack_require__(53); + __webpack_require__(54); + __webpack_require__(55); + __webpack_require__(56); + __webpack_require__(57); + __webpack_require__(58); + __webpack_require__(59); + __webpack_require__(60); + __webpack_require__(61); + __webpack_require__(62); + __webpack_require__(63); + __webpack_require__(66); + __webpack_require__(67); + __webpack_require__(68); + __webpack_require__(70); + __webpack_require__(71); + __webpack_require__(72); + __webpack_require__(73); + __webpack_require__(74); + __webpack_require__(75); + __webpack_require__(76); + __webpack_require__(78); + __webpack_require__(79); + __webpack_require__(80); + __webpack_require__(82); + __webpack_require__(83); + __webpack_require__(84); + __webpack_require__(86); + __webpack_require__(87); + __webpack_require__(88); + __webpack_require__(89); + __webpack_require__(90); + __webpack_require__(91); + __webpack_require__(92); + __webpack_require__(93); + __webpack_require__(94); + __webpack_require__(95); + __webpack_require__(96); + __webpack_require__(97); + __webpack_require__(98); + __webpack_require__(99); + __webpack_require__(104); + __webpack_require__(105); + __webpack_require__(109); + __webpack_require__(110); + __webpack_require__(112); + __webpack_require__(113); + __webpack_require__(118); + __webpack_require__(119); + __webpack_require__(122); + __webpack_require__(124); + __webpack_require__(126); + __webpack_require__(128); + __webpack_require__(129); + __webpack_require__(130); + __webpack_require__(132); + __webpack_require__(133); + __webpack_require__(135); + __webpack_require__(136); + __webpack_require__(137); + __webpack_require__(138); + __webpack_require__(145); + __webpack_require__(148); + __webpack_require__(149); + __webpack_require__(151); + __webpack_require__(152); + __webpack_require__(153); + __webpack_require__(154); + __webpack_require__(155); + __webpack_require__(156); + __webpack_require__(157); + __webpack_require__(158); + __webpack_require__(159); + __webpack_require__(160); + __webpack_require__(161); + __webpack_require__(162); + __webpack_require__(164); + __webpack_require__(165); + __webpack_require__(166); + __webpack_require__(167); + __webpack_require__(168); + __webpack_require__(169); + __webpack_require__(171); + __webpack_require__(172); + __webpack_require__(173); + __webpack_require__(174); + __webpack_require__(176); + __webpack_require__(177); + __webpack_require__(179); + __webpack_require__(180); + __webpack_require__(182); + __webpack_require__(183); + __webpack_require__(184); + __webpack_require__(187); + __webpack_require__(188); + module.exports = __webpack_require__(7); + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(4) + , $export = __webpack_require__(5) + , DESCRIPTORS = __webpack_require__(10) + , createDesc = __webpack_require__(9) + , html = __webpack_require__(16) + , cel = __webpack_require__(17) + , has = __webpack_require__(19) + , cof = __webpack_require__(20) + , invoke = __webpack_require__(21) + , fails = __webpack_require__(11) + , anObject = __webpack_require__(22) + , aFunction = __webpack_require__(15) + , isObject = __webpack_require__(18) + , toObject = __webpack_require__(23) + , toIObject = __webpack_require__(25) + , toInteger = __webpack_require__(27) + , toIndex = __webpack_require__(28) + , toLength = __webpack_require__(29) + , IObject = __webpack_require__(26) + , IE_PROTO = __webpack_require__(13)('__proto__') + , createArrayMethod = __webpack_require__(30) + , arrayIndexOf = __webpack_require__(35)(false) + , ObjectProto = Object.prototype + , ArrayProto = Array.prototype + , arraySlice = ArrayProto.slice + , arrayJoin = ArrayProto.join + , defineProperty = $.setDesc + , getOwnDescriptor = $.getDesc + , defineProperties = $.setDescs + , factories = {} + , IE8_DOM_DEFINE; + + if(!DESCRIPTORS){ + IE8_DOM_DEFINE = !fails(function(){ + return defineProperty(cel('div'), 'a', {get: function(){ return 7; }}).a != 7; + }); + $.setDesc = function(O, P, Attributes){ + if(IE8_DOM_DEFINE)try { + return defineProperty(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)anObject(O)[P] = Attributes.value; + return O; + }; + $.getDesc = function(O, P){ + if(IE8_DOM_DEFINE)try { + return getOwnDescriptor(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]); + }; + $.setDescs = defineProperties = function(O, Properties){ + anObject(O); + var keys = $.getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)$.setDesc(O, P = keys[i++], Properties[P]); + return O; + }; + } + $export($export.S + $export.F * !DESCRIPTORS, 'Object', { + // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $.getDesc, + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + defineProperty: $.setDesc, + // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) + defineProperties: defineProperties + }); + + // IE 8- don't enum bug keys + var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' + + 'toLocaleString,toString,valueOf').split(',') + // Additional keys for getOwnPropertyNames + , keys2 = keys1.concat('length', 'prototype') + , keysLen1 = keys1.length; + + // Create object with `null` prototype: use iframe Object with cleared prototype + var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = cel('iframe') + , i = keysLen1 + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write('<script>document.F=Object</script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict.prototype[keys1[i]]; + return createDict(); + }; + var createGetKeys = function(names, length){ + return function(object){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; + }; + }; + var Empty = function(){}; + $export($export.S, 'Object', { + // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + getPrototypeOf: $.getProto = $.getProto || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; + }, + // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $.getNames = $.getNames || createGetKeys(keys2, keys2.length, true), + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + create: $.create = $.create || function(O, /*?*/Properties){ + var result; + if(O !== null){ + Empty.prototype = anObject(O); + result = new Empty(); + Empty.prototype = null; + // add "__proto__" for Object.getPrototypeOf shim + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : defineProperties(result, Properties); + }, + // 19.1.2.14 / 15.2.3.14 Object.keys(O) + keys: $.getKeys = $.getKeys || createGetKeys(keys1, keysLen1, false) + }); + + var construct = function(F, len, args){ + if(!(len in factories)){ + for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']'; + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } + return factories[len](F, args); + }; + + // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) + $export($export.P, 'Function', { + bind: function bind(that /*, args... */){ + var fn = aFunction(this) + , partArgs = arraySlice.call(arguments, 1); + var bound = function(/* args... */){ + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if(isObject(fn.prototype))bound.prototype = fn.prototype; + return bound; + } + }); + + // fallback for not array-like ES3 strings and DOM objects + $export($export.P + $export.F * fails(function(){ + if(html)arraySlice.call(html); + }), 'Array', { + slice: function(begin, end){ + var len = toLength(this.length) + , klass = cof(this); + end = end === undefined ? len : end; + if(klass == 'Array')return arraySlice.call(this, begin, end); + var start = toIndex(begin, len) + , upTo = toIndex(end, len) + , size = toLength(upTo - start) + , cloned = Array(size) + , i = 0; + for(; i < size; i++)cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } + }); + $export($export.P + $export.F * (IObject != Object), 'Array', { + join: function join(separator){ + return arrayJoin.call(IObject(this), separator === undefined ? ',' : separator); + } + }); + + // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) + $export($export.S, 'Array', {isArray: __webpack_require__(32)}); + + var createArrayReduce = function(isRight){ + return function(callbackfn, memo){ + aFunction(callbackfn); + var O = IObject(this) + , length = toLength(O.length) + , index = isRight ? length - 1 : 0 + , i = isRight ? -1 : 1; + if(arguments.length < 2)for(;;){ + if(index in O){ + memo = O[index]; + index += i; + break; + } + index += i; + if(isRight ? index < 0 : length <= index){ + throw TypeError('Reduce of empty array with no initial value'); + } + } + for(;isRight ? index >= 0 : length > index; index += i)if(index in O){ + memo = callbackfn(memo, O[index], index, this); + } + return memo; + }; + }; + + var methodize = function($fn){ + return function(arg1/*, arg2 = undefined */){ + return $fn(this, arg1, arguments[1]); + }; + }; + + $export($export.P, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: $.each = $.each || methodize(createArrayMethod(0)), + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: methodize(createArrayMethod(1)), + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: methodize(createArrayMethod(2)), + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: methodize(createArrayMethod(3)), + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: methodize(createArrayMethod(4)), + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: createArrayReduce(false), + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: createArrayReduce(true), + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: methodize(arrayIndexOf), + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function(el, fromIndex /* = @[*-1] */){ + var O = toIObject(this) + , length = toLength(O.length) + , index = length - 1; + if(arguments.length > 1)index = Math.min(index, toInteger(fromIndex)); + if(index < 0)index = toLength(length + index); + for(;index >= 0; index--)if(index in O)if(O[index] === el)return index; + return -1; + } + }); + + // 20.3.3.1 / 15.9.4.4 Date.now() + $export($export.S, 'Date', {now: function(){ return +new Date; }}); + + var lz = function(num){ + return num > 9 ? num : '0' + num; + }; + + // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() + // PhantomJS / old WebKit has a broken implementations + $export($export.P + $export.F * (fails(function(){ + return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z'; + }) || !fails(function(){ + new Date(NaN).toISOString(); + })), 'Date', { + toISOString: function toISOString(){ + if(!isFinite(this))throw RangeError('Invalid time value'); + var d = this + , y = d.getUTCFullYear() + , m = d.getUTCMilliseconds() + , s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; + } + }); + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + var $Object = Object; + module.exports = { + create: $Object.create, + getProto: $Object.getPrototypeOf, + isEnum: {}.propertyIsEnumerable, + getDesc: $Object.getOwnPropertyDescriptor, + setDesc: $Object.defineProperty, + setDescs: $Object.defineProperties, + getKeys: $Object.keys, + getNames: $Object.getOwnPropertyNames, + getSymbols: $Object.getOwnPropertySymbols, + each: [].forEach + }; + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(6) + , core = __webpack_require__(7) + , hide = __webpack_require__(8) + , redefine = __webpack_require__(12) + , ctx = __webpack_require__(14) + , PROTOTYPE = 'prototype'; + + var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE] + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}) + , key, own, out, exp; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && key in target; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if(target && !own)redefine(target, key, out); + // export + if(exports[key] != out)hide(exports, key, exp); + if(IS_PROTO && expProto[key] != out)expProto[key] = out; + } + }; + global.core = core; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + module.exports = $export; + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); + if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef + +/***/ }, +/* 7 */ +/***/ function(module, exports) { + + var core = module.exports = {version: '1.2.6'}; + if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + var $ = __webpack_require__(4) + , createDesc = __webpack_require__(9); + module.exports = __webpack_require__(10) ? function(object, key, value){ + return $.setDesc(object, key, createDesc(1, value)); + } : function(object, key, value){ + object[key] = value; + return object; + }; + +/***/ }, +/* 9 */ +/***/ function(module, exports) { + + module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; + }; + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + // Thank's IE8 for his funny defineProperty + module.exports = !__webpack_require__(11)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; + }); + +/***/ }, +/* 11 */ +/***/ function(module, exports) { + + module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } + }; + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + // add fake Function#toString + // for correct work wrapped methods / constructors with methods like LoDash isNative + var global = __webpack_require__(6) + , hide = __webpack_require__(8) + , SRC = __webpack_require__(13)('src') + , TO_STRING = 'toString' + , $toString = Function[TO_STRING] + , TPL = ('' + $toString).split(TO_STRING); + + __webpack_require__(7).inspectSource = function(it){ + return $toString.call(it); + }; + + (module.exports = function(O, key, val, safe){ + if(typeof val == 'function'){ + val.hasOwnProperty(SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + val.hasOwnProperty('name') || hide(val, 'name', key); + } + if(O === global){ + O[key] = val; + } else { + if(!safe)delete O[key]; + hide(O, key, val); + } + })(Function.prototype, TO_STRING, function toString(){ + return typeof this == 'function' && this[SRC] || $toString.call(this); + }); + +/***/ }, +/* 13 */ +/***/ function(module, exports) { + + var id = 0 + , px = Math.random(); + module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + // optional / simple context binding + var aFunction = __webpack_require__(15); + module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; + }; + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; + }; + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(6).document && document.documentElement; + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(18) + , document = __webpack_require__(6).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); + module.exports = function(it){ + return is ? document.createElement(it) : {}; + }; + +/***/ }, +/* 18 */ +/***/ function(module, exports) { + + module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + +/***/ }, +/* 19 */ +/***/ function(module, exports) { + + var hasOwnProperty = {}.hasOwnProperty; + module.exports = function(it, key){ + return hasOwnProperty.call(it, key); + }; + +/***/ }, +/* 20 */ +/***/ function(module, exports) { + + var toString = {}.toString; + + module.exports = function(it){ + return toString.call(it).slice(8, -1); + }; + +/***/ }, +/* 21 */ +/***/ function(module, exports) { + + // fast apply, http://jsperf.lnkit.com/fast-apply/5 + module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); + }; + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(18); + module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; + }; + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.13 ToObject(argument) + var defined = __webpack_require__(24); + module.exports = function(it){ + return Object(defined(it)); + }; + +/***/ }, +/* 24 */ +/***/ function(module, exports) { + + // 7.2.1 RequireObjectCoercible(argument) + module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; + }; + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + // to indexed object, toObject with fallback for non-array-like ES3 strings + var IObject = __webpack_require__(26) + , defined = __webpack_require__(24); + module.exports = function(it){ + return IObject(defined(it)); + }; + +/***/ }, +/* 26 */ +/***/ function(module, exports, __webpack_require__) { + + // fallback for non-array-like ES3 and non-enumerable old V8 strings + var cof = __webpack_require__(20); + module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); + }; + +/***/ }, +/* 27 */ +/***/ function(module, exports) { + + // 7.1.4 ToInteger + var ceil = Math.ceil + , floor = Math.floor; + module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + var toInteger = __webpack_require__(27) + , max = Math.max + , min = Math.min; + module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); + }; + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.15 ToLength + var toInteger = __webpack_require__(27) + , min = Math.min; + module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 + }; + +/***/ }, +/* 30 */ +/***/ function(module, exports, __webpack_require__) { + + // 0 -> Array#forEach + // 1 -> Array#map + // 2 -> Array#filter + // 3 -> Array#some + // 4 -> Array#every + // 5 -> Array#find + // 6 -> Array#findIndex + var ctx = __webpack_require__(14) + , IObject = __webpack_require__(26) + , toObject = __webpack_require__(23) + , toLength = __webpack_require__(29) + , asc = __webpack_require__(31); + module.exports = function(TYPE){ + var IS_MAP = TYPE == 1 + , IS_FILTER = TYPE == 2 + , IS_SOME = TYPE == 3 + , IS_EVERY = TYPE == 4 + , IS_FIND_INDEX = TYPE == 6 + , NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + return function($this, callbackfn, that){ + var O = toObject($this) + , self = IObject(O) + , f = ctx(callbackfn, that, 3) + , length = toLength(self.length) + , index = 0 + , result = IS_MAP ? asc($this, length) : IS_FILTER ? asc($this, 0) : undefined + , val, res; + for(;length > index; index++)if(NO_HOLES || index in self){ + val = self[index]; + res = f(val, index, O); + if(TYPE){ + if(IS_MAP)result[index] = res; // map + else if(res)switch(TYPE){ + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if(IS_EVERY)return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; + }; + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + // 9.4.2.3 ArraySpeciesCreate(originalArray, length) + var isObject = __webpack_require__(18) + , isArray = __webpack_require__(32) + , SPECIES = __webpack_require__(33)('species'); + module.exports = function(original, length){ + var C; + if(isArray(original)){ + C = original.constructor; + // cross-realm fallback + if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; + if(isObject(C)){ + C = C[SPECIES]; + if(C === null)C = undefined; + } + } return new (C === undefined ? Array : C)(length); + }; + +/***/ }, +/* 32 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.2.2 IsArray(argument) + var cof = __webpack_require__(20); + module.exports = Array.isArray || function(arg){ + return cof(arg) == 'Array'; + }; + +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { + + var store = __webpack_require__(34)('wks') + , uid = __webpack_require__(13) + , Symbol = __webpack_require__(6).Symbol; + module.exports = function(name){ + return store[name] || (store[name] = + Symbol && Symbol[name] || (Symbol || uid)('Symbol.' + name)); + }; + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(6) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); + module.exports = function(key){ + return store[key] || (store[key] = {}); + }; + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + // false -> Array#indexOf + // true -> Array#includes + var toIObject = __webpack_require__(25) + , toLength = __webpack_require__(29) + , toIndex = __webpack_require__(28); + module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index; + } return !IS_INCLUDES && -1; + }; + }; + +/***/ }, +/* 36 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // ECMAScript 6 symbols shim + var $ = __webpack_require__(4) + , global = __webpack_require__(6) + , has = __webpack_require__(19) + , DESCRIPTORS = __webpack_require__(10) + , $export = __webpack_require__(5) + , redefine = __webpack_require__(12) + , $fails = __webpack_require__(11) + , shared = __webpack_require__(34) + , setToStringTag = __webpack_require__(37) + , uid = __webpack_require__(13) + , wks = __webpack_require__(33) + , keyOf = __webpack_require__(38) + , $names = __webpack_require__(39) + , enumKeys = __webpack_require__(40) + , isArray = __webpack_require__(32) + , anObject = __webpack_require__(22) + , toIObject = __webpack_require__(25) + , createDesc = __webpack_require__(9) + , getDesc = $.getDesc + , setDesc = $.setDesc + , _create = $.create + , getNames = $names.get + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , setter = false + , HIDDEN = wks('_hidden') + , isEnum = $.isEnum + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , useNative = typeof $Symbol == 'function' + , ObjectProto = Object.prototype; + + // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(setDesc({}, 'a', { + get: function(){ return setDesc(this, 'a', {value: 7}).a; } + })).a != 7; + }) ? function(it, key, D){ + var protoDesc = getDesc(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + setDesc(it, key, D); + if(protoDesc && it !== ObjectProto)setDesc(ObjectProto, key, protoDesc); + } : setDesc; + + var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol.prototype); + sym._k = tag; + DESCRIPTORS && setter && setSymbolDesc(ObjectProto, tag, { + configurable: true, + set: function(value){ + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + } + }); + return sym; + }; + + var isSymbol = function(it){ + return typeof it == 'symbol'; + }; + + var $defineProperty = function defineProperty(it, key, D){ + if(D && has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))setDesc(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return setDesc(it, key, D); + }; + var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; + }; + var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); + }; + var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key); + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] + ? E : true; + }; + var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + var D = getDesc(it = toIObject(it), key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; + }; + var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = getNames(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i)if(!has(AllSymbols, key = names[i++]) && key != HIDDEN)result.push(key); + return result; + }; + var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var names = getNames(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i)if(has(AllSymbols, key = names[i++]))result.push(AllSymbols[key]); + return result; + }; + var $stringify = function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , $$ = arguments + , replacer, $replacer; + while($$.length > i)args.push($$[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + }; + var buggyJSON = $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; + }); + + // 19.4.1.1 Symbol([description]) + if(!useNative){ + $Symbol = function Symbol(){ + if(isSymbol(this))throw TypeError('Symbol is not a constructor'); + return wrap(uid(arguments.length > 0 ? arguments[0] : undefined)); + }; + redefine($Symbol.prototype, 'toString', function toString(){ + return this._k; + }); + + isSymbol = function(it){ + return it instanceof $Symbol; + }; + + $.create = $create; + $.isEnum = $propertyIsEnumerable; + $.getDesc = $getOwnPropertyDescriptor; + $.setDesc = $defineProperty; + $.setDescs = $defineProperties; + $.getNames = $names.get = $getOwnPropertyNames; + $.getSymbols = $getOwnPropertySymbols; + + if(DESCRIPTORS && !__webpack_require__(41)){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + } + + var symbolStatics = { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + return keyOf(SymbolRegistry, key); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } + }; + // 19.4.2.2 Symbol.hasInstance + // 19.4.2.3 Symbol.isConcatSpreadable + // 19.4.2.4 Symbol.iterator + // 19.4.2.6 Symbol.match + // 19.4.2.8 Symbol.replace + // 19.4.2.9 Symbol.search + // 19.4.2.10 Symbol.species + // 19.4.2.11 Symbol.split + // 19.4.2.12 Symbol.toPrimitive + // 19.4.2.13 Symbol.toStringTag + // 19.4.2.14 Symbol.unscopables + $.each.call(( + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,' + + 'species,split,toPrimitive,toStringTag,unscopables' + ).split(','), function(it){ + var sym = wks(it); + symbolStatics[it] = useNative ? sym : wrap(sym); + }); + + setter = true; + + $export($export.G + $export.W, {Symbol: $Symbol}); + + $export($export.S, 'Symbol', symbolStatics); + + $export($export.S + $export.F * !useNative, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols + }); + + // 24.3.2 JSON.stringify(value [, replacer [, space]]) + $JSON && $export($export.S + $export.F * (!useNative || buggyJSON), 'JSON', {stringify: $stringify}); + + // 19.4.3.5 Symbol.prototype[@@toStringTag] + setToStringTag($Symbol, 'Symbol'); + // 20.2.1.9 Math[@@toStringTag] + setToStringTag(Math, 'Math', true); + // 24.3.3 JSON[@@toStringTag] + setToStringTag(global.JSON, 'JSON', true); + +/***/ }, +/* 37 */ +/***/ function(module, exports, __webpack_require__) { + + var def = __webpack_require__(4).setDesc + , has = __webpack_require__(19) + , TAG = __webpack_require__(33)('toStringTag'); + + module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); + }; + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + var $ = __webpack_require__(4) + , toIObject = __webpack_require__(25); + module.exports = function(object, el){ + var O = toIObject(object) + , keys = $.getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; + }; + +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { + + // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + var toIObject = __webpack_require__(25) + , getNames = __webpack_require__(4).getNames + , toString = {}.toString; + + var windowNames = typeof window == 'object' && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + + var getWindowNames = function(it){ + try { + return getNames(it); + } catch(e){ + return windowNames.slice(); + } + }; + + module.exports.get = function getOwnPropertyNames(it){ + if(windowNames && toString.call(it) == '[object Window]')return getWindowNames(it); + return getNames(toIObject(it)); + }; + +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { + + // all enumerable object keys, includes symbols + var $ = __webpack_require__(4); + module.exports = function(it){ + var keys = $.getKeys(it) + , getSymbols = $.getSymbols; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = $.isEnum + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))keys.push(key); + } + return keys; + }; + +/***/ }, +/* 41 */ +/***/ function(module, exports) { + + module.exports = false; + +/***/ }, +/* 42 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.1 Object.assign(target, source) + var $export = __webpack_require__(5); + + $export($export.S + $export.F, 'Object', {assign: __webpack_require__(43)}); + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.1 Object.assign(target, source, ...) + var $ = __webpack_require__(4) + , toObject = __webpack_require__(23) + , IObject = __webpack_require__(26); + + // should work with symbols and should have deterministic property order (V8 bug) + module.exports = __webpack_require__(11)(function(){ + var a = Object.assign + , A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return a({}, A)[S] != 7 || Object.keys(a({}, B)).join('') != K; + }) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , $$ = arguments + , $$len = $$.length + , index = 1 + , getKeys = $.getKeys + , getSymbols = $.getSymbols + , isEnum = $.isEnum; + while($$len > index){ + var S = IObject($$[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } + return T; + } : Object.assign; + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.10 Object.is(value1, value2) + var $export = __webpack_require__(5); + $export($export.S, 'Object', {is: __webpack_require__(45)}); + +/***/ }, +/* 45 */ +/***/ function(module, exports) { + + // 7.2.9 SameValue(x, y) + module.exports = Object.is || function is(x, y){ + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; + }; + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.19 Object.setPrototypeOf(O, proto) + var $export = __webpack_require__(5); + $export($export.S, 'Object', {setPrototypeOf: __webpack_require__(47).set}); + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + var getDesc = __webpack_require__(4).getDesc + , isObject = __webpack_require__(18) + , anObject = __webpack_require__(22); + var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); + }; + module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = __webpack_require__(14)(Function.call, getDesc(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check + }; + +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 19.1.3.6 Object.prototype.toString() + var classof = __webpack_require__(49) + , test = {}; + test[__webpack_require__(33)('toStringTag')] = 'z'; + if(test + '' != '[object z]'){ + __webpack_require__(12)(Object.prototype, 'toString', function toString(){ + return '[object ' + classof(this) + ']'; + }, true); + } + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + // getting tag from 19.1.3.6 Object.prototype.toString() + var cof = __webpack_require__(20) + , TAG = __webpack_require__(33)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + + module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = (O = Object(it))[TAG]) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; + }; + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.5 Object.freeze(O) + var isObject = __webpack_require__(18); + + __webpack_require__(51)('freeze', function($freeze){ + return function freeze(it){ + return $freeze && isObject(it) ? $freeze(it) : it; + }; + }); + +/***/ }, +/* 51 */ +/***/ function(module, exports, __webpack_require__) { + + // most Object methods by ES6 should accept primitives + var $export = __webpack_require__(5) + , core = __webpack_require__(7) + , fails = __webpack_require__(11); + module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); + }; + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.17 Object.seal(O) + var isObject = __webpack_require__(18); + + __webpack_require__(51)('seal', function($seal){ + return function seal(it){ + return $seal && isObject(it) ? $seal(it) : it; + }; + }); + +/***/ }, +/* 53 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.15 Object.preventExtensions(O) + var isObject = __webpack_require__(18); + + __webpack_require__(51)('preventExtensions', function($preventExtensions){ + return function preventExtensions(it){ + return $preventExtensions && isObject(it) ? $preventExtensions(it) : it; + }; + }); + +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.12 Object.isFrozen(O) + var isObject = __webpack_require__(18); + + __webpack_require__(51)('isFrozen', function($isFrozen){ + return function isFrozen(it){ + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; + }); + +/***/ }, +/* 55 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.13 Object.isSealed(O) + var isObject = __webpack_require__(18); + + __webpack_require__(51)('isSealed', function($isSealed){ + return function isSealed(it){ + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; + }); + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.11 Object.isExtensible(O) + var isObject = __webpack_require__(18); + + __webpack_require__(51)('isExtensible', function($isExtensible){ + return function isExtensible(it){ + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; + }); + +/***/ }, +/* 57 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + var toIObject = __webpack_require__(25); + + __webpack_require__(51)('getOwnPropertyDescriptor', function($getOwnPropertyDescriptor){ + return function getOwnPropertyDescriptor(it, key){ + return $getOwnPropertyDescriptor(toIObject(it), key); + }; + }); + +/***/ }, +/* 58 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.9 Object.getPrototypeOf(O) + var toObject = __webpack_require__(23); + + __webpack_require__(51)('getPrototypeOf', function($getPrototypeOf){ + return function getPrototypeOf(it){ + return $getPrototypeOf(toObject(it)); + }; + }); + +/***/ }, +/* 59 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.14 Object.keys(O) + var toObject = __webpack_require__(23); + + __webpack_require__(51)('keys', function($keys){ + return function keys(it){ + return $keys(toObject(it)); + }; + }); + +/***/ }, +/* 60 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.7 Object.getOwnPropertyNames(O) + __webpack_require__(51)('getOwnPropertyNames', function(){ + return __webpack_require__(39).get; + }); + +/***/ }, +/* 61 */ +/***/ function(module, exports, __webpack_require__) { + + var setDesc = __webpack_require__(4).setDesc + , createDesc = __webpack_require__(9) + , has = __webpack_require__(19) + , FProto = Function.prototype + , nameRE = /^\s*function ([^ (]*)/ + , NAME = 'name'; + // 19.2.4.2 name + NAME in FProto || __webpack_require__(10) && setDesc(FProto, NAME, { + configurable: true, + get: function(){ + var match = ('' + this).match(nameRE) + , name = match ? match[1] : ''; + has(this, NAME) || setDesc(this, NAME, createDesc(5, name)); + return name; + } + }); + +/***/ }, +/* 62 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(4) + , isObject = __webpack_require__(18) + , HAS_INSTANCE = __webpack_require__(33)('hasInstance') + , FunctionProto = Function.prototype; + // 19.2.3.6 Function.prototype[@@hasInstance](V) + if(!(HAS_INSTANCE in FunctionProto))$.setDesc(FunctionProto, HAS_INSTANCE, {value: function(O){ + if(typeof this != 'function' || !isObject(O))return false; + if(!isObject(this.prototype))return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while(O = $.getProto(O))if(this.prototype === O)return true; + return false; + }}); + +/***/ }, +/* 63 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(4) + , global = __webpack_require__(6) + , has = __webpack_require__(19) + , cof = __webpack_require__(20) + , toPrimitive = __webpack_require__(64) + , fails = __webpack_require__(11) + , $trim = __webpack_require__(65).trim + , NUMBER = 'Number' + , $Number = global[NUMBER] + , Base = $Number + , proto = $Number.prototype + // Opera ~12 has broken Object#toString + , BROKEN_COF = cof($.create(proto)) == NUMBER + , TRIM = 'trim' in String.prototype; + + // 7.1.3 ToNumber(argument) + var toNumber = function(argument){ + var it = toPrimitive(argument, false); + if(typeof it == 'string' && it.length > 2){ + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0) + , third, radix, maxCode; + if(first === 43 || first === 45){ + third = it.charCodeAt(2); + if(third === 88 || third === 120)return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if(first === 48){ + switch(it.charCodeAt(1)){ + case 66 : case 98 : radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79 : case 111 : radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default : return +it; + } + for(var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++){ + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if(code < 48 || code > maxCode)return NaN; + } return parseInt(digits, radix); + } + } return +it; + }; + + if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){ + $Number = function Number(value){ + var it = arguments.length < 1 ? 0 : value + , that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function(){ proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? new Base(toNumber(it)) : toNumber(it); + }; + $.each.call(__webpack_require__(10) ? $.getNames(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), function(key){ + if(has(Base, key) && !has($Number, key)){ + $.setDesc($Number, key, $.getDesc(Base, key)); + } + }); + $Number.prototype = proto; + proto.constructor = $Number; + __webpack_require__(12)(global, NUMBER, $Number); + } + +/***/ }, +/* 64 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.1 ToPrimitive(input [, PreferredType])
+ var isObject = __webpack_require__(18);
+ // instead of the ES6 spec version, we didn't implement @@toPrimitive case
+ // and the second argument - flag - preferred type is a string
+ module.exports = function(it, S){
+ if(!isObject(it))return it;
+ var fn, val;
+ if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
+ if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
+ if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
+ throw TypeError("Can't convert object to primitive value");
+ }; + +/***/ }, +/* 65 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(5) + , defined = __webpack_require__(24) + , fails = __webpack_require__(11) + , spaces = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF' + , space = '[' + spaces + ']' + , non = '\u200b\u0085' + , ltrim = RegExp('^' + space + space + '*') + , rtrim = RegExp(space + space + '*$'); + + var exporter = function(KEY, exec){ + var exp = {}; + exp[KEY] = exec(trim); + $export($export.P + $export.F * fails(function(){ + return !!spaces[KEY]() || non[KEY]() != non; + }), 'String', exp); + }; + + // 1 -> String#trimLeft + // 2 -> String#trimRight + // 3 -> String#trim + var trim = exporter.trim = function(string, TYPE){ + string = String(defined(string)); + if(TYPE & 1)string = string.replace(ltrim, ''); + if(TYPE & 2)string = string.replace(rtrim, ''); + return string; + }; + + module.exports = exporter; + +/***/ }, +/* 66 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.1 Number.EPSILON + var $export = __webpack_require__(5); + + $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); + +/***/ }, +/* 67 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.2 Number.isFinite(number) + var $export = __webpack_require__(5) + , _isFinite = __webpack_require__(6).isFinite; + + $export($export.S, 'Number', { + isFinite: function isFinite(it){ + return typeof it == 'number' && _isFinite(it); + } + }); + +/***/ }, +/* 68 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.3 Number.isInteger(number) + var $export = __webpack_require__(5); + + $export($export.S, 'Number', {isInteger: __webpack_require__(69)}); + +/***/ }, +/* 69 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.3 Number.isInteger(number) + var isObject = __webpack_require__(18) + , floor = Math.floor; + module.exports = function isInteger(it){ + return !isObject(it) && isFinite(it) && floor(it) === it; + }; + +/***/ }, +/* 70 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.4 Number.isNaN(number) + var $export = __webpack_require__(5); + + $export($export.S, 'Number', { + isNaN: function isNaN(number){ + return number != number; + } + }); + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.5 Number.isSafeInteger(number) + var $export = __webpack_require__(5) + , isInteger = __webpack_require__(69) + , abs = Math.abs; + + $export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number){ + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } + }); + +/***/ }, +/* 72 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.6 Number.MAX_SAFE_INTEGER + var $export = __webpack_require__(5); + + $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); + +/***/ }, +/* 73 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.10 Number.MIN_SAFE_INTEGER + var $export = __webpack_require__(5); + + $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); + +/***/ }, +/* 74 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.12 Number.parseFloat(string) + var $export = __webpack_require__(5); + + $export($export.S, 'Number', {parseFloat: parseFloat}); + +/***/ }, +/* 75 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.13 Number.parseInt(string, radix) + var $export = __webpack_require__(5); + + $export($export.S, 'Number', {parseInt: parseInt}); + +/***/ }, +/* 76 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.3 Math.acosh(x) + var $export = __webpack_require__(5) + , log1p = __webpack_require__(77) + , sqrt = Math.sqrt + , $acosh = Math.acosh; + + // V8 bug https://code.google.com/p/v8/issues/detail?id=3509 + $export($export.S + $export.F * !($acosh && Math.floor($acosh(Number.MAX_VALUE)) == 710), 'Math', { + acosh: function acosh(x){ + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } + }); + +/***/ }, +/* 77 */ +/***/ function(module, exports) { + + // 20.2.2.20 Math.log1p(x) + module.exports = Math.log1p || function log1p(x){ + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); + }; + +/***/ }, +/* 78 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.5 Math.asinh(x) + var $export = __webpack_require__(5); + + function asinh(x){ + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); + } + + $export($export.S, 'Math', {asinh: asinh}); + +/***/ }, +/* 79 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.7 Math.atanh(x) + var $export = __webpack_require__(5); + + $export($export.S, 'Math', { + atanh: function atanh(x){ + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } + }); + +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.9 Math.cbrt(x) + var $export = __webpack_require__(5) + , sign = __webpack_require__(81); + + $export($export.S, 'Math', { + cbrt: function cbrt(x){ + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } + }); + +/***/ }, +/* 81 */ +/***/ function(module, exports) { + + // 20.2.2.28 Math.sign(x) + module.exports = Math.sign || function sign(x){ + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; + }; + +/***/ }, +/* 82 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.11 Math.clz32(x) + var $export = __webpack_require__(5); + + $export($export.S, 'Math', { + clz32: function clz32(x){ + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } + }); + +/***/ }, +/* 83 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.12 Math.cosh(x) + var $export = __webpack_require__(5) + , exp = Math.exp; + + $export($export.S, 'Math', { + cosh: function cosh(x){ + return (exp(x = +x) + exp(-x)) / 2; + } + }); + +/***/ }, +/* 84 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.14 Math.expm1(x) + var $export = __webpack_require__(5); + + $export($export.S, 'Math', {expm1: __webpack_require__(85)}); + +/***/ }, +/* 85 */ +/***/ function(module, exports) { + + // 20.2.2.14 Math.expm1(x) + module.exports = Math.expm1 || function expm1(x){ + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; + }; + +/***/ }, +/* 86 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.16 Math.fround(x) + var $export = __webpack_require__(5) + , sign = __webpack_require__(81) + , pow = Math.pow + , EPSILON = pow(2, -52) + , EPSILON32 = pow(2, -23) + , MAX32 = pow(2, 127) * (2 - EPSILON32) + , MIN32 = pow(2, -126); + + var roundTiesToEven = function(n){ + return n + 1 / EPSILON - 1 / EPSILON; + }; + + + $export($export.S, 'Math', { + fround: function fround(x){ + var $abs = Math.abs(x) + , $sign = sign(x) + , a, result; + if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + if(result > MAX32 || result != result)return $sign * Infinity; + return $sign * result; + } + }); + +/***/ }, +/* 87 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) + var $export = __webpack_require__(5) + , abs = Math.abs; + + $export($export.S, 'Math', { + hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars + var sum = 0 + , i = 0 + , $$ = arguments + , $$len = $$.length + , larg = 0 + , arg, div; + while(i < $$len){ + arg = abs($$[i++]); + if(larg < arg){ + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if(arg > 0){ + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } + }); + +/***/ }, +/* 88 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.18 Math.imul(x, y) + var $export = __webpack_require__(5) + , $imul = Math.imul; + + // some WebKit versions fails with big numbers, some has wrong arity + $export($export.S + $export.F * __webpack_require__(11)(function(){ + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; + }), 'Math', { + imul: function imul(x, y){ + var UINT16 = 0xffff + , xn = +x + , yn = +y + , xl = UINT16 & xn + , yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } + }); + +/***/ }, +/* 89 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.21 Math.log10(x) + var $export = __webpack_require__(5); + + $export($export.S, 'Math', { + log10: function log10(x){ + return Math.log(x) / Math.LN10; + } + }); + +/***/ }, +/* 90 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.20 Math.log1p(x) + var $export = __webpack_require__(5); + + $export($export.S, 'Math', {log1p: __webpack_require__(77)}); + +/***/ }, +/* 91 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.22 Math.log2(x) + var $export = __webpack_require__(5); + + $export($export.S, 'Math', { + log2: function log2(x){ + return Math.log(x) / Math.LN2; + } + }); + +/***/ }, +/* 92 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.28 Math.sign(x) + var $export = __webpack_require__(5); + + $export($export.S, 'Math', {sign: __webpack_require__(81)}); + +/***/ }, +/* 93 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.30 Math.sinh(x) + var $export = __webpack_require__(5) + , expm1 = __webpack_require__(85) + , exp = Math.exp; + + // V8 near Chromium 38 has a problem with very small numbers + $export($export.S + $export.F * __webpack_require__(11)(function(){ + return !Math.sinh(-2e-17) != -2e-17; + }), 'Math', { + sinh: function sinh(x){ + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } + }); + +/***/ }, +/* 94 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.33 Math.tanh(x) + var $export = __webpack_require__(5) + , expm1 = __webpack_require__(85) + , exp = Math.exp; + + $export($export.S, 'Math', { + tanh: function tanh(x){ + var a = expm1(x = +x) + , b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } + }); + +/***/ }, +/* 95 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.34 Math.trunc(x) + var $export = __webpack_require__(5); + + $export($export.S, 'Math', { + trunc: function trunc(it){ + return (it > 0 ? Math.floor : Math.ceil)(it); + } + }); + +/***/ }, +/* 96 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(5) + , toIndex = __webpack_require__(28) + , fromCharCode = String.fromCharCode + , $fromCodePoint = String.fromCodePoint; + + // length should be 1, old FF problem + $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars + var res = [] + , $$ = arguments + , $$len = $$.length + , i = 0 + , code; + while($$len > i){ + code = +$$[i++]; + if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } + }); + +/***/ }, +/* 97 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(5) + , toIObject = __webpack_require__(25) + , toLength = __webpack_require__(29); + + $export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite){ + var tpl = toIObject(callSite.raw) + , len = toLength(tpl.length) + , $$ = arguments + , $$len = $$.length + , res = [] + , i = 0; + while(len > i){ + res.push(String(tpl[i++])); + if(i < $$len)res.push(String($$[i])); + } return res.join(''); + } + }); + +/***/ }, +/* 98 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 21.1.3.25 String.prototype.trim() + __webpack_require__(65)('trim', function($trim){ + return function trim(){ + return $trim(this, 3); + }; + }); + +/***/ }, +/* 99 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $at = __webpack_require__(100)(true); + + // 21.1.3.27 String.prototype[@@iterator]() + __webpack_require__(101)(String, 'String', function(iterated){ + this._t = String(iterated); // target + this._i = 0; // next index + // 21.1.5.2.1 %StringIteratorPrototype%.next() + }, function(){ + var O = this._t + , index = this._i + , point; + if(index >= O.length)return {value: undefined, done: true}; + point = $at(O, index); + this._i += point.length; + return {value: point, done: false}; + }); + +/***/ }, +/* 100 */ +/***/ function(module, exports, __webpack_require__) { + + var toInteger = __webpack_require__(27) + , defined = __webpack_require__(24); + // true -> String#at + // false -> String#codePointAt + module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; + +/***/ }, +/* 101 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var LIBRARY = __webpack_require__(41) + , $export = __webpack_require__(5) + , redefine = __webpack_require__(12) + , hide = __webpack_require__(8) + , has = __webpack_require__(19) + , Iterators = __webpack_require__(102) + , $iterCreate = __webpack_require__(103) + , setToStringTag = __webpack_require__(37) + , getProto = __webpack_require__(4).getProto + , ITERATOR = __webpack_require__(33)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + + var returnThis = function(){ return this; }; + + module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , methods, key; + // Fix native + if($native){ + var IteratorPrototype = getProto($default.call(new Base)); + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // FF fix + if(!LIBRARY && has(proto, FF_ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: !DEF_VALUES ? $default : getMethod('entries') + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; + }; + +/***/ }, +/* 102 */ +/***/ function(module, exports) { + + module.exports = {}; + +/***/ }, +/* 103 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(4) + , descriptor = __webpack_require__(9) + , setToStringTag = __webpack_require__(37) + , IteratorPrototype = {}; + + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + __webpack_require__(8)(IteratorPrototype, __webpack_require__(33)('iterator'), function(){ return this; }); + + module.exports = function(Constructor, NAME, next){ + Constructor.prototype = $.create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); + }; + +/***/ }, +/* 104 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(5) + , $at = __webpack_require__(100)(false); + $export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos){ + return $at(this, pos); + } + }); + +/***/ }, +/* 105 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) + 'use strict'; + var $export = __webpack_require__(5) + , toLength = __webpack_require__(29) + , context = __webpack_require__(106) + , ENDS_WITH = 'endsWith' + , $endsWith = ''[ENDS_WITH]; + + $export($export.P + $export.F * __webpack_require__(108)(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /*, endPosition = @length */){ + var that = context(this, searchString, ENDS_WITH) + , $$ = arguments + , endPosition = $$.length > 1 ? $$[1] : undefined + , len = toLength(that.length) + , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len) + , search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } + }); + +/***/ }, +/* 106 */ +/***/ function(module, exports, __webpack_require__) { + + // helper for String#{startsWith, endsWith, includes} + var isRegExp = __webpack_require__(107) + , defined = __webpack_require__(24); + + module.exports = function(that, searchString, NAME){ + if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); + }; + +/***/ }, +/* 107 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.2.8 IsRegExp(argument) + var isObject = __webpack_require__(18) + , cof = __webpack_require__(20) + , MATCH = __webpack_require__(33)('match'); + module.exports = function(it){ + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); + }; + +/***/ }, +/* 108 */ +/***/ function(module, exports, __webpack_require__) { + + var MATCH = __webpack_require__(33)('match'); + module.exports = function(KEY){ + var re = /./; + try { + '/./'[KEY](re); + } catch(e){ + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch(f){ /* empty */ } + } return true; + }; + +/***/ }, +/* 109 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.7 String.prototype.includes(searchString, position = 0) + 'use strict'; + var $export = __webpack_require__(5) + , context = __webpack_require__(106) + , INCLUDES = 'includes'; + + $export($export.P + $export.F * __webpack_require__(108)(INCLUDES), 'String', { + includes: function includes(searchString /*, position = 0 */){ + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } + }); + +/***/ }, +/* 110 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(5); + + $export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __webpack_require__(111) + }); + +/***/ }, +/* 111 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var toInteger = __webpack_require__(27) + , defined = __webpack_require__(24); + + module.exports = function repeat(count){ + var str = String(defined(this)) + , res = '' + , n = toInteger(count); + if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); + for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; + return res; + }; + +/***/ }, +/* 112 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) + 'use strict'; + var $export = __webpack_require__(5) + , toLength = __webpack_require__(29) + , context = __webpack_require__(106) + , STARTS_WITH = 'startsWith' + , $startsWith = ''[STARTS_WITH]; + + $export($export.P + $export.F * __webpack_require__(108)(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /*, position = 0 */){ + var that = context(this, searchString, STARTS_WITH) + , $$ = arguments + , index = toLength(Math.min($$.length > 1 ? $$[1] : undefined, that.length)) + , search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } + }); + +/***/ }, +/* 113 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var ctx = __webpack_require__(14) + , $export = __webpack_require__(5) + , toObject = __webpack_require__(23) + , call = __webpack_require__(114) + , isArrayIter = __webpack_require__(115) + , toLength = __webpack_require__(29) + , getIterFn = __webpack_require__(116); + $export($export.S + $export.F * !__webpack_require__(117)(function(iter){ Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ + var O = toObject(arrayLike) + , C = typeof this == 'function' ? this : Array + , $$ = arguments + , $$len = $$.length + , mapfn = $$len > 1 ? $$[1] : undefined + , mapping = mapfn !== undefined + , index = 0 + , iterFn = getIterFn(O) + , length, result, step, iterator; + if(mapping)mapfn = ctx(mapfn, $$len > 2 ? $$[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ + for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ + result[index] = mapping ? call(iterator, mapfn, [step.value, index], true) : step.value; + } + } else { + length = toLength(O.length); + for(result = new C(length); length > index; index++){ + result[index] = mapping ? mapfn(O[index], index) : O[index]; + } + } + result.length = index; + return result; + } + }); + + +/***/ }, +/* 114 */ +/***/ function(module, exports, __webpack_require__) { + + // call something on iterator step with safe closing on error + var anObject = __webpack_require__(22); + module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } + }; + +/***/ }, +/* 115 */ +/***/ function(module, exports, __webpack_require__) { + + // check on default Array iterator + var Iterators = __webpack_require__(102) + , ITERATOR = __webpack_require__(33)('iterator') + , ArrayProto = Array.prototype; + + module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); + }; + +/***/ }, +/* 116 */ +/***/ function(module, exports, __webpack_require__) { + + var classof = __webpack_require__(49) + , ITERATOR = __webpack_require__(33)('iterator') + , Iterators = __webpack_require__(102); + module.exports = __webpack_require__(7).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; + }; + +/***/ }, +/* 117 */ +/***/ function(module, exports, __webpack_require__) { + + var ITERATOR = __webpack_require__(33)('iterator') + , SAFE_CLOSING = false; + + try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); + } catch(e){ /* empty */ } + + module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ safe = true; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; + }; + +/***/ }, +/* 118 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(5); + + // WebKit Array.of isn't generic + $export($export.S + $export.F * __webpack_require__(11)(function(){ + function F(){} + return !(Array.of.call(F) instanceof F); + }), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */){ + var index = 0 + , $$ = arguments + , $$len = $$.length + , result = new (typeof this == 'function' ? this : Array)($$len); + while($$len > index)result[index] = $$[index++]; + result.length = $$len; + return result; + } + }); + +/***/ }, +/* 119 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var addToUnscopables = __webpack_require__(120) + , step = __webpack_require__(121) + , Iterators = __webpack_require__(102) + , toIObject = __webpack_require__(25); + + // 22.1.3.4 Array.prototype.entries() + // 22.1.3.13 Array.prototype.keys() + // 22.1.3.29 Array.prototype.values() + // 22.1.3.30 Array.prototype[@@iterator]() + module.exports = __webpack_require__(101)(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind + // 22.1.5.2.1 %ArrayIteratorPrototype%.next() + }, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); + }, 'values'); + + // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) + Iterators.Arguments = Iterators.Array; + + addToUnscopables('keys'); + addToUnscopables('values'); + addToUnscopables('entries'); + +/***/ }, +/* 120 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.31 Array.prototype[@@unscopables] + var UNSCOPABLES = __webpack_require__(33)('unscopables') + , ArrayProto = Array.prototype; + if(ArrayProto[UNSCOPABLES] == undefined)__webpack_require__(8)(ArrayProto, UNSCOPABLES, {}); + module.exports = function(key){ + ArrayProto[UNSCOPABLES][key] = true; + }; + +/***/ }, +/* 121 */ +/***/ function(module, exports) { + + module.exports = function(done, value){ + return {value: value, done: !!done}; + }; + +/***/ }, +/* 122 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(123)('Array'); + +/***/ }, +/* 123 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(6) + , $ = __webpack_require__(4) + , DESCRIPTORS = __webpack_require__(10) + , SPECIES = __webpack_require__(33)('species'); + + module.exports = function(KEY){ + var C = global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])$.setDesc(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); + }; + +/***/ }, +/* 124 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + var $export = __webpack_require__(5); + + $export($export.P, 'Array', {copyWithin: __webpack_require__(125)}); + + __webpack_require__(120)('copyWithin'); + +/***/ }, +/* 125 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + 'use strict'; + var toObject = __webpack_require__(23) + , toIndex = __webpack_require__(28) + , toLength = __webpack_require__(29); + + module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){ + var O = toObject(this) + , len = toLength(O.length) + , to = toIndex(target, len) + , from = toIndex(start, len) + , $$ = arguments + , end = $$.length > 2 ? $$[2] : undefined + , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to) + , inc = 1; + if(from < to && to < from + count){ + inc = -1; + from += count - 1; + to += count - 1; + } + while(count-- > 0){ + if(from in O)O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; + }; + +/***/ }, +/* 126 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + var $export = __webpack_require__(5); + + $export($export.P, 'Array', {fill: __webpack_require__(127)}); + + __webpack_require__(120)('fill'); + +/***/ }, +/* 127 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + 'use strict'; + var toObject = __webpack_require__(23) + , toIndex = __webpack_require__(28) + , toLength = __webpack_require__(29); + module.exports = [].fill || function fill(value /*, start = 0, end = @length */){ + var O = toObject(this) + , length = toLength(O.length) + , $$ = arguments + , $$len = $$.length + , index = toIndex($$len > 1 ? $$[1] : undefined, length) + , end = $$len > 2 ? $$[2] : undefined + , endPos = end === undefined ? length : toIndex(end, length); + while(endPos > index)O[index++] = value; + return O; + }; + +/***/ }, +/* 128 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) + var $export = __webpack_require__(5) + , $find = __webpack_require__(30)(5) + , KEY = 'find' + , forced = true; + // Shouldn't skip holes + if(KEY in [])Array(1)[KEY](function(){ forced = false; }); + $export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + __webpack_require__(120)(KEY); + +/***/ }, +/* 129 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) + var $export = __webpack_require__(5) + , $find = __webpack_require__(30)(6) + , KEY = 'findIndex' + , forced = true; + // Shouldn't skip holes + if(KEY in [])Array(1)[KEY](function(){ forced = false; }); + $export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + __webpack_require__(120)(KEY); + +/***/ }, +/* 130 */ +/***/ function(module, exports, __webpack_require__) { + + var $ = __webpack_require__(4) + , global = __webpack_require__(6) + , isRegExp = __webpack_require__(107) + , $flags = __webpack_require__(131) + , $RegExp = global.RegExp + , Base = $RegExp + , proto = $RegExp.prototype + , re1 = /a/g + , re2 = /a/g + // "new" creates a new object, old webkit buggy here + , CORRECT_NEW = new $RegExp(re1) !== re1; + + if(__webpack_require__(10) && (!CORRECT_NEW || __webpack_require__(11)(function(){ + re2[__webpack_require__(33)('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; + }))){ + $RegExp = function RegExp(p, f){ + var piRE = isRegExp(p) + , fiU = f === undefined; + return !(this instanceof $RegExp) && piRE && p.constructor === $RegExp && fiU ? p + : CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f); + }; + $.each.call($.getNames(Base), function(key){ + key in $RegExp || $.setDesc($RegExp, key, { + configurable: true, + get: function(){ return Base[key]; }, + set: function(it){ Base[key] = it; } + }); + }); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + __webpack_require__(12)(global, 'RegExp', $RegExp); + } + + __webpack_require__(123)('RegExp'); + +/***/ }, +/* 131 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 21.2.5.3 get RegExp.prototype.flags + var anObject = __webpack_require__(22); + module.exports = function(){ + var that = anObject(this) + , result = ''; + if(that.global) result += 'g'; + if(that.ignoreCase) result += 'i'; + if(that.multiline) result += 'm'; + if(that.unicode) result += 'u'; + if(that.sticky) result += 'y'; + return result; + }; + +/***/ }, +/* 132 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.2.5.3 get RegExp.prototype.flags() + var $ = __webpack_require__(4); + if(__webpack_require__(10) && /./g.flags != 'g')$.setDesc(RegExp.prototype, 'flags', { + configurable: true, + get: __webpack_require__(131) + }); + +/***/ }, +/* 133 */ +/***/ function(module, exports, __webpack_require__) { + + // @@match logic + __webpack_require__(134)('match', 1, function(defined, MATCH){ + // 21.1.3.11 String.prototype.match(regexp) + return function match(regexp){ + 'use strict'; + var O = defined(this) + , fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }; + }); + +/***/ }, +/* 134 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var hide = __webpack_require__(8) + , redefine = __webpack_require__(12) + , fails = __webpack_require__(11) + , defined = __webpack_require__(24) + , wks = __webpack_require__(33); + + module.exports = function(KEY, length, exec){ + var SYMBOL = wks(KEY) + , original = ''[KEY]; + if(fails(function(){ + var O = {}; + O[SYMBOL] = function(){ return 7; }; + return ''[KEY](O) != 7; + })){ + redefine(String.prototype, KEY, exec(defined, SYMBOL, original)); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function(string, arg){ return original.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function(string){ return original.call(string, this); } + ); + } + }; + +/***/ }, +/* 135 */ +/***/ function(module, exports, __webpack_require__) { + + // @@replace logic + __webpack_require__(134)('replace', 2, function(defined, REPLACE, $replace){ + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return function replace(searchValue, replaceValue){ + 'use strict'; + var O = defined(this) + , fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }; + }); + +/***/ }, +/* 136 */ +/***/ function(module, exports, __webpack_require__) { + + // @@search logic + __webpack_require__(134)('search', 1, function(defined, SEARCH){ + // 21.1.3.15 String.prototype.search(regexp) + return function search(regexp){ + 'use strict'; + var O = defined(this) + , fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }; + }); + +/***/ }, +/* 137 */ +/***/ function(module, exports, __webpack_require__) { + + // @@split logic + __webpack_require__(134)('split', 2, function(defined, SPLIT, $split){ + // 21.1.3.17 String.prototype.split(separator, limit) + return function split(separator, limit){ + 'use strict'; + var O = defined(this) + , fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined + ? fn.call(separator, O, limit) + : $split.call(String(O), separator, limit); + }; + }); + +/***/ }, +/* 138 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(4) + , LIBRARY = __webpack_require__(41) + , global = __webpack_require__(6) + , ctx = __webpack_require__(14) + , classof = __webpack_require__(49) + , $export = __webpack_require__(5) + , isObject = __webpack_require__(18) + , anObject = __webpack_require__(22) + , aFunction = __webpack_require__(15) + , strictNew = __webpack_require__(139) + , forOf = __webpack_require__(140) + , setProto = __webpack_require__(47).set + , same = __webpack_require__(45) + , SPECIES = __webpack_require__(33)('species') + , speciesConstructor = __webpack_require__(141) + , asap = __webpack_require__(142) + , PROMISE = 'Promise' + , process = global.process + , isNode = classof(process) == 'process' + , P = global[PROMISE] + , Wrapper; + + var testResolve = function(sub){ + var test = new P(function(){}); + if(sub)test.constructor = Object; + return P.resolve(test) === test; + }; + + var USE_NATIVE = function(){ + var works = false; + function P2(x){ + var self = new P(x); + setProto(self, P2.prototype); + return self; + } + try { + works = P && P.resolve && testResolve(); + setProto(P2, P); + P2.prototype = $.create(P.prototype, {constructor: {value: P2}}); + // actual Firefox has broken subclass support, test that + if(!(P2.resolve(5).then(function(){}) instanceof P2)){ + works = false; + } + // actual V8 bug, https://code.google.com/p/v8/issues/detail?id=4162 + if(works && __webpack_require__(10)){ + var thenableThenGotten = false; + P.resolve($.setDesc({}, 'then', { + get: function(){ thenableThenGotten = true; } + })); + works = thenableThenGotten; + } + } catch(e){ works = false; } + return works; + }(); + + // helpers + var sameConstructor = function(a, b){ + // library wrapper special case + if(LIBRARY && a === P && b === Wrapper)return true; + return same(a, b); + }; + var getConstructor = function(C){ + var S = anObject(C)[SPECIES]; + return S != undefined ? S : C; + }; + var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; + }; + var PromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve), + this.reject = aFunction(reject) + }; + var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } + }; + var notify = function(record, isReject){ + if(record.n)return; + record.n = true; + var chain = record.c; + asap(function(){ + var value = record.v + , ok = record.s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , result, then; + try { + if(handler){ + if(!ok)record.h = true; + result = handler === true ? value : handler(value); + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + chain.length = 0; + record.n = false; + if(isReject)setTimeout(function(){ + var promise = record.p + , handler, console; + if(isUnhandled(promise)){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + } record.a = undefined; + }, 1); + }); + }; + var isUnhandled = function(promise){ + var record = promise._d + , chain = record.a || record.c + , i = 0 + , reaction; + if(record.h)return false; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; + }; + var $reject = function(value){ + var record = this; + if(record.d)return; + record.d = true; + record = record.r || record; // unwrap + record.v = value; + record.s = 2; + record.a = record.c.slice(); + notify(record, true); + }; + var $resolve = function(value){ + var record = this + , then; + if(record.d)return; + record.d = true; + record = record.r || record; // unwrap + try { + if(record.p === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + asap(function(){ + var wrapper = {r: record, d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + record.v = value; + record.s = 1; + notify(record, false); + } + } catch(e){ + $reject.call({r: record, d: false}, e); // wrap + } + }; + + // constructor polyfill + if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + P = function Promise(executor){ + aFunction(executor); + var record = this._d = { + p: strictNew(this, P, PROMISE), // <- promise + c: [], // <- awaiting reactions + a: undefined, // <- checked in isUnhandled reactions + s: 0, // <- state + d: false, // <- done + v: undefined, // <- value + h: false, // <- handled rejection + n: false // <- notify + }; + try { + executor(ctx($resolve, record, 1), ctx($reject, record, 1)); + } catch(err){ + $reject.call(record, err); + } + }; + __webpack_require__(144)(P.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = new PromiseCapability(speciesConstructor(this, P)) + , promise = reaction.promise + , record = this._d; + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + record.c.push(reaction); + if(record.a)record.a.push(reaction); + if(record.s)notify(record, false); + return promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + } + + $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: P}); + __webpack_require__(37)(P, PROMISE); + __webpack_require__(123)(PROMISE); + Wrapper = __webpack_require__(7)[PROMISE]; + + // statics + $export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = new PromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } + }); + $export($export.S + $export.F * (!USE_NATIVE || testResolve(true)), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof P && sameConstructor(x.constructor, this))return x; + var capability = new PromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } + }); + $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(117)(function(iter){ + P.all(iter)['catch'](function(){}); + })), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = getConstructor(this) + , capability = new PromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject + , values = []; + var abrupt = perform(function(){ + forOf(iterable, false, values.push, values); + var remaining = values.length + , results = Array(remaining); + if(remaining)$.each.call(values, function(promise, index){ + var alreadyCalled = false; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + results[index] = value; + --remaining || resolve(results); + }, reject); + }); + else resolve(results); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = getConstructor(this) + , capability = new PromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } + }); + +/***/ }, +/* 139 */ +/***/ function(module, exports) { + + module.exports = function(it, Constructor, name){ + if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!"); + return it; + }; + +/***/ }, +/* 140 */ +/***/ function(module, exports, __webpack_require__) { + + var ctx = __webpack_require__(14) + , call = __webpack_require__(114) + , isArrayIter = __webpack_require__(115) + , anObject = __webpack_require__(22) + , toLength = __webpack_require__(29) + , getIterFn = __webpack_require__(116); + module.exports = function(iterable, entries, fn, that){ + var iterFn = getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + call(iterator, f, step.value, entries); + } + }; + +/***/ }, +/* 141 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.3.20 SpeciesConstructor(O, defaultConstructor) + var anObject = __webpack_require__(22) + , aFunction = __webpack_require__(15) + , SPECIES = __webpack_require__(33)('species'); + module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); + }; + +/***/ }, +/* 142 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(6) + , macrotask = __webpack_require__(143).set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = __webpack_require__(20)(process) == 'process' + , head, last, notify; + + var flush = function(){ + var parent, domain, fn; + if(isNode && (parent = process.domain)){ + process.domain = null; + parent.exit(); + } + while(head){ + domain = head.domain; + fn = head.fn; + if(domain)domain.enter(); + fn(); // <- currently we use it only for Promise - try / catch not required + if(domain)domain.exit(); + head = head.next; + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = 1 + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = -toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + notify = function(){ + Promise.resolve().then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + module.exports = function asap(fn){ + var task = {fn: fn, next: undefined, domain: isNode && process.domain}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; + +/***/ }, +/* 143 */ +/***/ function(module, exports, __webpack_require__) { + + var ctx = __webpack_require__(14) + , invoke = __webpack_require__(21) + , html = __webpack_require__(16) + , cel = __webpack_require__(17) + , global = __webpack_require__(6) + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; + var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } + }; + var listner = function(event){ + run.call(event.data); + }; + // Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(__webpack_require__(20)(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listner; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listner, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } + } + module.exports = { + set: setTask, + clear: clearTask + }; + +/***/ }, +/* 144 */ +/***/ function(module, exports, __webpack_require__) { + + var redefine = __webpack_require__(12); + module.exports = function(target, src){ + for(var key in src)redefine(target, key, src[key]); + return target; + }; + +/***/ }, +/* 145 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var strong = __webpack_require__(146); + + // 23.1 Map Objects + __webpack_require__(147)('Map', function(get){ + return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key){ + var entry = strong.getEntry(this, key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value){ + return strong.def(this, key === 0 ? 0 : key, value); + } + }, strong, true); + +/***/ }, +/* 146 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(4) + , hide = __webpack_require__(8) + , redefineAll = __webpack_require__(144) + , ctx = __webpack_require__(14) + , strictNew = __webpack_require__(139) + , defined = __webpack_require__(24) + , forOf = __webpack_require__(140) + , $iterDefine = __webpack_require__(101) + , step = __webpack_require__(121) + , ID = __webpack_require__(13)('id') + , $has = __webpack_require__(19) + , isObject = __webpack_require__(18) + , setSpecies = __webpack_require__(123) + , DESCRIPTORS = __webpack_require__(10) + , isExtensible = Object.isExtensible || isObject + , SIZE = DESCRIPTORS ? '_s' : 'size' + , id = 0; + + var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!$has(it, ID)){ + // can't set id to frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add id + if(!create)return 'E'; + // add missing object id + hide(it, ID, ++id); + // return object id with prefix + } return 'O' + it[ID]; + }; + + var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } + }; + + module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + strictNew(that, C, NAME); + that._i = $.create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)$.setDesc(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } + }; + +/***/ }, +/* 147 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(6) + , $export = __webpack_require__(5) + , redefine = __webpack_require__(12) + , redefineAll = __webpack_require__(144) + , forOf = __webpack_require__(140) + , strictNew = __webpack_require__(139) + , isObject = __webpack_require__(18) + , fails = __webpack_require__(11) + , $iterDetect = __webpack_require__(117) + , setToStringTag = __webpack_require__(37); + + module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + var fixMethod = function(KEY){ + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a){ + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + } else { + var instance = new C + // early implementations not supports chaining + , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); }) + // most early implementations doesn't supports iterables, most modern - not close it correctly + , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + , BUGGY_ZERO; + if(!ACCEPT_ITERABLES){ + C = wrapper(function(target, iterable){ + strictNew(target, C, NAME); + var that = new Base; + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + IS_WEAK || instance.forEach(function(val, key){ + BUGGY_ZERO = 1 / key === -Infinity; + }); + if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){ + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER); + // weak collections should not contains .clear method + if(IS_WEAK && proto.clear)delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; + }; + +/***/ }, +/* 148 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var strong = __webpack_require__(146); + + // 23.2 Set Objects + __webpack_require__(147)('Set', function(get){ + return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value){ + return strong.def(this, value = value === 0 ? 0 : value, value); + } + }, strong); + +/***/ }, +/* 149 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $ = __webpack_require__(4) + , redefine = __webpack_require__(12) + , weak = __webpack_require__(150) + , isObject = __webpack_require__(18) + , has = __webpack_require__(19) + , frozenStore = weak.frozenStore + , WEAK = weak.WEAK + , isExtensible = Object.isExtensible || isObject + , tmp = {}; + + // 23.3 WeakMap Objects + var $WeakMap = __webpack_require__(147)('WeakMap', function(get){ + return function WeakMap(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key){ + if(isObject(key)){ + if(!isExtensible(key))return frozenStore(this).get(key); + if(has(key, WEAK))return key[WEAK][this._i]; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value){ + return weak.def(this, key, value); + } + }, weak, true, true); + + // IE11 WeakMap frozen keys fix + if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ + $.each.call(['delete', 'has', 'get', 'set'], function(key){ + var proto = $WeakMap.prototype + , method = proto[key]; + redefine(proto, key, function(a, b){ + // store frozen objects on leaky map + if(isObject(a) && !isExtensible(a)){ + var result = frozenStore(this)[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); + } + +/***/ }, +/* 150 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var hide = __webpack_require__(8) + , redefineAll = __webpack_require__(144) + , anObject = __webpack_require__(22) + , isObject = __webpack_require__(18) + , strictNew = __webpack_require__(139) + , forOf = __webpack_require__(140) + , createArrayMethod = __webpack_require__(30) + , $has = __webpack_require__(19) + , WEAK = __webpack_require__(13)('weak') + , isExtensible = Object.isExtensible || isObject + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , id = 0; + + // fallback for frozen keys + var frozenStore = function(that){ + return that._l || (that._l = new FrozenStore); + }; + var FrozenStore = function(){ + this.a = []; + }; + var findFrozen = function(store, key){ + return arrayFind(store.a, function(it){ + return it[0] === key; + }); + }; + FrozenStore.prototype = { + get: function(key){ + var entry = findFrozen(this, key); + if(entry)return entry[1]; + }, + has: function(key){ + return !!findFrozen(this, key); + }, + set: function(key, value){ + var entry = findFrozen(this, key); + if(entry)entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function(key){ + var index = arrayFindIndex(this.a, function(it){ + return it[0] === key; + }); + if(~index)this.a.splice(index, 1); + return !!~index; + } + }; + + module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + strictNew(that, C, NAME); + that._i = id++; // collection id + that._l = undefined; // leak store for frozen objects + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function(key){ + if(!isObject(key))return false; + if(!isExtensible(key))return frozenStore(this)['delete'](key); + return $has(key, WEAK) && $has(key[WEAK], this._i) && delete key[WEAK][this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key){ + if(!isObject(key))return false; + if(!isExtensible(key))return frozenStore(this).has(key); + return $has(key, WEAK) && $has(key[WEAK], this._i); + } + }); + return C; + }, + def: function(that, key, value){ + if(!isExtensible(anObject(key))){ + frozenStore(that).set(key, value); + } else { + $has(key, WEAK) || hide(key, WEAK, {}); + key[WEAK][that._i] = value; + } return that; + }, + frozenStore: frozenStore, + WEAK: WEAK + }; + +/***/ }, +/* 151 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var weak = __webpack_require__(150); + + // 23.4 WeakSet Objects + __webpack_require__(147)('WeakSet', function(get){ + return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value){ + return weak.def(this, value, true); + } + }, weak, false, true); + +/***/ }, +/* 152 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) + var $export = __webpack_require__(5) + , _apply = Function.apply; + + $export($export.S, 'Reflect', { + apply: function apply(target, thisArgument, argumentsList){ + return _apply.call(target, thisArgument, argumentsList); + } + }); + +/***/ }, +/* 153 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) + var $ = __webpack_require__(4) + , $export = __webpack_require__(5) + , aFunction = __webpack_require__(15) + , anObject = __webpack_require__(22) + , isObject = __webpack_require__(18) + , bind = Function.bind || __webpack_require__(7).Function.prototype.bind; + + // MS Edge supports only 2 arguments + // FF Nightly sets third argument as `new.target`, but does not create `this` from it + $export($export.S + $export.F * __webpack_require__(11)(function(){ + function F(){} + return !(Reflect.construct(function(){}, [], F) instanceof F); + }), 'Reflect', { + construct: function construct(Target, args /*, newTarget*/){ + aFunction(Target); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if(Target == newTarget){ + // w/o altered newTarget, optimization for 0-4 arguments + if(args != undefined)switch(anObject(args).length){ + case 0: return new Target; + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args)); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype + , instance = $.create(isObject(proto) ? proto : Object.prototype) + , result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } + }); + +/***/ }, +/* 154 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) + var $ = __webpack_require__(4) + , $export = __webpack_require__(5) + , anObject = __webpack_require__(22); + + // MS Edge has broken Reflect.defineProperty - throwing instead of returning false + $export($export.S + $export.F * __webpack_require__(11)(function(){ + Reflect.defineProperty($.setDesc({}, 1, {value: 1}), 1, {value: 2}); + }), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes){ + anObject(target); + try { + $.setDesc(target, propertyKey, attributes); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 155 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.4 Reflect.deleteProperty(target, propertyKey) + var $export = __webpack_require__(5) + , getDesc = __webpack_require__(4).getDesc + , anObject = __webpack_require__(22); + + $export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey){ + var desc = getDesc(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } + }); + +/***/ }, +/* 156 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 26.1.5 Reflect.enumerate(target) + var $export = __webpack_require__(5) + , anObject = __webpack_require__(22); + var Enumerate = function(iterated){ + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = [] // keys + , key; + for(key in iterated)keys.push(key); + }; + __webpack_require__(103)(Enumerate, 'Object', function(){ + var that = this + , keys = that._k + , key; + do { + if(that._i >= keys.length)return {value: undefined, done: true}; + } while(!((key = keys[that._i++]) in that._t)); + return {value: key, done: false}; + }); + + $export($export.S, 'Reflect', { + enumerate: function enumerate(target){ + return new Enumerate(target); + } + }); + +/***/ }, +/* 157 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.6 Reflect.get(target, propertyKey [, receiver]) + var $ = __webpack_require__(4) + , has = __webpack_require__(19) + , $export = __webpack_require__(5) + , isObject = __webpack_require__(18) + , anObject = __webpack_require__(22); + + function get(target, propertyKey/*, receiver*/){ + var receiver = arguments.length < 3 ? target : arguments[2] + , desc, proto; + if(anObject(target) === receiver)return target[propertyKey]; + if(desc = $.getDesc(target, propertyKey))return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if(isObject(proto = $.getProto(target)))return get(proto, propertyKey, receiver); + } + + $export($export.S, 'Reflect', {get: get}); + +/***/ }, +/* 158 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) + var $ = __webpack_require__(4) + , $export = __webpack_require__(5) + , anObject = __webpack_require__(22); + + $export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){ + return $.getDesc(anObject(target), propertyKey); + } + }); + +/***/ }, +/* 159 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.8 Reflect.getPrototypeOf(target) + var $export = __webpack_require__(5) + , getProto = __webpack_require__(4).getProto + , anObject = __webpack_require__(22); + + $export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target){ + return getProto(anObject(target)); + } + }); + +/***/ }, +/* 160 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.9 Reflect.has(target, propertyKey) + var $export = __webpack_require__(5); + + $export($export.S, 'Reflect', { + has: function has(target, propertyKey){ + return propertyKey in target; + } + }); + +/***/ }, +/* 161 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.10 Reflect.isExtensible(target) + var $export = __webpack_require__(5) + , anObject = __webpack_require__(22) + , $isExtensible = Object.isExtensible; + + $export($export.S, 'Reflect', { + isExtensible: function isExtensible(target){ + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } + }); + +/***/ }, +/* 162 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.11 Reflect.ownKeys(target) + var $export = __webpack_require__(5); + + $export($export.S, 'Reflect', {ownKeys: __webpack_require__(163)}); + +/***/ }, +/* 163 */ +/***/ function(module, exports, __webpack_require__) { + + // all object keys, includes non-enumerable and symbols + var $ = __webpack_require__(4) + , anObject = __webpack_require__(22) + , Reflect = __webpack_require__(6).Reflect; + module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ + var keys = $.getNames(anObject(it)) + , getSymbols = $.getSymbols; + return getSymbols ? keys.concat(getSymbols(it)) : keys; + }; + +/***/ }, +/* 164 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.12 Reflect.preventExtensions(target) + var $export = __webpack_require__(5) + , anObject = __webpack_require__(22) + , $preventExtensions = Object.preventExtensions; + + $export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target){ + anObject(target); + try { + if($preventExtensions)$preventExtensions(target); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 165 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) + var $ = __webpack_require__(4) + , has = __webpack_require__(19) + , $export = __webpack_require__(5) + , createDesc = __webpack_require__(9) + , anObject = __webpack_require__(22) + , isObject = __webpack_require__(18); + + function set(target, propertyKey, V/*, receiver*/){ + var receiver = arguments.length < 4 ? target : arguments[3] + , ownDesc = $.getDesc(anObject(target), propertyKey) + , existingDescriptor, proto; + if(!ownDesc){ + if(isObject(proto = $.getProto(target))){ + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if(has(ownDesc, 'value')){ + if(ownDesc.writable === false || !isObject(receiver))return false; + existingDescriptor = $.getDesc(receiver, propertyKey) || createDesc(0); + existingDescriptor.value = V; + $.setDesc(receiver, propertyKey, existingDescriptor); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); + } + + $export($export.S, 'Reflect', {set: set}); + +/***/ }, +/* 166 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.14 Reflect.setPrototypeOf(target, proto) + var $export = __webpack_require__(5) + , setProto = __webpack_require__(47); + + if(setProto)$export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto){ + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 167 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(5) + , $includes = __webpack_require__(35)(true); + + $export($export.P, 'Array', { + // https://github.com/domenic/Array.prototype.includes + includes: function includes(el /*, fromIndex = 0 */){ + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + __webpack_require__(120)('includes'); + +/***/ }, +/* 168 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/mathiasbynens/String.prototype.at + var $export = __webpack_require__(5) + , $at = __webpack_require__(100)(true); + + $export($export.P, 'String', { + at: function at(pos){ + return $at(this, pos); + } + }); + +/***/ }, +/* 169 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(5) + , $pad = __webpack_require__(170); + + $export($export.P, 'String', { + padLeft: function padLeft(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } + }); + +/***/ }, +/* 170 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/ljharb/proposal-string-pad-left-right + var toLength = __webpack_require__(29) + , repeat = __webpack_require__(111) + , defined = __webpack_require__(24); + + module.exports = function(that, maxLength, fillString, left){ + var S = String(defined(that)) + , stringLength = S.length + , fillStr = fillString === undefined ? ' ' : String(fillString) + , intMaxLength = toLength(maxLength); + if(intMaxLength <= stringLength)return S; + if(fillStr == '')fillStr = ' '; + var fillLen = intMaxLength - stringLength + , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; + }; + +/***/ }, +/* 171 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(5) + , $pad = __webpack_require__(170); + + $export($export.P, 'String', { + padRight: function padRight(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } + }); + +/***/ }, +/* 172 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/sebmarkbage/ecmascript-string-left-right-trim + __webpack_require__(65)('trimLeft', function($trim){ + return function trimLeft(){ + return $trim(this, 1); + }; + }); + +/***/ }, +/* 173 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/sebmarkbage/ecmascript-string-left-right-trim + __webpack_require__(65)('trimRight', function($trim){ + return function trimRight(){ + return $trim(this, 2); + }; + }); + +/***/ }, +/* 174 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/benjamingr/RexExp.escape + var $export = __webpack_require__(5) + , $re = __webpack_require__(175)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + + $export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); + + +/***/ }, +/* 175 */ +/***/ function(module, exports) { + + module.exports = function(regExp, replace){ + var replacer = replace === Object(replace) ? function(part){ + return replace[part]; + } : replace; + return function(it){ + return String(it).replace(regExp, replacer); + }; + }; + +/***/ }, +/* 176 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/WebReflection/9353781 + var $ = __webpack_require__(4) + , $export = __webpack_require__(5) + , ownKeys = __webpack_require__(163) + , toIObject = __webpack_require__(25) + , createDesc = __webpack_require__(9); + + $export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){ + var O = toIObject(object) + , setDesc = $.setDesc + , getDesc = $.getDesc + , keys = ownKeys(O) + , result = {} + , i = 0 + , key, D; + while(keys.length > i){ + D = getDesc(O, key = keys[i++]); + if(key in result)setDesc(result, key, createDesc(0, D)); + else result[key] = D; + } return result; + } + }); + +/***/ }, +/* 177 */ +/***/ function(module, exports, __webpack_require__) { + + // http://goo.gl/XkBrjD + var $export = __webpack_require__(5) + , $values = __webpack_require__(178)(false); + + $export($export.S, 'Object', { + values: function values(it){ + return $values(it); + } + }); + +/***/ }, +/* 178 */ +/***/ function(module, exports, __webpack_require__) { + + var $ = __webpack_require__(4) + , toIObject = __webpack_require__(25) + , isEnum = $.isEnum; + module.exports = function(isEntries){ + return function(it){ + var O = toIObject(it) + , keys = $.getKeys(O) + , length = keys.length + , i = 0 + , result = [] + , key; + while(length > i)if(isEnum.call(O, key = keys[i++])){ + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; + }; + +/***/ }, +/* 179 */ +/***/ function(module, exports, __webpack_require__) { + + // http://goo.gl/XkBrjD + var $export = __webpack_require__(5) + , $entries = __webpack_require__(178)(true); + + $export($export.S, 'Object', { + entries: function entries(it){ + return $entries(it); + } + }); + +/***/ }, +/* 180 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var $export = __webpack_require__(5); + + $export($export.P, 'Map', {toJSON: __webpack_require__(181)('Map')}); + +/***/ }, +/* 181 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var forOf = __webpack_require__(140) + , classof = __webpack_require__(49); + module.exports = function(NAME){ + return function toJSON(){ + if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); + var arr = []; + forOf(this, false, arr.push, arr); + return arr; + }; + }; + +/***/ }, +/* 182 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var $export = __webpack_require__(5); + + $export($export.P, 'Set', {toJSON: __webpack_require__(181)('Set')}); + +/***/ }, +/* 183 */ +/***/ function(module, exports, __webpack_require__) { + + // JavaScript 1.6 / Strawman array statics shim + var $ = __webpack_require__(4) + , $export = __webpack_require__(5) + , $ctx = __webpack_require__(14) + , $Array = __webpack_require__(7).Array || Array + , statics = {}; + var setStatics = function(keys, length){ + $.each.call(keys.split(','), function(key){ + if(length == undefined && key in $Array)statics[key] = $Array[key]; + else if(key in [])statics[key] = $ctx(Function.call, [][key], length); + }); + }; + setStatics('pop,reverse,shift,keys,values,entries', 1); + setStatics('indexOf,every,some,forEach,map,filter,find,findIndex,includes', 3); + setStatics('join,slice,concat,push,splice,unshift,sort,lastIndexOf,' + + 'reduce,reduceRight,copyWithin,fill'); + $export($export.S, 'Array', statics); + +/***/ }, +/* 184 */ +/***/ function(module, exports, __webpack_require__) { + + // ie9- setTimeout & setInterval additional parameters fix + var global = __webpack_require__(6) + , $export = __webpack_require__(5) + , invoke = __webpack_require__(21) + , partial = __webpack_require__(185) + , navigator = global.navigator + , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check + var wrap = function(set){ + return MSIE ? function(fn, time /*, ...args */){ + return set(invoke( + partial, + [].slice.call(arguments, 2), + typeof fn == 'function' ? fn : Function(fn) + ), time); + } : set; + }; + $export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) + }); + +/***/ }, +/* 185 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var path = __webpack_require__(186) + , invoke = __webpack_require__(21) + , aFunction = __webpack_require__(15); + module.exports = function(/* ...pargs */){ + var fn = aFunction(this) + , length = arguments.length + , pargs = Array(length) + , i = 0 + , _ = path._ + , holder = false; + while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; + return function(/* ...args */){ + var that = this + , $$ = arguments + , $$len = $$.length + , j = 0, k = 0, args; + if(!holder && !$$len)return invoke(fn, pargs, that); + args = pargs.slice(); + if(holder)for(;length > j; j++)if(args[j] === _)args[j] = $$[k++]; + while($$len > k)args.push($$[k++]); + return invoke(fn, args, that); + }; + }; + +/***/ }, +/* 186 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(6); + +/***/ }, +/* 187 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(5) + , $task = __webpack_require__(143); + $export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear + }); + +/***/ }, +/* 188 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(119); + var global = __webpack_require__(6) + , hide = __webpack_require__(8) + , Iterators = __webpack_require__(102) + , ITERATOR = __webpack_require__(33)('iterator') + , NL = global.NodeList + , HTC = global.HTMLCollection + , NLProto = NL && NL.prototype + , HTCProto = HTC && HTC.prototype + , ArrayValues = Iterators.NodeList = Iterators.HTMLCollection = Iterators.Array; + if(NLProto && !NLProto[ITERATOR])hide(NLProto, ITERATOR, ArrayValues); + if(HTCProto && !HTCProto[ITERATOR])hide(HTCProto, ITERATOR, ArrayValues); + +/***/ }, +/* 189 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global, process) {/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + + !(function(global) { + "use strict"; + + var hasOwn = Object.prototype.hasOwnProperty; + var undefined; // More compressible than void 0. + var iteratorSymbol = + typeof Symbol === "function" && Symbol.iterator || "@@iterator"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided, then outerFn.prototype instanceof Generator. + var generator = Object.create((outerFn || Generator).prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `value instanceof AwaitArgument` to determine if the yielded value is + // meant to be awaited. Some may consider the name of this method too + // cutesy, but they are curmudgeons. + runtime.awrap = function(arg) { + return new AwaitArgument(arg); + }; + + function AwaitArgument(arg) { + this.arg = arg; + } + + function AsyncIterator(generator) { + // This invoke function is written in a style that assumes some + // calling function (or Promise) will handle exceptions. + function invoke(method, arg) { + var result = generator[method](arg); + var value = result.value; + return value instanceof AwaitArgument + ? Promise.resolve(value.arg).then(invokeNext, invokeThrow) + : Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + return result; + }); + } + + if (typeof process === "object" && process.domain) { + invoke = process.domain.bind(invoke); + } + + var invokeNext = invoke.bind(generator, "next"); + var invokeThrow = invoke.bind(generator, "throw"); + var invokeReturn = invoke.bind(generator, "return"); + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return invoke(method, arg); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : new Promise(function (resolve) { + resolve(callInvokeWithMethodAndArg()); + }); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + while (true) { + var delegate = context.delegate; + if (delegate) { + if (method === "return" || + (method === "throw" && delegate.iterator[method] === undefined)) { + // A return or throw (when the delegate iterator has no throw + // method) always terminates the yield* loop. + context.delegate = null; + + // If the delegate iterator has a return method, give it a + // chance to clean up. + var returnMethod = delegate.iterator["return"]; + if (returnMethod) { + var record = tryCatch(returnMethod, delegate.iterator, arg); + if (record.type === "throw") { + // If the return method threw an exception, let that + // exception prevail over the original return or throw. + method = "throw"; + arg = record.arg; + continue; + } + } + + if (method === "return") { + // Continue with the outer return, now that the delegate + // iterator has been terminated. + continue; + } + } + + var record = tryCatch( + delegate.iterator[method], + delegate.iterator, + arg + ); + + if (record.type === "throw") { + context.delegate = null; + + // Like returning generator.throw(uncaught), but without the + // overhead of an extra function call. + method = "throw"; + arg = record.arg; + continue; + } + + // Delegate generator ran and handled its own exceptions so + // regardless of what the method was, we continue as if it is + // "next" with an undefined arg. + method = "next"; + arg = undefined; + + var info = record.arg; + if (info.done) { + context[delegate.resultName] = info.value; + context.next = delegate.nextLoc; + } else { + state = GenStateSuspendedYield; + return info; + } + + context.delegate = null; + } + + if (method === "next") { + context._sent = arg; + + if (state === GenStateSuspendedYield) { + context.sent = arg; + } else { + context.sent = undefined; + } + } else if (method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw arg; + } + + if (context.dispatchException(arg)) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + method = "next"; + arg = undefined; + } + + } else if (method === "return") { + context.abrupt("return", arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + var info = { + value: record.arg, + done: context.done + }; + + if (record.arg === ContinueSentinel) { + if (context.delegate && method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + arg = undefined; + } + } else { + return info; + } + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(arg) call above. + method = "throw"; + arg = record.arg; + } + } + }; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + this.sent = undefined; + this.done = false; + this.delegate = null; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + return !!caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.next = finallyEntry.finallyLoc; + } else { + this.complete(record); + } + + return ContinueSentinel; + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = record.arg; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + return ContinueSentinel; + } + }; + })( + // Among the various tricks for obtaining a reference to the global + // object, this seems to be the most reliable technique that does not + // use indirect eval (which violates Content Security Policy). + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this + ); + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(190))) + +/***/ }, +/* 190 */ +/***/ function(module, exports) { + + // shim for using process in browser + + var process = module.exports = {}; + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + + function cleanUpNextTick() { + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + + function drainQueue() { + if (draining) { + return; + } + var timeout = setTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + clearTimeout(timeout); + } + + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + setTimeout(drainQueue, 0); + } + }; + + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() {} + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function() { return 0; }; + + +/***/ }, +/* 191 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(192); + + +/***/ }, +/* 192 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule React + */ + + 'use strict'; + + var ReactDOM = __webpack_require__(193); + var ReactDOMServer = __webpack_require__(337); + var ReactIsomorphic = __webpack_require__(341); + + var assign = __webpack_require__(228); + var deprecated = __webpack_require__(346); + + // `version` will be added here by ReactIsomorphic. + var React = {}; + + assign(React, ReactIsomorphic); + + assign(React, { + // ReactDOM + findDOMNode: deprecated('findDOMNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.findDOMNode), + render: deprecated('render', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.render), + unmountComponentAtNode: deprecated('unmountComponentAtNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.unmountComponentAtNode), + + // ReactDOMServer + renderToString: deprecated('renderToString', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToString), + renderToStaticMarkup: deprecated('renderToStaticMarkup', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToStaticMarkup) + }); + + React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM; + React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMServer; + + module.exports = React; + +/***/ }, +/* 193 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOM + */ + + /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/ + + 'use strict'; + + var ReactCurrentOwner = __webpack_require__(194); + var ReactDOMTextComponent = __webpack_require__(195); + var ReactDefaultInjection = __webpack_require__(260); + var ReactInstanceHandles = __webpack_require__(234); + var ReactMount = __webpack_require__(217); + var ReactPerf = __webpack_require__(207); + var ReactReconciler = __webpack_require__(239); + var ReactUpdates = __webpack_require__(243); + var ReactVersion = __webpack_require__(335); + + var findDOMNode = __webpack_require__(280); + var renderSubtreeIntoContainer = __webpack_require__(336); + var warning = __webpack_require__(214); + + ReactDefaultInjection.inject(); + + var render = ReactPerf.measure('React', 'render', ReactMount.render); + + var React = { + findDOMNode: findDOMNode, + render: render, + unmountComponentAtNode: ReactMount.unmountComponentAtNode, + version: ReactVersion, + + /* eslint-disable camelcase */ + unstable_batchedUpdates: ReactUpdates.batchedUpdates, + unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer + }; + + // Inject the runtime into a devtools global hook regardless of browser. + // Allows for debugging when the hook is injected on the page. + /* eslint-enable camelcase */ + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ + CurrentOwner: ReactCurrentOwner, + InstanceHandles: ReactInstanceHandles, + Mount: ReactMount, + Reconciler: ReactReconciler, + TextComponent: ReactDOMTextComponent + }); + } + + if (process.env.NODE_ENV !== 'production') { + var ExecutionEnvironment = __webpack_require__(198); + if (ExecutionEnvironment.canUseDOM && window.top === window.self) { + + // First check if devtools is not installed + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + // If we're in Chrome or Firefox, provide a download link if not installed. + if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) { + console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools'); + } + } + + // If we're in IE8, check to see if we are in compatibility mode and provide + // information on preventing compatibility mode + var ieCompatibilityMode = document.documentMode && document.documentMode < 8; + + process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : undefined; + + var expectedFeatures = [ + // shims + Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim, + + // shams + Object.create, Object.freeze]; + + for (var i = 0; i < expectedFeatures.length; i++) { + if (!expectedFeatures[i]) { + console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills'); + break; + } + } + } + } + + module.exports = React; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 194 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactCurrentOwner + */ + + 'use strict'; + + /** + * Keeps track of the current owner. + * + * The current owner is the component who should own any components that are + * currently being constructed. + */ + var ReactCurrentOwner = { + + /** + * @internal + * @type {ReactComponent} + */ + current: null + + }; + + module.exports = ReactCurrentOwner; + +/***/ }, +/* 195 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMTextComponent + * @typechecks static-only + */ + + 'use strict'; + + var DOMChildrenOperations = __webpack_require__(196); + var DOMPropertyOperations = __webpack_require__(211); + var ReactComponentBrowserEnvironment = __webpack_require__(215); + var ReactMount = __webpack_require__(217); + + var assign = __webpack_require__(228); + var escapeTextContentForBrowser = __webpack_require__(210); + var setTextContent = __webpack_require__(209); + var validateDOMNesting = __webpack_require__(259); + + /** + * Text nodes violate a couple assumptions that React makes about components: + * + * - When mounting text into the DOM, adjacent text nodes are merged. + * - Text nodes cannot be assigned a React root ID. + * + * This component is used to wrap strings in elements so that they can undergo + * the same reconciliation that is applied to elements. + * + * TODO: Investigate representing React components in the DOM with text nodes. + * + * @class ReactDOMTextComponent + * @extends ReactComponent + * @internal + */ + var ReactDOMTextComponent = function (props) { + // This constructor and its argument is currently used by mocks. + }; + + assign(ReactDOMTextComponent.prototype, { + + /** + * @param {ReactText} text + * @internal + */ + construct: function (text) { + // TODO: This is really a ReactText (ReactNode), not a ReactElement + this._currentElement = text; + this._stringText = '' + text; + + // Properties + this._rootNodeID = null; + this._mountIndex = 0; + }, + + /** + * Creates the markup for this text node. This node is not intended to have + * any features besides containing text content. + * + * @param {string} rootID DOM ID of the root node. + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @return {string} Markup for this text node. + * @internal + */ + mountComponent: function (rootID, transaction, context) { + if (process.env.NODE_ENV !== 'production') { + if (context[validateDOMNesting.ancestorInfoContextKey]) { + validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]); + } + } + + this._rootNodeID = rootID; + if (transaction.useCreateElement) { + var ownerDocument = context[ReactMount.ownerDocumentContextKey]; + var el = ownerDocument.createElement('span'); + DOMPropertyOperations.setAttributeForID(el, rootID); + // Populate node cache + ReactMount.getID(el); + setTextContent(el, this._stringText); + return el; + } else { + var escapedText = escapeTextContentForBrowser(this._stringText); + + if (transaction.renderToStaticMarkup) { + // Normally we'd wrap this in a `span` for the reasons stated above, but + // since this is a situation where React won't take over (static pages), + // we can simply return the text as it is. + return escapedText; + } + + return '<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' + escapedText + '</span>'; + } + }, + + /** + * Updates this component by updating the text content. + * + * @param {ReactText} nextText The next text content + * @param {ReactReconcileTransaction} transaction + * @internal + */ + receiveComponent: function (nextText, transaction) { + if (nextText !== this._currentElement) { + this._currentElement = nextText; + var nextStringText = '' + nextText; + if (nextStringText !== this._stringText) { + // TODO: Save this as pending props and use performUpdateIfNecessary + // and/or updateComponent to do the actual update for consistency with + // other component types? + this._stringText = nextStringText; + var node = ReactMount.getNode(this._rootNodeID); + DOMChildrenOperations.updateTextContent(node, nextStringText); + } + } + }, + + unmountComponent: function () { + ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID); + } + + }); + + module.exports = ReactDOMTextComponent; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 196 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule DOMChildrenOperations + * @typechecks static-only + */ + + 'use strict'; + + var Danger = __webpack_require__(197); + var ReactMultiChildUpdateTypes = __webpack_require__(205); + var ReactPerf = __webpack_require__(207); + + var setInnerHTML = __webpack_require__(208); + var setTextContent = __webpack_require__(209); + var invariant = __webpack_require__(202); + + /** + * Inserts `childNode` as a child of `parentNode` at the `index`. + * + * @param {DOMElement} parentNode Parent node in which to insert. + * @param {DOMElement} childNode Child node to insert. + * @param {number} index Index at which to insert the child. + * @internal + */ + function insertChildAt(parentNode, childNode, index) { + // By exploiting arrays returning `undefined` for an undefined index, we can + // rely exclusively on `insertBefore(node, null)` instead of also using + // `appendChild(node)`. However, using `undefined` is not allowed by all + // browsers so we must replace it with `null`. + + // fix render order error in safari + // IE8 will throw error when index out of list size. + var beforeChild = index >= parentNode.childNodes.length ? null : parentNode.childNodes.item(index); + + parentNode.insertBefore(childNode, beforeChild); + } + + /** + * Operations for updating with DOM children. + */ + var DOMChildrenOperations = { + + dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup, + + updateTextContent: setTextContent, + + /** + * Updates a component's children by processing a series of updates. The + * update configurations are each expected to have a `parentNode` property. + * + * @param {array<object>} updates List of update configurations. + * @param {array<string>} markupList List of markup strings. + * @internal + */ + processUpdates: function (updates, markupList) { + var update; + // Mapping from parent IDs to initial child orderings. + var initialChildren = null; + // List of children that will be moved or removed. + var updatedChildren = null; + + for (var i = 0; i < updates.length; i++) { + update = updates[i]; + if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) { + var updatedIndex = update.fromIndex; + var updatedChild = update.parentNode.childNodes[updatedIndex]; + var parentID = update.parentID; + + !updatedChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processUpdates(): Unable to find child %s of element. This ' + 'probably means the DOM was unexpectedly mutated (e.g., by the ' + 'browser), usually due to forgetting a <tbody> when using tables, ' + 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements ' + 'in an <svg> parent. Try inspecting the child nodes of the element ' + 'with React ID `%s`.', updatedIndex, parentID) : invariant(false) : undefined; + + initialChildren = initialChildren || {}; + initialChildren[parentID] = initialChildren[parentID] || []; + initialChildren[parentID][updatedIndex] = updatedChild; + + updatedChildren = updatedChildren || []; + updatedChildren.push(updatedChild); + } + } + + var renderedMarkup; + // markupList is either a list of markup or just a list of elements + if (markupList.length && typeof markupList[0] === 'string') { + renderedMarkup = Danger.dangerouslyRenderMarkup(markupList); + } else { + renderedMarkup = markupList; + } + + // Remove updated children first so that `toIndex` is consistent. + if (updatedChildren) { + for (var j = 0; j < updatedChildren.length; j++) { + updatedChildren[j].parentNode.removeChild(updatedChildren[j]); + } + } + + for (var k = 0; k < updates.length; k++) { + update = updates[k]; + switch (update.type) { + case ReactMultiChildUpdateTypes.INSERT_MARKUP: + insertChildAt(update.parentNode, renderedMarkup[update.markupIndex], update.toIndex); + break; + case ReactMultiChildUpdateTypes.MOVE_EXISTING: + insertChildAt(update.parentNode, initialChildren[update.parentID][update.fromIndex], update.toIndex); + break; + case ReactMultiChildUpdateTypes.SET_MARKUP: + setInnerHTML(update.parentNode, update.content); + break; + case ReactMultiChildUpdateTypes.TEXT_CONTENT: + setTextContent(update.parentNode, update.content); + break; + case ReactMultiChildUpdateTypes.REMOVE_NODE: + // Already removed by the for-loop above. + break; + } + } + } + + }; + + ReactPerf.measureMethods(DOMChildrenOperations, 'DOMChildrenOperations', { + updateTextContent: 'updateTextContent' + }); + + module.exports = DOMChildrenOperations; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 197 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule Danger + * @typechecks static-only + */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(198); + + var createNodesFromMarkup = __webpack_require__(199); + var emptyFunction = __webpack_require__(204); + var getMarkupWrap = __webpack_require__(203); + var invariant = __webpack_require__(202); + + var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/; + var RESULT_INDEX_ATTR = 'data-danger-index'; + + /** + * Extracts the `nodeName` from a string of markup. + * + * NOTE: Extracting the `nodeName` does not require a regular expression match + * because we make assumptions about React-generated markup (i.e. there are no + * spaces surrounding the opening tag and there is at least one attribute). + * + * @param {string} markup String of markup. + * @return {string} Node name of the supplied markup. + * @see http://jsperf.com/extract-nodename + */ + function getNodeName(markup) { + return markup.substring(1, markup.indexOf(' ')); + } + + var Danger = { + + /** + * Renders markup into an array of nodes. The markup is expected to render + * into a list of root nodes. Also, the length of `resultList` and + * `markupList` should be the same. + * + * @param {array<string>} markupList List of markup strings to render. + * @return {array<DOMElement>} List of rendered nodes. + * @internal + */ + dangerouslyRenderMarkup: function (markupList) { + !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString for server rendering.') : invariant(false) : undefined; + var nodeName; + var markupByNodeName = {}; + // Group markup by `nodeName` if a wrap is necessary, else by '*'. + for (var i = 0; i < markupList.length; i++) { + !markupList[i] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : undefined; + nodeName = getNodeName(markupList[i]); + nodeName = getMarkupWrap(nodeName) ? nodeName : '*'; + markupByNodeName[nodeName] = markupByNodeName[nodeName] || []; + markupByNodeName[nodeName][i] = markupList[i]; + } + var resultList = []; + var resultListAssignmentCount = 0; + for (nodeName in markupByNodeName) { + if (!markupByNodeName.hasOwnProperty(nodeName)) { + continue; + } + var markupListByNodeName = markupByNodeName[nodeName]; + + // This for-in loop skips the holes of the sparse array. The order of + // iteration should follow the order of assignment, which happens to match + // numerical index order, but we don't rely on that. + var resultIndex; + for (resultIndex in markupListByNodeName) { + if (markupListByNodeName.hasOwnProperty(resultIndex)) { + var markup = markupListByNodeName[resultIndex]; + + // Push the requested markup with an additional RESULT_INDEX_ATTR + // attribute. If the markup does not start with a < character, it + // will be discarded below (with an appropriate console.error). + markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP, + // This index will be parsed back out below. + '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" '); + } + } + + // Render each group of markup with similar wrapping `nodeName`. + var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction // Do nothing special with <script> tags. + ); + + for (var j = 0; j < renderNodes.length; ++j) { + var renderNode = renderNodes[j]; + if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) { + + resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR); + renderNode.removeAttribute(RESULT_INDEX_ATTR); + + !!resultList.hasOwnProperty(resultIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : undefined; + + resultList[resultIndex] = renderNode; + + // This should match resultList.length and markupList.length when + // we're done. + resultListAssignmentCount += 1; + } else if (process.env.NODE_ENV !== 'production') { + console.error('Danger: Discarding unexpected node:', renderNode); + } + } + } + + // Although resultList was populated out of order, it should now be a dense + // array. + !(resultListAssignmentCount === resultList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : undefined; + + !(resultList.length === markupList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : undefined; + + return resultList; + }, + + /** + * Replaces a node with a string of markup at its current position within its + * parent. The markup must render into a single root node. + * + * @param {DOMElement} oldChild Child node to replace. + * @param {string} markup Markup to render in place of the child node. + * @internal + */ + dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) { + !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString() for server rendering.') : invariant(false) : undefined; + !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : undefined; + !(oldChild.tagName.toLowerCase() !== 'html') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See ReactDOMServer.renderToString().') : invariant(false) : undefined; + + var newChild; + if (typeof markup === 'string') { + newChild = createNodesFromMarkup(markup, emptyFunction)[0]; + } else { + newChild = markup; + } + oldChild.parentNode.replaceChild(newChild, oldChild); + } + + }; + + module.exports = Danger; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 198 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ExecutionEnvironment + */ + + 'use strict'; + + var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + + /** + * Simple, lightweight module assisting with the detection and context of + * Worker. Helps avoid circular dependencies and allows code to reason about + * whether or not they are in a Worker, even if they never include the main + * `ReactWorker` dependency. + */ + var ExecutionEnvironment = { + + canUseDOM: canUseDOM, + + canUseWorkers: typeof Worker !== 'undefined', + + canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), + + canUseViewport: canUseDOM && !!window.screen, + + isInWorker: !canUseDOM // For now, this is true - might change in the future. + + }; + + module.exports = ExecutionEnvironment; + +/***/ }, +/* 199 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule createNodesFromMarkup + * @typechecks + */ + + /*eslint-disable fb-www/unsafe-html*/ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(198); + + var createArrayFromMixed = __webpack_require__(200); + var getMarkupWrap = __webpack_require__(203); + var invariant = __webpack_require__(202); + + /** + * Dummy container used to render all markup. + */ + var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; + + /** + * Pattern used by `getNodeName`. + */ + var nodeNamePattern = /^\s*<(\w+)/; + + /** + * Extracts the `nodeName` of the first element in a string of markup. + * + * @param {string} markup String of markup. + * @return {?string} Node name of the supplied markup. + */ + function getNodeName(markup) { + var nodeNameMatch = markup.match(nodeNamePattern); + return nodeNameMatch && nodeNameMatch[1].toLowerCase(); + } + + /** + * Creates an array containing the nodes rendered from the supplied markup. The + * optionally supplied `handleScript` function will be invoked once for each + * <script> element that is rendered. If no `handleScript` function is supplied, + * an exception is thrown if any <script> elements are rendered. + * + * @param {string} markup A string of valid HTML markup. + * @param {?function} handleScript Invoked once for each rendered <script>. + * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes. + */ + function createNodesFromMarkup(markup, handleScript) { + var node = dummyNode; + !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : undefined; + var nodeName = getNodeName(markup); + + var wrap = nodeName && getMarkupWrap(nodeName); + if (wrap) { + node.innerHTML = wrap[1] + markup + wrap[2]; + + var wrapDepth = wrap[0]; + while (wrapDepth--) { + node = node.lastChild; + } + } else { + node.innerHTML = markup; + } + + var scripts = node.getElementsByTagName('script'); + if (scripts.length) { + !handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : undefined; + createArrayFromMixed(scripts).forEach(handleScript); + } + + var nodes = createArrayFromMixed(node.childNodes); + while (node.lastChild) { + node.removeChild(node.lastChild); + } + return nodes; + } + + module.exports = createNodesFromMarkup; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 200 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule createArrayFromMixed + * @typechecks + */ + + 'use strict'; + + var toArray = __webpack_require__(201); + + /** + * Perform a heuristic test to determine if an object is "array-like". + * + * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?" + * Joshu replied: "Mu." + * + * This function determines if its argument has "array nature": it returns + * true if the argument is an actual array, an `arguments' object, or an + * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()). + * + * It will return false for other array-like objects like Filelist. + * + * @param {*} obj + * @return {boolean} + */ + function hasArrayNature(obj) { + return( + // not null/false + !!obj && ( + // arrays are objects, NodeLists are functions in Safari + typeof obj == 'object' || typeof obj == 'function') && + // quacks like an array + 'length' in obj && + // not window + !('setInterval' in obj) && + // no DOM node should be considered an array-like + // a 'select' element has 'length' and 'item' properties on IE8 + typeof obj.nodeType != 'number' && ( + // a real array + Array.isArray(obj) || + // arguments + 'callee' in obj || + // HTMLCollection/NodeList + 'item' in obj) + ); + } + + /** + * Ensure that the argument is an array by wrapping it in an array if it is not. + * Creates a copy of the argument if it is already an array. + * + * This is mostly useful idiomatically: + * + * var createArrayFromMixed = require('createArrayFromMixed'); + * + * function takesOneOrMoreThings(things) { + * things = createArrayFromMixed(things); + * ... + * } + * + * This allows you to treat `things' as an array, but accept scalars in the API. + * + * If you need to convert an array-like object, like `arguments`, into an array + * use toArray instead. + * + * @param {*} obj + * @return {array} + */ + function createArrayFromMixed(obj) { + if (!hasArrayNature(obj)) { + return [obj]; + } else if (Array.isArray(obj)) { + return obj.slice(); + } else { + return toArray(obj); + } + } + + module.exports = createArrayFromMixed; + +/***/ }, +/* 201 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule toArray + * @typechecks + */ + + 'use strict'; + + var invariant = __webpack_require__(202); + + /** + * Convert array-like objects to arrays. + * + * This API assumes the caller knows the contents of the data type. For less + * well defined inputs use createArrayFromMixed. + * + * @param {object|function|filelist} obj + * @return {array} + */ + function toArray(obj) { + var length = obj.length; + + // Some browse builtin objects can report typeof 'function' (e.g. NodeList in + // old versions of Safari). + !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : undefined; + + !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : undefined; + + !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : undefined; + + // Old IE doesn't give collections access to hasOwnProperty. Assume inputs + // without method will throw during the slice call and skip straight to the + // fallback. + if (obj.hasOwnProperty) { + try { + return Array.prototype.slice.call(obj); + } catch (e) { + // IE < 9 does not support Array#slice on collections objects + } + } + + // Fall back to copying key by key. This assumes all keys have a value, + // so will not preserve sparsely populated inputs. + var ret = Array(length); + for (var ii = 0; ii < length; ii++) { + ret[ii] = obj[ii]; + } + return ret; + } + + module.exports = toArray; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 202 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule invariant + */ + + 'use strict'; + + /** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + + function invariant(condition, format, a, b, c, d, e, f) { + if (process.env.NODE_ENV !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } + } + + module.exports = invariant; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 203 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getMarkupWrap + */ + + /*eslint-disable fb-www/unsafe-html */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(198); + + var invariant = __webpack_require__(202); + + /** + * Dummy container used to detect which wraps are necessary. + */ + var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; + + /** + * Some browsers cannot use `innerHTML` to render certain elements standalone, + * so we wrap them, render the wrapped nodes, then extract the desired node. + * + * In IE8, certain elements cannot render alone, so wrap all elements ('*'). + */ + + var shouldWrap = {}; + + var selectWrap = [1, '<select multiple="true">', '</select>']; + var tableWrap = [1, '<table>', '</table>']; + var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>']; + + var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>']; + + var markupWrap = { + '*': [1, '?<div>', '</div>'], + + 'area': [1, '<map>', '</map>'], + 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'], + 'legend': [1, '<fieldset>', '</fieldset>'], + 'param': [1, '<object>', '</object>'], + 'tr': [2, '<table><tbody>', '</tbody></table>'], + + 'optgroup': selectWrap, + 'option': selectWrap, + + 'caption': tableWrap, + 'colgroup': tableWrap, + 'tbody': tableWrap, + 'tfoot': tableWrap, + 'thead': tableWrap, + + 'td': trWrap, + 'th': trWrap + }; + + // Initialize the SVG elements since we know they'll always need to be wrapped + // consistently. If they are created inside a <div> they will be initialized in + // the wrong namespace (and will not display). + var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan']; + svgElements.forEach(function (nodeName) { + markupWrap[nodeName] = svgWrap; + shouldWrap[nodeName] = true; + }); + + /** + * Gets the markup wrap configuration for the supplied `nodeName`. + * + * NOTE: This lazily detects which wraps are necessary for the current browser. + * + * @param {string} nodeName Lowercase `nodeName`. + * @return {?array} Markup wrap configuration, if applicable. + */ + function getMarkupWrap(nodeName) { + !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : undefined; + if (!markupWrap.hasOwnProperty(nodeName)) { + nodeName = '*'; + } + if (!shouldWrap.hasOwnProperty(nodeName)) { + if (nodeName === '*') { + dummyNode.innerHTML = '<link />'; + } else { + dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>'; + } + shouldWrap[nodeName] = !dummyNode.firstChild; + } + return shouldWrap[nodeName] ? markupWrap[nodeName] : null; + } + + module.exports = getMarkupWrap; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 204 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule emptyFunction + */ + + "use strict"; + + function makeEmptyFunction(arg) { + return function () { + return arg; + }; + } + + /** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ + function emptyFunction() {} + + emptyFunction.thatReturns = makeEmptyFunction; + emptyFunction.thatReturnsFalse = makeEmptyFunction(false); + emptyFunction.thatReturnsTrue = makeEmptyFunction(true); + emptyFunction.thatReturnsNull = makeEmptyFunction(null); + emptyFunction.thatReturnsThis = function () { + return this; + }; + emptyFunction.thatReturnsArgument = function (arg) { + return arg; + }; + + module.exports = emptyFunction; + +/***/ }, +/* 205 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactMultiChildUpdateTypes + */ + + 'use strict'; + + var keyMirror = __webpack_require__(206); + + /** + * When a component's children are updated, a series of update configuration + * objects are created in order to batch and serialize the required changes. + * + * Enumerates all the possible types of update configurations. + * + * @internal + */ + var ReactMultiChildUpdateTypes = keyMirror({ + INSERT_MARKUP: null, + MOVE_EXISTING: null, + REMOVE_NODE: null, + SET_MARKUP: null, + TEXT_CONTENT: null + }); + + module.exports = ReactMultiChildUpdateTypes; + +/***/ }, +/* 206 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule keyMirror + * @typechecks static-only + */ + + 'use strict'; + + var invariant = __webpack_require__(202); + + /** + * Constructs an enumeration with keys equal to their value. + * + * For example: + * + * var COLORS = keyMirror({blue: null, red: null}); + * var myColor = COLORS.blue; + * var isColorValid = !!COLORS[myColor]; + * + * The last line could not be performed if the values of the generated enum were + * not equal to their keys. + * + * Input: {key1: val1, key2: val2} + * Output: {key1: key1, key2: key2} + * + * @param {object} obj + * @return {object} + */ + var keyMirror = function (obj) { + var ret = {}; + var key; + !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : undefined; + for (key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + ret[key] = key; + } + return ret; + }; + + module.exports = keyMirror; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 207 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactPerf + * @typechecks static-only + */ + + 'use strict'; + + /** + * ReactPerf is a general AOP system designed to measure performance. This + * module only has the hooks: see ReactDefaultPerf for the analysis tool. + */ + var ReactPerf = { + /** + * Boolean to enable/disable measurement. Set to false by default to prevent + * accidental logging and perf loss. + */ + enableMeasure: false, + + /** + * Holds onto the measure function in use. By default, don't measure + * anything, but we'll override this if we inject a measure function. + */ + storedMeasure: _noMeasure, + + /** + * @param {object} object + * @param {string} objectName + * @param {object<string>} methodNames + */ + measureMethods: function (object, objectName, methodNames) { + if (process.env.NODE_ENV !== 'production') { + for (var key in methodNames) { + if (!methodNames.hasOwnProperty(key)) { + continue; + } + object[key] = ReactPerf.measure(objectName, methodNames[key], object[key]); + } + } + }, + + /** + * Use this to wrap methods you want to measure. Zero overhead in production. + * + * @param {string} objName + * @param {string} fnName + * @param {function} func + * @return {function} + */ + measure: function (objName, fnName, func) { + if (process.env.NODE_ENV !== 'production') { + var measuredFunc = null; + var wrapper = function () { + if (ReactPerf.enableMeasure) { + if (!measuredFunc) { + measuredFunc = ReactPerf.storedMeasure(objName, fnName, func); + } + return measuredFunc.apply(this, arguments); + } + return func.apply(this, arguments); + }; + wrapper.displayName = objName + '_' + fnName; + return wrapper; + } + return func; + }, + + injection: { + /** + * @param {function} measure + */ + injectMeasure: function (measure) { + ReactPerf.storedMeasure = measure; + } + } + }; + + /** + * Simply passes through the measured function, without measuring it. + * + * @param {string} objName + * @param {string} fnName + * @param {function} func + * @return {function} + */ + function _noMeasure(objName, fnName, func) { + return func; + } + + module.exports = ReactPerf; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 208 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule setInnerHTML + */ + + /* globals MSApp */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(198); + + var WHITESPACE_TEST = /^[ \r\n\t\f]/; + var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; + + /** + * Set the innerHTML property of a node, ensuring that whitespace is preserved + * even in IE8. + * + * @param {DOMElement} node + * @param {string} html + * @internal + */ + var setInnerHTML = function (node, html) { + node.innerHTML = html; + }; + + // Win8 apps: Allow all html to be inserted + if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) { + setInnerHTML = function (node, html) { + MSApp.execUnsafeLocalFunction(function () { + node.innerHTML = html; + }); + }; + } + + if (ExecutionEnvironment.canUseDOM) { + // IE8: When updating a just created node with innerHTML only leading + // whitespace is removed. When updating an existing node with innerHTML + // whitespace in root TextNodes is also collapsed. + // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html + + // Feature detection; only IE8 is known to behave improperly like this. + var testElement = document.createElement('div'); + testElement.innerHTML = ' '; + if (testElement.innerHTML === '') { + setInnerHTML = function (node, html) { + // Magic theory: IE8 supposedly differentiates between added and updated + // nodes when processing innerHTML, innerHTML on updated nodes suffers + // from worse whitespace behavior. Re-adding a node like this triggers + // the initial and more favorable whitespace behavior. + // TODO: What to do on a detached node? + if (node.parentNode) { + node.parentNode.replaceChild(node, node); + } + + // We also implement a workaround for non-visible tags disappearing into + // thin air on IE8, this only happens if there is no visible text + // in-front of the non-visible tags. Piggyback on the whitespace fix + // and simply check if any non-visible tags appear in the source. + if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) { + // Recover leading whitespace by temporarily prepending any character. + // \uFEFF has the potential advantage of being zero-width/invisible. + // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode + // in hopes that this is preserved even if "\uFEFF" is transformed to + // the actual Unicode character (by Babel, for example). + // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216 + node.innerHTML = String.fromCharCode(0xFEFF) + html; + + // deleteData leaves an empty `TextNode` which offsets the index of all + // children. Definitely want to avoid this. + var textNode = node.firstChild; + if (textNode.data.length === 1) { + node.removeChild(textNode); + } else { + textNode.deleteData(0, 1); + } + } else { + node.innerHTML = html; + } + }; + } + } + + module.exports = setInnerHTML; + +/***/ }, +/* 209 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule setTextContent + */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(198); + var escapeTextContentForBrowser = __webpack_require__(210); + var setInnerHTML = __webpack_require__(208); + + /** + * Set the textContent property of a node, ensuring that whitespace is preserved + * even in IE8. innerText is a poor substitute for textContent and, among many + * issues, inserts <br> instead of the literal newline chars. innerHTML behaves + * as it should. + * + * @param {DOMElement} node + * @param {string} text + * @internal + */ + var setTextContent = function (node, text) { + node.textContent = text; + }; + + if (ExecutionEnvironment.canUseDOM) { + if (!('textContent' in document.documentElement)) { + setTextContent = function (node, text) { + setInnerHTML(node, escapeTextContentForBrowser(text)); + }; + } + } + + module.exports = setTextContent; + +/***/ }, +/* 210 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule escapeTextContentForBrowser + */ + + 'use strict'; + + var ESCAPE_LOOKUP = { + '&': '&', + '>': '>', + '<': '<', + '"': '"', + '\'': ''' + }; + + var ESCAPE_REGEX = /[&><"']/g; + + function escaper(match) { + return ESCAPE_LOOKUP[match]; + } + + /** + * Escapes text to prevent scripting attacks. + * + * @param {*} text Text value to escape. + * @return {string} An escaped string. + */ + function escapeTextContentForBrowser(text) { + return ('' + text).replace(ESCAPE_REGEX, escaper); + } + + module.exports = escapeTextContentForBrowser; + +/***/ }, +/* 211 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule DOMPropertyOperations + * @typechecks static-only + */ + + 'use strict'; + + var DOMProperty = __webpack_require__(212); + var ReactPerf = __webpack_require__(207); + + var quoteAttributeValueForBrowser = __webpack_require__(213); + var warning = __webpack_require__(214); + + // Simplified subset + var VALID_ATTRIBUTE_NAME_REGEX = /^[a-zA-Z_][\w\.\-]*$/; + var illegalAttributeNameCache = {}; + var validatedAttributeNameCache = {}; + + function isAttributeNameSafe(attributeName) { + if (validatedAttributeNameCache.hasOwnProperty(attributeName)) { + return true; + } + if (illegalAttributeNameCache.hasOwnProperty(attributeName)) { + return false; + } + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } + illegalAttributeNameCache[attributeName] = true; + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : undefined; + return false; + } + + function shouldIgnoreValue(propertyInfo, value) { + return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false; + } + + if (process.env.NODE_ENV !== 'production') { + var reactProps = { + children: true, + dangerouslySetInnerHTML: true, + key: true, + ref: true + }; + var warnedProperties = {}; + + var warnUnknownProperty = function (name) { + if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) { + return; + } + + warnedProperties[name] = true; + var lowerCasedName = name.toLowerCase(); + + // data-* attributes should be lowercase; suggest the lowercase version + var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null; + + // For now, only warn when we have a suggested correction. This prevents + // logging too much when using transferPropsTo. + process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : undefined; + }; + } + + /** + * Operations for dealing with DOM properties. + */ + var DOMPropertyOperations = { + + /** + * Creates markup for the ID property. + * + * @param {string} id Unescaped ID. + * @return {string} Markup string. + */ + createMarkupForID: function (id) { + return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id); + }, + + setAttributeForID: function (node, id) { + node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id); + }, + + /** + * Creates markup for a property. + * + * @param {string} name + * @param {*} value + * @return {?string} Markup string, or null if the property was invalid. + */ + createMarkupForProperty: function (name, value) { + var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; + if (propertyInfo) { + if (shouldIgnoreValue(propertyInfo, value)) { + return ''; + } + var attributeName = propertyInfo.attributeName; + if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { + return attributeName + '=""'; + } + return attributeName + '=' + quoteAttributeValueForBrowser(value); + } else if (DOMProperty.isCustomAttribute(name)) { + if (value == null) { + return ''; + } + return name + '=' + quoteAttributeValueForBrowser(value); + } else if (process.env.NODE_ENV !== 'production') { + warnUnknownProperty(name); + } + return null; + }, + + /** + * Creates markup for a custom property. + * + * @param {string} name + * @param {*} value + * @return {string} Markup string, or empty string if the property was invalid. + */ + createMarkupForCustomAttribute: function (name, value) { + if (!isAttributeNameSafe(name) || value == null) { + return ''; + } + return name + '=' + quoteAttributeValueForBrowser(value); + }, + + /** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} value + */ + setValueForProperty: function (node, name, value) { + var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; + if (propertyInfo) { + var mutationMethod = propertyInfo.mutationMethod; + if (mutationMethod) { + mutationMethod(node, value); + } else if (shouldIgnoreValue(propertyInfo, value)) { + this.deleteValueForProperty(node, name); + } else if (propertyInfo.mustUseAttribute) { + var attributeName = propertyInfo.attributeName; + var namespace = propertyInfo.attributeNamespace; + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + if (namespace) { + node.setAttributeNS(namespace, attributeName, '' + value); + } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { + node.setAttribute(attributeName, ''); + } else { + node.setAttribute(attributeName, '' + value); + } + } else { + var propName = propertyInfo.propertyName; + // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the + // property type before comparing; only `value` does and is string. + if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propName] = value; + } + } + } else if (DOMProperty.isCustomAttribute(name)) { + DOMPropertyOperations.setValueForAttribute(node, name, value); + } else if (process.env.NODE_ENV !== 'production') { + warnUnknownProperty(name); + } + }, + + setValueForAttribute: function (node, name, value) { + if (!isAttributeNameSafe(name)) { + return; + } + if (value == null) { + node.removeAttribute(name); + } else { + node.setAttribute(name, '' + value); + } + }, + + /** + * Deletes the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + */ + deleteValueForProperty: function (node, name) { + var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; + if (propertyInfo) { + var mutationMethod = propertyInfo.mutationMethod; + if (mutationMethod) { + mutationMethod(node, undefined); + } else if (propertyInfo.mustUseAttribute) { + node.removeAttribute(propertyInfo.attributeName); + } else { + var propName = propertyInfo.propertyName; + var defaultValue = DOMProperty.getDefaultValueForProperty(node.nodeName, propName); + if (!propertyInfo.hasSideEffects || '' + node[propName] !== defaultValue) { + node[propName] = defaultValue; + } + } + } else if (DOMProperty.isCustomAttribute(name)) { + node.removeAttribute(name); + } else if (process.env.NODE_ENV !== 'production') { + warnUnknownProperty(name); + } + } + + }; + + ReactPerf.measureMethods(DOMPropertyOperations, 'DOMPropertyOperations', { + setValueForProperty: 'setValueForProperty', + setValueForAttribute: 'setValueForAttribute', + deleteValueForProperty: 'deleteValueForProperty' + }); + + module.exports = DOMPropertyOperations; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 212 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule DOMProperty + * @typechecks static-only + */ + + 'use strict'; + + var invariant = __webpack_require__(202); + + function checkMask(value, bitmask) { + return (value & bitmask) === bitmask; + } + + var DOMPropertyInjection = { + /** + * Mapping from normalized, camelcased property names to a configuration that + * specifies how the associated DOM property should be accessed or rendered. + */ + MUST_USE_ATTRIBUTE: 0x1, + MUST_USE_PROPERTY: 0x2, + HAS_SIDE_EFFECTS: 0x4, + HAS_BOOLEAN_VALUE: 0x8, + HAS_NUMERIC_VALUE: 0x10, + HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10, + HAS_OVERLOADED_BOOLEAN_VALUE: 0x40, + + /** + * Inject some specialized knowledge about the DOM. This takes a config object + * with the following properties: + * + * isCustomAttribute: function that given an attribute name will return true + * if it can be inserted into the DOM verbatim. Useful for data-* or aria-* + * attributes where it's impossible to enumerate all of the possible + * attribute names, + * + * Properties: object mapping DOM property name to one of the + * DOMPropertyInjection constants or null. If your attribute isn't in here, + * it won't get written to the DOM. + * + * DOMAttributeNames: object mapping React attribute name to the DOM + * attribute name. Attribute names not specified use the **lowercase** + * normalized name. + * + * DOMAttributeNamespaces: object mapping React attribute name to the DOM + * attribute namespace URL. (Attribute names not specified use no namespace.) + * + * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. + * Property names not specified use the normalized name. + * + * DOMMutationMethods: Properties that require special mutation methods. If + * `value` is undefined, the mutation method should unset the property. + * + * @param {object} domPropertyConfig the config as described above. + */ + injectDOMPropertyConfig: function (domPropertyConfig) { + var Injection = DOMPropertyInjection; + var Properties = domPropertyConfig.Properties || {}; + var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {}; + var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; + var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; + var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; + + if (domPropertyConfig.isCustomAttribute) { + DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute); + } + + for (var propName in Properties) { + !!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(false) : undefined; + + var lowerCased = propName.toLowerCase(); + var propConfig = Properties[propName]; + + var propertyInfo = { + attributeName: lowerCased, + attributeNamespace: null, + propertyName: propName, + mutationMethod: null, + + mustUseAttribute: checkMask(propConfig, Injection.MUST_USE_ATTRIBUTE), + mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY), + hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS), + hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE), + hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE), + hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE), + hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE) + }; + + !(!propertyInfo.mustUseAttribute || !propertyInfo.mustUseProperty) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Cannot require using both attribute and property: %s', propName) : invariant(false) : undefined; + !(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : undefined; + !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : undefined; + + if (process.env.NODE_ENV !== 'production') { + DOMProperty.getPossibleStandardName[lowerCased] = propName; + } + + if (DOMAttributeNames.hasOwnProperty(propName)) { + var attributeName = DOMAttributeNames[propName]; + propertyInfo.attributeName = attributeName; + if (process.env.NODE_ENV !== 'production') { + DOMProperty.getPossibleStandardName[attributeName] = propName; + } + } + + if (DOMAttributeNamespaces.hasOwnProperty(propName)) { + propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName]; + } + + if (DOMPropertyNames.hasOwnProperty(propName)) { + propertyInfo.propertyName = DOMPropertyNames[propName]; + } + + if (DOMMutationMethods.hasOwnProperty(propName)) { + propertyInfo.mutationMethod = DOMMutationMethods[propName]; + } + + DOMProperty.properties[propName] = propertyInfo; + } + } + }; + var defaultValueCache = {}; + + /** + * DOMProperty exports lookup objects that can be used like functions: + * + * > DOMProperty.isValid['id'] + * true + * > DOMProperty.isValid['foobar'] + * undefined + * + * Although this may be confusing, it performs better in general. + * + * @see http://jsperf.com/key-exists + * @see http://jsperf.com/key-missing + */ + var DOMProperty = { + + ID_ATTRIBUTE_NAME: 'data-reactid', + + /** + * Map from property "standard name" to an object with info about how to set + * the property in the DOM. Each object contains: + * + * attributeName: + * Used when rendering markup or with `*Attribute()`. + * attributeNamespace + * propertyName: + * Used on DOM node instances. (This includes properties that mutate due to + * external factors.) + * mutationMethod: + * If non-null, used instead of the property or `setAttribute()` after + * initial render. + * mustUseAttribute: + * Whether the property must be accessed and mutated using `*Attribute()`. + * (This includes anything that fails `<propName> in <element>`.) + * mustUseProperty: + * Whether the property must be accessed and mutated as an object property. + * hasSideEffects: + * Whether or not setting a value causes side effects such as triggering + * resources to be loaded or text selection changes. If true, we read from + * the DOM before updating to ensure that the value is only set if it has + * changed. + * hasBooleanValue: + * Whether the property should be removed when set to a falsey value. + * hasNumericValue: + * Whether the property must be numeric or parse as a numeric and should be + * removed when set to a falsey value. + * hasPositiveNumericValue: + * Whether the property must be positive numeric or parse as a positive + * numeric and should be removed when set to a falsey value. + * hasOverloadedBooleanValue: + * Whether the property can be used as a flag as well as with a value. + * Removed when strictly equal to false; present without a value when + * strictly equal to true; present with a value otherwise. + */ + properties: {}, + + /** + * Mapping from lowercase property names to the properly cased version, used + * to warn in the case of missing properties. Available only in __DEV__. + * @type {Object} + */ + getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} : null, + + /** + * All of the isCustomAttribute() functions that have been injected. + */ + _isCustomAttributeFunctions: [], + + /** + * Checks whether a property name is a custom attribute. + * @method + */ + isCustomAttribute: function (attributeName) { + for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) { + var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i]; + if (isCustomAttributeFn(attributeName)) { + return true; + } + } + return false; + }, + + /** + * Returns the default property value for a DOM property (i.e., not an + * attribute). Most default values are '' or false, but not all. Worse yet, + * some (in particular, `type`) vary depending on the type of element. + * + * TODO: Is it better to grab all the possible properties when creating an + * element to avoid having to create the same element twice? + */ + getDefaultValueForProperty: function (nodeName, prop) { + var nodeDefaults = defaultValueCache[nodeName]; + var testElement; + if (!nodeDefaults) { + defaultValueCache[nodeName] = nodeDefaults = {}; + } + if (!(prop in nodeDefaults)) { + testElement = document.createElement(nodeName); + nodeDefaults[prop] = testElement[prop]; + } + return nodeDefaults[prop]; + }, + + injection: DOMPropertyInjection + }; + + module.exports = DOMProperty; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 213 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule quoteAttributeValueForBrowser + */ + + 'use strict'; + + var escapeTextContentForBrowser = __webpack_require__(210); + + /** + * Escapes attribute value to prevent scripting attacks. + * + * @param {*} value Value to escape. + * @return {string} An escaped string. + */ + function quoteAttributeValueForBrowser(value) { + return '"' + escapeTextContentForBrowser(value) + '"'; + } + + module.exports = quoteAttributeValueForBrowser; + +/***/ }, +/* 214 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule warning + */ + + 'use strict'; + + var emptyFunction = __webpack_require__(204); + + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + var warning = emptyFunction; + + if (process.env.NODE_ENV !== 'production') { + warning = function (condition, format) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + } + }; + } + + module.exports = warning; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 215 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactComponentBrowserEnvironment + */ + + 'use strict'; + + var ReactDOMIDOperations = __webpack_require__(216); + var ReactMount = __webpack_require__(217); + + /** + * Abstracts away all functionality of the reconciler that requires knowledge of + * the browser context. TODO: These callers should be refactored to avoid the + * need for this injection. + */ + var ReactComponentBrowserEnvironment = { + + processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, + + replaceNodeWithMarkupByID: ReactDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID, + + /** + * If a particular environment requires that some resources be cleaned up, + * specify this in the injected Mixin. In the DOM, we would likely want to + * purge any cached node ID lookups. + * + * @private + */ + unmountIDFromEnvironment: function (rootNodeID) { + ReactMount.purgeID(rootNodeID); + } + + }; + + module.exports = ReactComponentBrowserEnvironment; + +/***/ }, +/* 216 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMIDOperations + * @typechecks static-only + */ + + 'use strict'; + + var DOMChildrenOperations = __webpack_require__(196); + var DOMPropertyOperations = __webpack_require__(211); + var ReactMount = __webpack_require__(217); + var ReactPerf = __webpack_require__(207); + + var invariant = __webpack_require__(202); + + /** + * Errors for properties that should not be updated with `updatePropertyByID()`. + * + * @type {object} + * @private + */ + var INVALID_PROPERTY_ERRORS = { + dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.', + style: '`style` must be set using `updateStylesByID()`.' + }; + + /** + * Operations used to process updates to DOM nodes. + */ + var ReactDOMIDOperations = { + + /** + * Updates a DOM node with new property values. This should only be used to + * update DOM properties in `DOMProperty`. + * + * @param {string} id ID of the node to update. + * @param {string} name A valid property name, see `DOMProperty`. + * @param {*} value New value of the property. + * @internal + */ + updatePropertyByID: function (id, name, value) { + var node = ReactMount.getNode(id); + !!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined; + + // If we're updating to null or undefined, we should remove the property + // from the DOM node instead of inadvertantly setting to a string. This + // brings us in line with the same behavior we have on initial render. + if (value != null) { + DOMPropertyOperations.setValueForProperty(node, name, value); + } else { + DOMPropertyOperations.deleteValueForProperty(node, name); + } + }, + + /** + * Replaces a DOM node that exists in the document with markup. + * + * @param {string} id ID of child to be replaced. + * @param {string} markup Dangerous markup to inject in place of child. + * @internal + * @see {Danger.dangerouslyReplaceNodeWithMarkup} + */ + dangerouslyReplaceNodeWithMarkupByID: function (id, markup) { + var node = ReactMount.getNode(id); + DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup); + }, + + /** + * Updates a component's children by processing a series of updates. + * + * @param {array<object>} updates List of update configurations. + * @param {array<string>} markup List of markup strings. + * @internal + */ + dangerouslyProcessChildrenUpdates: function (updates, markup) { + for (var i = 0; i < updates.length; i++) { + updates[i].parentNode = ReactMount.getNode(updates[i].parentID); + } + DOMChildrenOperations.processUpdates(updates, markup); + } + }; + + ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', { + dangerouslyReplaceNodeWithMarkupByID: 'dangerouslyReplaceNodeWithMarkupByID', + dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates' + }); + + module.exports = ReactDOMIDOperations; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 217 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactMount + */ + + 'use strict'; + + var DOMProperty = __webpack_require__(212); + var ReactBrowserEventEmitter = __webpack_require__(218); + var ReactCurrentOwner = __webpack_require__(194); + var ReactDOMFeatureFlags = __webpack_require__(230); + var ReactElement = __webpack_require__(231); + var ReactEmptyComponentRegistry = __webpack_require__(233); + var ReactInstanceHandles = __webpack_require__(234); + var ReactInstanceMap = __webpack_require__(236); + var ReactMarkupChecksum = __webpack_require__(237); + var ReactPerf = __webpack_require__(207); + var ReactReconciler = __webpack_require__(239); + var ReactUpdateQueue = __webpack_require__(242); + var ReactUpdates = __webpack_require__(243); + + var assign = __webpack_require__(228); + var emptyObject = __webpack_require__(247); + var containsNode = __webpack_require__(248); + var instantiateReactComponent = __webpack_require__(251); + var invariant = __webpack_require__(202); + var setInnerHTML = __webpack_require__(208); + var shouldUpdateReactComponent = __webpack_require__(256); + var validateDOMNesting = __webpack_require__(259); + var warning = __webpack_require__(214); + + var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; + var nodeCache = {}; + + var ELEMENT_NODE_TYPE = 1; + var DOC_NODE_TYPE = 9; + var DOCUMENT_FRAGMENT_NODE_TYPE = 11; + + var ownerDocumentContextKey = '__ReactMount_ownerDocument$' + Math.random().toString(36).slice(2); + + /** Mapping from reactRootID to React component instance. */ + var instancesByReactRootID = {}; + + /** Mapping from reactRootID to `container` nodes. */ + var containersByReactRootID = {}; + + if (process.env.NODE_ENV !== 'production') { + /** __DEV__-only mapping from reactRootID to root elements. */ + var rootElementsByReactRootID = {}; + } + + // Used to store breadth-first search state in findComponentRoot. + var findComponentRootReusableArray = []; + + /** + * Finds the index of the first character + * that's not common between the two given strings. + * + * @return {number} the index of the character where the strings diverge + */ + function firstDifferenceIndex(string1, string2) { + var minLen = Math.min(string1.length, string2.length); + for (var i = 0; i < minLen; i++) { + if (string1.charAt(i) !== string2.charAt(i)) { + return i; + } + } + return string1.length === string2.length ? -1 : minLen; + } + + /** + * @param {DOMElement|DOMDocument} container DOM element that may contain + * a React component + * @return {?*} DOM element that may have the reactRoot ID, or null. + */ + function getReactRootElementInContainer(container) { + if (!container) { + return null; + } + + if (container.nodeType === DOC_NODE_TYPE) { + return container.documentElement; + } else { + return container.firstChild; + } + } + + /** + * @param {DOMElement} container DOM element that may contain a React component. + * @return {?string} A "reactRoot" ID, if a React component is rendered. + */ + function getReactRootID(container) { + var rootElement = getReactRootElementInContainer(container); + return rootElement && ReactMount.getID(rootElement); + } + + /** + * Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form + * element can return its control whose name or ID equals ATTR_NAME. All + * DOM nodes support `getAttributeNode` but this can also get called on + * other objects so just return '' if we're given something other than a + * DOM node (such as window). + * + * @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node. + * @return {string} ID of the supplied `domNode`. + */ + function getID(node) { + var id = internalGetID(node); + if (id) { + if (nodeCache.hasOwnProperty(id)) { + var cached = nodeCache[id]; + if (cached !== node) { + !!isValid(cached, id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(false) : undefined; + + nodeCache[id] = node; + } + } else { + nodeCache[id] = node; + } + } + + return id; + } + + function internalGetID(node) { + // If node is something like a window, document, or text node, none of + // which support attributes or a .getAttribute method, gracefully return + // the empty string, as if the attribute were missing. + return node && node.getAttribute && node.getAttribute(ATTR_NAME) || ''; + } + + /** + * Sets the React-specific ID of the given node. + * + * @param {DOMElement} node The DOM node whose ID will be set. + * @param {string} id The value of the ID attribute. + */ + function setID(node, id) { + var oldID = internalGetID(node); + if (oldID !== id) { + delete nodeCache[oldID]; + } + node.setAttribute(ATTR_NAME, id); + nodeCache[id] = node; + } + + /** + * Finds the node with the supplied React-generated DOM ID. + * + * @param {string} id A React-generated DOM ID. + * @return {DOMElement} DOM node with the suppled `id`. + * @internal + */ + function getNode(id) { + if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) { + nodeCache[id] = ReactMount.findReactNodeByID(id); + } + return nodeCache[id]; + } + + /** + * Finds the node with the supplied public React instance. + * + * @param {*} instance A public React instance. + * @return {?DOMElement} DOM node with the suppled `id`. + * @internal + */ + function getNodeFromInstance(instance) { + var id = ReactInstanceMap.get(instance)._rootNodeID; + if (ReactEmptyComponentRegistry.isNullComponentID(id)) { + return null; + } + if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) { + nodeCache[id] = ReactMount.findReactNodeByID(id); + } + return nodeCache[id]; + } + + /** + * A node is "valid" if it is contained by a currently mounted container. + * + * This means that the node does not have to be contained by a document in + * order to be considered valid. + * + * @param {?DOMElement} node The candidate DOM node. + * @param {string} id The expected ID of the node. + * @return {boolean} Whether the node is contained by a mounted container. + */ + function isValid(node, id) { + if (node) { + !(internalGetID(node) === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(false) : undefined; + + var container = ReactMount.findReactContainerForID(id); + if (container && containsNode(container, node)) { + return true; + } + } + + return false; + } + + /** + * Causes the cache to forget about one React-specific ID. + * + * @param {string} id The ID to forget. + */ + function purgeID(id) { + delete nodeCache[id]; + } + + var deepestNodeSoFar = null; + function findDeepestCachedAncestorImpl(ancestorID) { + var ancestor = nodeCache[ancestorID]; + if (ancestor && isValid(ancestor, ancestorID)) { + deepestNodeSoFar = ancestor; + } else { + // This node isn't populated in the cache, so presumably none of its + // descendants are. Break out of the loop. + return false; + } + } + + /** + * Return the deepest cached node whose ID is a prefix of `targetID`. + */ + function findDeepestCachedAncestor(targetID) { + deepestNodeSoFar = null; + ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl); + + var foundNode = deepestNodeSoFar; + deepestNodeSoFar = null; + return foundNode; + } + + /** + * Mounts this component and inserts it into the DOM. + * + * @param {ReactComponent} componentInstance The instance to mount. + * @param {string} rootID DOM ID of the root node. + * @param {DOMElement} container DOM element to mount into. + * @param {ReactReconcileTransaction} transaction + * @param {boolean} shouldReuseMarkup If true, do not insert markup + */ + function mountComponentIntoNode(componentInstance, rootID, container, transaction, shouldReuseMarkup, context) { + if (ReactDOMFeatureFlags.useCreateElement) { + context = assign({}, context); + if (container.nodeType === DOC_NODE_TYPE) { + context[ownerDocumentContextKey] = container; + } else { + context[ownerDocumentContextKey] = container.ownerDocument; + } + } + if (process.env.NODE_ENV !== 'production') { + if (context === emptyObject) { + context = {}; + } + var tag = container.nodeName.toLowerCase(); + context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(null, tag, null); + } + var markup = ReactReconciler.mountComponent(componentInstance, rootID, transaction, context); + componentInstance._renderedComponent._topLevelWrapper = componentInstance; + ReactMount._mountImageIntoNode(markup, container, shouldReuseMarkup, transaction); + } + + /** + * Batched mount. + * + * @param {ReactComponent} componentInstance The instance to mount. + * @param {string} rootID DOM ID of the root node. + * @param {DOMElement} container DOM element to mount into. + * @param {boolean} shouldReuseMarkup If true, do not insert markup + */ + function batchedMountComponentIntoNode(componentInstance, rootID, container, shouldReuseMarkup, context) { + var transaction = ReactUpdates.ReactReconcileTransaction.getPooled( + /* forceHTML */shouldReuseMarkup); + transaction.perform(mountComponentIntoNode, null, componentInstance, rootID, container, transaction, shouldReuseMarkup, context); + ReactUpdates.ReactReconcileTransaction.release(transaction); + } + + /** + * Unmounts a component and removes it from the DOM. + * + * @param {ReactComponent} instance React component instance. + * @param {DOMElement} container DOM element to unmount from. + * @final + * @internal + * @see {ReactMount.unmountComponentAtNode} + */ + function unmountComponentFromNode(instance, container) { + ReactReconciler.unmountComponent(instance); + + if (container.nodeType === DOC_NODE_TYPE) { + container = container.documentElement; + } + + // http://jsperf.com/emptying-a-node + while (container.lastChild) { + container.removeChild(container.lastChild); + } + } + + /** + * True if the supplied DOM node has a direct React-rendered child that is + * not a React root element. Useful for warning in `render`, + * `unmountComponentAtNode`, etc. + * + * @param {?DOMElement} node The candidate DOM node. + * @return {boolean} True if the DOM element contains a direct child that was + * rendered by React but is not a root element. + * @internal + */ + function hasNonRootReactChild(node) { + var reactRootID = getReactRootID(node); + return reactRootID ? reactRootID !== ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID) : false; + } + + /** + * Returns the first (deepest) ancestor of a node which is rendered by this copy + * of React. + */ + function findFirstReactDOMImpl(node) { + // This node might be from another React instance, so we make sure not to + // examine the node cache here + for (; node && node.parentNode !== node; node = node.parentNode) { + if (node.nodeType !== 1) { + // Not a DOMElement, therefore not a React component + continue; + } + var nodeID = internalGetID(node); + if (!nodeID) { + continue; + } + var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID); + + // If containersByReactRootID contains the container we find by crawling up + // the tree, we know that this instance of React rendered the node. + // nb. isValid's strategy (with containsNode) does not work because render + // trees may be nested and we don't want a false positive in that case. + var current = node; + var lastID; + do { + lastID = internalGetID(current); + current = current.parentNode; + if (current == null) { + // The passed-in node has been detached from the container it was + // originally rendered into. + return null; + } + } while (lastID !== reactRootID); + + if (current === containersByReactRootID[reactRootID]) { + return node; + } + } + return null; + } + + /** + * Temporary (?) hack so that we can store all top-level pending updates on + * composites instead of having to worry about different types of components + * here. + */ + var TopLevelWrapper = function () {}; + TopLevelWrapper.prototype.isReactComponent = {}; + if (process.env.NODE_ENV !== 'production') { + TopLevelWrapper.displayName = 'TopLevelWrapper'; + } + TopLevelWrapper.prototype.render = function () { + // this.props is actually a ReactElement + return this.props; + }; + + /** + * Mounting is the process of initializing a React component by creating its + * representative DOM elements and inserting them into a supplied `container`. + * Any prior content inside `container` is destroyed in the process. + * + * ReactMount.render( + * component, + * document.getElementById('container') + * ); + * + * <div id="container"> <-- Supplied `container`. + * <div data-reactid=".3"> <-- Rendered reactRoot of React + * // ... component. + * </div> + * </div> + * + * Inside of `container`, the first element rendered is the "reactRoot". + */ + var ReactMount = { + + TopLevelWrapper: TopLevelWrapper, + + /** Exposed for debugging purposes **/ + _instancesByReactRootID: instancesByReactRootID, + + /** + * This is a hook provided to support rendering React components while + * ensuring that the apparent scroll position of its `container` does not + * change. + * + * @param {DOMElement} container The `container` being rendered into. + * @param {function} renderCallback This must be called once to do the render. + */ + scrollMonitor: function (container, renderCallback) { + renderCallback(); + }, + + /** + * Take a component that's already mounted into the DOM and replace its props + * @param {ReactComponent} prevComponent component instance already in the DOM + * @param {ReactElement} nextElement component instance to render + * @param {DOMElement} container container to render into + * @param {?function} callback function triggered on completion + */ + _updateRootComponent: function (prevComponent, nextElement, container, callback) { + ReactMount.scrollMonitor(container, function () { + ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement); + if (callback) { + ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback); + } + }); + + if (process.env.NODE_ENV !== 'production') { + // Record the root element in case it later gets transplanted. + rootElementsByReactRootID[getReactRootID(container)] = getReactRootElementInContainer(container); + } + + return prevComponent; + }, + + /** + * Register a component into the instance map and starts scroll value + * monitoring + * @param {ReactComponent} nextComponent component instance to render + * @param {DOMElement} container container to render into + * @return {string} reactRoot ID prefix + */ + _registerComponent: function (nextComponent, container) { + !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : undefined; + + ReactBrowserEventEmitter.ensureScrollValueMonitoring(); + + var reactRootID = ReactMount.registerContainer(container); + instancesByReactRootID[reactRootID] = nextComponent; + return reactRootID; + }, + + /** + * Render a new component into the DOM. + * @param {ReactElement} nextElement element to render + * @param {DOMElement} container container to render into + * @param {boolean} shouldReuseMarkup if we should skip the markup insertion + * @return {ReactComponent} nextComponent + */ + _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) { + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined; + + var componentInstance = instantiateReactComponent(nextElement, null); + var reactRootID = ReactMount._registerComponent(componentInstance, container); + + // The initial render is synchronous but any updates that happen during + // rendering, in componentWillMount or componentDidMount, will be batched + // according to the current batching strategy. + + ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, reactRootID, container, shouldReuseMarkup, context); + + if (process.env.NODE_ENV !== 'production') { + // Record the root element in case it later gets transplanted. + rootElementsByReactRootID[reactRootID] = getReactRootElementInContainer(container); + } + + return componentInstance; + }, + + /** + * Renders a React component into the DOM in the supplied `container`. + * + * If the React component was previously rendered into `container`, this will + * perform an update on it and only mutate the DOM as necessary to reflect the + * latest React component. + * + * @param {ReactComponent} parentComponent The conceptual parent of this render tree. + * @param {ReactElement} nextElement Component element to render. + * @param {DOMElement} container DOM element to render into. + * @param {?function} callback function triggered on completion + * @return {ReactComponent} Component instance rendered in `container`. + */ + renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { + !(parentComponent != null && parentComponent._reactInternalInstance != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : undefined; + return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback); + }, + + _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { + !ReactElement.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing an element string, make sure to instantiate ' + 'it by passing it to React.createElement.' : typeof nextElement === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : + // Check if it quacks like an element + nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : undefined; + + process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : undefined; + + var nextWrappedElement = new ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement); + + var prevComponent = instancesByReactRootID[getReactRootID(container)]; + + if (prevComponent) { + var prevWrappedElement = prevComponent._currentElement; + var prevElement = prevWrappedElement.props; + if (shouldUpdateReactComponent(prevElement, nextElement)) { + var publicInst = prevComponent._renderedComponent.getPublicInstance(); + var updatedCallback = callback && function () { + callback.call(publicInst); + }; + ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback); + return publicInst; + } else { + ReactMount.unmountComponentAtNode(container); + } + } + + var reactRootElement = getReactRootElementInContainer(container); + var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement); + var containerHasNonRootReactChild = hasNonRootReactChild(container); + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : undefined; + + if (!containerHasReactMarkup || reactRootElement.nextSibling) { + var rootElementSibling = reactRootElement; + while (rootElementSibling) { + if (internalGetID(rootElementSibling)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : undefined; + break; + } + rootElementSibling = rootElementSibling.nextSibling; + } + } + } + + var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild; + var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance(); + if (callback) { + callback.call(component); + } + return component; + }, + + /** + * Renders a React component into the DOM in the supplied `container`. + * + * If the React component was previously rendered into `container`, this will + * perform an update on it and only mutate the DOM as necessary to reflect the + * latest React component. + * + * @param {ReactElement} nextElement Component element to render. + * @param {DOMElement} container DOM element to render into. + * @param {?function} callback function triggered on completion + * @return {ReactComponent} Component instance rendered in `container`. + */ + render: function (nextElement, container, callback) { + return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback); + }, + + /** + * Registers a container node into which React components will be rendered. + * This also creates the "reactRoot" ID that will be assigned to the element + * rendered within. + * + * @param {DOMElement} container DOM element to register as a container. + * @return {string} The "reactRoot" ID of elements rendered within. + */ + registerContainer: function (container) { + var reactRootID = getReactRootID(container); + if (reactRootID) { + // If one exists, make sure it is a valid "reactRoot" ID. + reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID); + } + if (!reactRootID) { + // No valid "reactRoot" ID found, create one. + reactRootID = ReactInstanceHandles.createReactRootID(); + } + containersByReactRootID[reactRootID] = container; + return reactRootID; + }, + + /** + * Unmounts and destroys the React component rendered in the `container`. + * + * @param {DOMElement} container DOM element containing a React component. + * @return {boolean} True if a component was found in and unmounted from + * `container` + */ + unmountComponentAtNode: function (container) { + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. (Strictly speaking, unmounting won't cause a + // render but we still don't expect to be in a render call here.) + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined; + + !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : undefined; + + var reactRootID = getReactRootID(container); + var component = instancesByReactRootID[reactRootID]; + if (!component) { + // Check if the node being unmounted was rendered by React, but isn't a + // root node. + var containerHasNonRootReactChild = hasNonRootReactChild(container); + + // Check if the container itself is a React root node. + var containerID = internalGetID(container); + var isContainerReactRoot = containerID && containerID === ReactInstanceHandles.getReactRootIDFromNodeID(containerID); + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : undefined; + } + + return false; + } + ReactUpdates.batchedUpdates(unmountComponentFromNode, component, container); + delete instancesByReactRootID[reactRootID]; + delete containersByReactRootID[reactRootID]; + if (process.env.NODE_ENV !== 'production') { + delete rootElementsByReactRootID[reactRootID]; + } + return true; + }, + + /** + * Finds the container DOM element that contains React component to which the + * supplied DOM `id` belongs. + * + * @param {string} id The ID of an element rendered by a React component. + * @return {?DOMElement} DOM element that contains the `id`. + */ + findReactContainerForID: function (id) { + var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id); + var container = containersByReactRootID[reactRootID]; + + if (process.env.NODE_ENV !== 'production') { + var rootElement = rootElementsByReactRootID[reactRootID]; + if (rootElement && rootElement.parentNode !== container) { + process.env.NODE_ENV !== 'production' ? warning( + // Call internalGetID here because getID calls isValid which calls + // findReactContainerForID (this function). + internalGetID(rootElement) === reactRootID, 'ReactMount: Root element ID differed from reactRootID.') : undefined; + var containerChild = container.firstChild; + if (containerChild && reactRootID === internalGetID(containerChild)) { + // If the container has a new child with the same ID as the old + // root element, then rootElementsByReactRootID[reactRootID] is + // just stale and needs to be updated. The case that deserves a + // warning is when the container is empty. + rootElementsByReactRootID[reactRootID] = containerChild; + } else { + process.env.NODE_ENV !== 'production' ? warning(false, 'ReactMount: Root element has been removed from its original ' + 'container. New container: %s', rootElement.parentNode) : undefined; + } + } + } + + return container; + }, + + /** + * Finds an element rendered by React with the supplied ID. + * + * @param {string} id ID of a DOM node in the React component. + * @return {DOMElement} Root DOM node of the React component. + */ + findReactNodeByID: function (id) { + var reactRoot = ReactMount.findReactContainerForID(id); + return ReactMount.findComponentRoot(reactRoot, id); + }, + + /** + * Traverses up the ancestors of the supplied node to find a node that is a + * DOM representation of a React component rendered by this copy of React. + * + * @param {*} node + * @return {?DOMEventTarget} + * @internal + */ + getFirstReactDOM: function (node) { + return findFirstReactDOMImpl(node); + }, + + /** + * Finds a node with the supplied `targetID` inside of the supplied + * `ancestorNode`. Exploits the ID naming scheme to perform the search + * quickly. + * + * @param {DOMEventTarget} ancestorNode Search from this root. + * @pararm {string} targetID ID of the DOM representation of the component. + * @return {DOMEventTarget} DOM node with the supplied `targetID`. + * @internal + */ + findComponentRoot: function (ancestorNode, targetID) { + var firstChildren = findComponentRootReusableArray; + var childIndex = 0; + + var deepestAncestor = findDeepestCachedAncestor(targetID) || ancestorNode; + + if (process.env.NODE_ENV !== 'production') { + // This will throw on the next line; give an early warning + process.env.NODE_ENV !== 'production' ? warning(deepestAncestor != null, 'React can\'t find the root component node for data-reactid value ' + '`%s`. If you\'re seeing this message, it probably means that ' + 'you\'ve loaded two copies of React on the page. At this time, only ' + 'a single copy of React can be loaded at a time.', targetID) : undefined; + } + + firstChildren[0] = deepestAncestor.firstChild; + firstChildren.length = 1; + + while (childIndex < firstChildren.length) { + var child = firstChildren[childIndex++]; + var targetChild; + + while (child) { + var childID = ReactMount.getID(child); + if (childID) { + // Even if we find the node we're looking for, we finish looping + // through its siblings to ensure they're cached so that we don't have + // to revisit this node again. Otherwise, we make n^2 calls to getID + // when visiting the many children of a single node in order. + + if (targetID === childID) { + targetChild = child; + } else if (ReactInstanceHandles.isAncestorIDOf(childID, targetID)) { + // If we find a child whose ID is an ancestor of the given ID, + // then we can be sure that we only want to search the subtree + // rooted at this child, so we can throw out the rest of the + // search state. + firstChildren.length = childIndex = 0; + firstChildren.push(child.firstChild); + } + } else { + // If this child had no ID, then there's a chance that it was + // injected automatically by the browser, as when a `<table>` + // element sprouts an extra `<tbody>` child as a side effect of + // `.innerHTML` parsing. Optimistically continue down this + // branch, but not before examining the other siblings. + firstChildren.push(child.firstChild); + } + + child = child.nextSibling; + } + + if (targetChild) { + // Emptying firstChildren/findComponentRootReusableArray is + // not necessary for correctness, but it helps the GC reclaim + // any nodes that were left at the end of the search. + firstChildren.length = 0; + + return targetChild; + } + } + + firstChildren.length = 0; + + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + 'usually due to forgetting a <tbody> when using tables, nesting tags ' + 'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' + 'parent. ' + 'Try inspecting the child nodes of the element with React ID `%s`.', targetID, ReactMount.getID(ancestorNode)) : invariant(false) : undefined; + }, + + _mountImageIntoNode: function (markup, container, shouldReuseMarkup, transaction) { + !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : undefined; + + if (shouldReuseMarkup) { + var rootElement = getReactRootElementInContainer(container); + if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) { + return; + } else { + var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); + rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); + + var rootMarkup = rootElement.outerHTML; + rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum); + + var normalizedMarkup = markup; + if (process.env.NODE_ENV !== 'production') { + // because rootMarkup is retrieved from the DOM, various normalizations + // will have occurred which will not be present in `markup`. Here, + // insert markup into a <div> or <iframe> depending on the container + // type to perform the same normalizations before comparing. + var normalizer; + if (container.nodeType === ELEMENT_NODE_TYPE) { + normalizer = document.createElement('div'); + normalizer.innerHTML = markup; + normalizedMarkup = normalizer.innerHTML; + } else { + normalizer = document.createElement('iframe'); + document.body.appendChild(normalizer); + normalizer.contentDocument.write(markup); + normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML; + document.body.removeChild(normalizer); + } + } + + var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup); + var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20); + + !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\n%s', difference) : invariant(false) : undefined; + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : undefined; + } + } + } + + !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See ReactDOMServer.renderToString() for server rendering.') : invariant(false) : undefined; + + if (transaction.useCreateElement) { + while (container.lastChild) { + container.removeChild(container.lastChild); + } + container.appendChild(markup); + } else { + setInnerHTML(container, markup); + } + }, + + ownerDocumentContextKey: ownerDocumentContextKey, + + /** + * React ID utilities. + */ + + getReactRootID: getReactRootID, + + getID: getID, + + setID: setID, + + getNode: getNode, + + getNodeFromInstance: getNodeFromInstance, + + isValid: isValid, + + purgeID: purgeID + }; + + ReactPerf.measureMethods(ReactMount, 'ReactMount', { + _renderNewRootComponent: '_renderNewRootComponent', + _mountImageIntoNode: '_mountImageIntoNode' + }); + + module.exports = ReactMount; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 218 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactBrowserEventEmitter + * @typechecks static-only + */ + + 'use strict'; + + var EventConstants = __webpack_require__(219); + var EventPluginHub = __webpack_require__(220); + var EventPluginRegistry = __webpack_require__(221); + var ReactEventEmitterMixin = __webpack_require__(226); + var ReactPerf = __webpack_require__(207); + var ViewportMetrics = __webpack_require__(227); + + var assign = __webpack_require__(228); + var isEventSupported = __webpack_require__(229); + + /** + * Summary of `ReactBrowserEventEmitter` event handling: + * + * - Top-level delegation is used to trap most native browser events. This + * may only occur in the main thread and is the responsibility of + * ReactEventListener, which is injected and can therefore support pluggable + * event sources. This is the only work that occurs in the main thread. + * + * - We normalize and de-duplicate events to account for browser quirks. This + * may be done in the worker thread. + * + * - Forward these native events (with the associated top-level type used to + * trap it) to `EventPluginHub`, which in turn will ask plugins if they want + * to extract any synthetic events. + * + * - The `EventPluginHub` will then process each event by annotating them with + * "dispatches", a sequence of listeners and IDs that care about that event. + * + * - The `EventPluginHub` then dispatches the events. + * + * Overview of React and the event system: + * + * +------------+ . + * | DOM | . + * +------------+ . + * | . + * v . + * +------------+ . + * | ReactEvent | . + * | Listener | . + * +------------+ . +-----------+ + * | . +--------+|SimpleEvent| + * | . | |Plugin | + * +-----|------+ . v +-----------+ + * | | | . +--------------+ +------------+ + * | +-----------.--->|EventPluginHub| | Event | + * | | . | | +-----------+ | Propagators| + * | ReactEvent | . | | |TapEvent | |------------| + * | Emitter | . | |<---+|Plugin | |other plugin| + * | | . | | +-----------+ | utilities | + * | +-----------.--->| | +------------+ + * | | | . +--------------+ + * +-----|------+ . ^ +-----------+ + * | . | |Enter/Leave| + * + . +-------+|Plugin | + * +-------------+ . +-----------+ + * | application | . + * |-------------| . + * | | . + * | | . + * +-------------+ . + * . + * React Core . General Purpose Event Plugin System + */ + + var alreadyListeningTo = {}; + var isMonitoringScrollValue = false; + var reactTopListenersCounter = 0; + + // For events like 'submit' which don't consistently bubble (which we trap at a + // lower node than `document`), binding at `document` would cause duplicate + // events so we don't include them here + var topEventMapping = { + topAbort: 'abort', + topBlur: 'blur', + topCanPlay: 'canplay', + topCanPlayThrough: 'canplaythrough', + topChange: 'change', + topClick: 'click', + topCompositionEnd: 'compositionend', + topCompositionStart: 'compositionstart', + topCompositionUpdate: 'compositionupdate', + topContextMenu: 'contextmenu', + topCopy: 'copy', + topCut: 'cut', + topDoubleClick: 'dblclick', + topDrag: 'drag', + topDragEnd: 'dragend', + topDragEnter: 'dragenter', + topDragExit: 'dragexit', + topDragLeave: 'dragleave', + topDragOver: 'dragover', + topDragStart: 'dragstart', + topDrop: 'drop', + topDurationChange: 'durationchange', + topEmptied: 'emptied', + topEncrypted: 'encrypted', + topEnded: 'ended', + topError: 'error', + topFocus: 'focus', + topInput: 'input', + topKeyDown: 'keydown', + topKeyPress: 'keypress', + topKeyUp: 'keyup', + topLoadedData: 'loadeddata', + topLoadedMetadata: 'loadedmetadata', + topLoadStart: 'loadstart', + topMouseDown: 'mousedown', + topMouseMove: 'mousemove', + topMouseOut: 'mouseout', + topMouseOver: 'mouseover', + topMouseUp: 'mouseup', + topPaste: 'paste', + topPause: 'pause', + topPlay: 'play', + topPlaying: 'playing', + topProgress: 'progress', + topRateChange: 'ratechange', + topScroll: 'scroll', + topSeeked: 'seeked', + topSeeking: 'seeking', + topSelectionChange: 'selectionchange', + topStalled: 'stalled', + topSuspend: 'suspend', + topTextInput: 'textInput', + topTimeUpdate: 'timeupdate', + topTouchCancel: 'touchcancel', + topTouchEnd: 'touchend', + topTouchMove: 'touchmove', + topTouchStart: 'touchstart', + topVolumeChange: 'volumechange', + topWaiting: 'waiting', + topWheel: 'wheel' + }; + + /** + * To ensure no conflicts with other potential React instances on the page + */ + var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2); + + function getListeningForDocument(mountAt) { + // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty` + // directly. + if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) { + mountAt[topListenersIDKey] = reactTopListenersCounter++; + alreadyListeningTo[mountAt[topListenersIDKey]] = {}; + } + return alreadyListeningTo[mountAt[topListenersIDKey]]; + } + + /** + * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For + * example: + * + * ReactBrowserEventEmitter.putListener('myID', 'onClick', myFunction); + * + * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'. + * + * @internal + */ + var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, { + + /** + * Injectable event backend + */ + ReactEventListener: null, + + injection: { + /** + * @param {object} ReactEventListener + */ + injectReactEventListener: function (ReactEventListener) { + ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel); + ReactBrowserEventEmitter.ReactEventListener = ReactEventListener; + } + }, + + /** + * Sets whether or not any created callbacks should be enabled. + * + * @param {boolean} enabled True if callbacks should be enabled. + */ + setEnabled: function (enabled) { + if (ReactBrowserEventEmitter.ReactEventListener) { + ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled); + } + }, + + /** + * @return {boolean} True if callbacks are enabled. + */ + isEnabled: function () { + return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled()); + }, + + /** + * We listen for bubbled touch events on the document object. + * + * Firefox v8.01 (and possibly others) exhibited strange behavior when + * mounting `onmousemove` events at some node that was not the document + * element. The symptoms were that if your mouse is not moving over something + * contained within that mount point (for example on the background) the + * top-level listeners for `onmousemove` won't be called. However, if you + * register the `mousemove` on the document object, then it will of course + * catch all `mousemove`s. This along with iOS quirks, justifies restricting + * top-level listeners to the document object only, at least for these + * movement types of events and possibly all events. + * + * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html + * + * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but + * they bubble to document. + * + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @param {object} contentDocumentHandle Document which owns the container + */ + listenTo: function (registrationName, contentDocumentHandle) { + var mountAt = contentDocumentHandle; + var isListening = getListeningForDocument(mountAt); + var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName]; + + var topLevelTypes = EventConstants.topLevelTypes; + for (var i = 0; i < dependencies.length; i++) { + var dependency = dependencies[i]; + if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) { + if (dependency === topLevelTypes.topWheel) { + if (isEventSupported('wheel')) { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt); + } else if (isEventSupported('mousewheel')) { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt); + } else { + // Firefox needs to capture a different mouse scroll event. + // @see http://www.quirksmode.org/dom/events/tests/scroll.html + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt); + } + } else if (dependency === topLevelTypes.topScroll) { + + if (isEventSupported('scroll', true)) { + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt); + } else { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE); + } + } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) { + + if (isEventSupported('focus', true)) { + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt); + } else if (isEventSupported('focusin')) { + // IE has `focusin` and `focusout` events which bubble. + // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt); + } + + // to make sure blur and focus event listeners are only attached once + isListening[topLevelTypes.topBlur] = true; + isListening[topLevelTypes.topFocus] = true; + } else if (topEventMapping.hasOwnProperty(dependency)) { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt); + } + + isListening[dependency] = true; + } + } + }, + + trapBubbledEvent: function (topLevelType, handlerBaseName, handle) { + return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle); + }, + + trapCapturedEvent: function (topLevelType, handlerBaseName, handle) { + return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle); + }, + + /** + * Listens to window scroll and resize events. We cache scroll values so that + * application code can access them without triggering reflows. + * + * NOTE: Scroll events do not bubble. + * + * @see http://www.quirksmode.org/dom/events/scroll.html + */ + ensureScrollValueMonitoring: function () { + if (!isMonitoringScrollValue) { + var refresh = ViewportMetrics.refreshScrollValues; + ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh); + isMonitoringScrollValue = true; + } + }, + + eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs, + + registrationNameModules: EventPluginHub.registrationNameModules, + + putListener: EventPluginHub.putListener, + + getListener: EventPluginHub.getListener, + + deleteListener: EventPluginHub.deleteListener, + + deleteAllListeners: EventPluginHub.deleteAllListeners + + }); + + ReactPerf.measureMethods(ReactBrowserEventEmitter, 'ReactBrowserEventEmitter', { + putListener: 'putListener', + deleteListener: 'deleteListener' + }); + + module.exports = ReactBrowserEventEmitter; + +/***/ }, +/* 219 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EventConstants + */ + + 'use strict'; + + var keyMirror = __webpack_require__(206); + + var PropagationPhases = keyMirror({ bubbled: null, captured: null }); + + /** + * Types of raw signals from the browser caught at the top level. + */ + var topLevelTypes = keyMirror({ + topAbort: null, + topBlur: null, + topCanPlay: null, + topCanPlayThrough: null, + topChange: null, + topClick: null, + topCompositionEnd: null, + topCompositionStart: null, + topCompositionUpdate: null, + topContextMenu: null, + topCopy: null, + topCut: null, + topDoubleClick: null, + topDrag: null, + topDragEnd: null, + topDragEnter: null, + topDragExit: null, + topDragLeave: null, + topDragOver: null, + topDragStart: null, + topDrop: null, + topDurationChange: null, + topEmptied: null, + topEncrypted: null, + topEnded: null, + topError: null, + topFocus: null, + topInput: null, + topKeyDown: null, + topKeyPress: null, + topKeyUp: null, + topLoad: null, + topLoadedData: null, + topLoadedMetadata: null, + topLoadStart: null, + topMouseDown: null, + topMouseMove: null, + topMouseOut: null, + topMouseOver: null, + topMouseUp: null, + topPaste: null, + topPause: null, + topPlay: null, + topPlaying: null, + topProgress: null, + topRateChange: null, + topReset: null, + topScroll: null, + topSeeked: null, + topSeeking: null, + topSelectionChange: null, + topStalled: null, + topSubmit: null, + topSuspend: null, + topTextInput: null, + topTimeUpdate: null, + topTouchCancel: null, + topTouchEnd: null, + topTouchMove: null, + topTouchStart: null, + topVolumeChange: null, + topWaiting: null, + topWheel: null + }); + + var EventConstants = { + topLevelTypes: topLevelTypes, + PropagationPhases: PropagationPhases + }; + + module.exports = EventConstants; + +/***/ }, +/* 220 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EventPluginHub + */ + + 'use strict'; + + var EventPluginRegistry = __webpack_require__(221); + var EventPluginUtils = __webpack_require__(222); + var ReactErrorUtils = __webpack_require__(223); + + var accumulateInto = __webpack_require__(224); + var forEachAccumulated = __webpack_require__(225); + var invariant = __webpack_require__(202); + var warning = __webpack_require__(214); + + /** + * Internal store for event listeners + */ + var listenerBank = {}; + + /** + * Internal queue of events that have accumulated their dispatches and are + * waiting to have their dispatches executed. + */ + var eventQueue = null; + + /** + * Dispatches an event and releases it back into the pool, unless persistent. + * + * @param {?object} event Synthetic event to be dispatched. + * @param {boolean} simulated If the event is simulated (changes exn behavior) + * @private + */ + var executeDispatchesAndRelease = function (event, simulated) { + if (event) { + EventPluginUtils.executeDispatchesInOrder(event, simulated); + + if (!event.isPersistent()) { + event.constructor.release(event); + } + } + }; + var executeDispatchesAndReleaseSimulated = function (e) { + return executeDispatchesAndRelease(e, true); + }; + var executeDispatchesAndReleaseTopLevel = function (e) { + return executeDispatchesAndRelease(e, false); + }; + + /** + * - `InstanceHandle`: [required] Module that performs logical traversals of DOM + * hierarchy given ids of the logical DOM elements involved. + */ + var InstanceHandle = null; + + function validateInstanceHandle() { + var valid = InstanceHandle && InstanceHandle.traverseTwoPhase && InstanceHandle.traverseEnterLeave; + process.env.NODE_ENV !== 'production' ? warning(valid, 'InstanceHandle not injected before use!') : undefined; + } + + /** + * This is a unified interface for event plugins to be installed and configured. + * + * Event plugins can implement the following properties: + * + * `extractEvents` {function(string, DOMEventTarget, string, object): *} + * Required. When a top-level event is fired, this method is expected to + * extract synthetic events that will in turn be queued and dispatched. + * + * `eventTypes` {object} + * Optional, plugins that fire events must publish a mapping of registration + * names that are used to register listeners. Values of this mapping must + * be objects that contain `registrationName` or `phasedRegistrationNames`. + * + * `executeDispatch` {function(object, function, string)} + * Optional, allows plugins to override how an event gets dispatched. By + * default, the listener is simply invoked. + * + * Each plugin that is injected into `EventsPluginHub` is immediately operable. + * + * @public + */ + var EventPluginHub = { + + /** + * Methods for injecting dependencies. + */ + injection: { + + /** + * @param {object} InjectedMount + * @public + */ + injectMount: EventPluginUtils.injection.injectMount, + + /** + * @param {object} InjectedInstanceHandle + * @public + */ + injectInstanceHandle: function (InjectedInstanceHandle) { + InstanceHandle = InjectedInstanceHandle; + if (process.env.NODE_ENV !== 'production') { + validateInstanceHandle(); + } + }, + + getInstanceHandle: function () { + if (process.env.NODE_ENV !== 'production') { + validateInstanceHandle(); + } + return InstanceHandle; + }, + + /** + * @param {array} InjectedEventPluginOrder + * @public + */ + injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder, + + /** + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + */ + injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName + + }, + + eventNameDispatchConfigs: EventPluginRegistry.eventNameDispatchConfigs, + + registrationNameModules: EventPluginRegistry.registrationNameModules, + + /** + * Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent. + * + * @param {string} id ID of the DOM element. + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @param {?function} listener The callback to store. + */ + putListener: function (id, registrationName, listener) { + !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : undefined; + + var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {}); + bankForRegistrationName[id] = listener; + + var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; + if (PluginModule && PluginModule.didPutListener) { + PluginModule.didPutListener(id, registrationName, listener); + } + }, + + /** + * @param {string} id ID of the DOM element. + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @return {?function} The stored callback. + */ + getListener: function (id, registrationName) { + var bankForRegistrationName = listenerBank[registrationName]; + return bankForRegistrationName && bankForRegistrationName[id]; + }, + + /** + * Deletes a listener from the registration bank. + * + * @param {string} id ID of the DOM element. + * @param {string} registrationName Name of listener (e.g. `onClick`). + */ + deleteListener: function (id, registrationName) { + var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; + if (PluginModule && PluginModule.willDeleteListener) { + PluginModule.willDeleteListener(id, registrationName); + } + + var bankForRegistrationName = listenerBank[registrationName]; + // TODO: This should never be null -- when is it? + if (bankForRegistrationName) { + delete bankForRegistrationName[id]; + } + }, + + /** + * Deletes all listeners for the DOM element with the supplied ID. + * + * @param {string} id ID of the DOM element. + */ + deleteAllListeners: function (id) { + for (var registrationName in listenerBank) { + if (!listenerBank[registrationName][id]) { + continue; + } + + var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; + if (PluginModule && PluginModule.willDeleteListener) { + PluginModule.willDeleteListener(id, registrationName); + } + + delete listenerBank[registrationName][id]; + } + }, + + /** + * Allows registered plugins an opportunity to extract events from top-level + * native browser events. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @internal + */ + extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) { + var events; + var plugins = EventPluginRegistry.plugins; + for (var i = 0; i < plugins.length; i++) { + // Not every plugin in the ordering may be loaded at runtime. + var possiblePlugin = plugins[i]; + if (possiblePlugin) { + var extractedEvents = possiblePlugin.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget); + if (extractedEvents) { + events = accumulateInto(events, extractedEvents); + } + } + } + return events; + }, + + /** + * Enqueues a synthetic event that should be dispatched when + * `processEventQueue` is invoked. + * + * @param {*} events An accumulation of synthetic events. + * @internal + */ + enqueueEvents: function (events) { + if (events) { + eventQueue = accumulateInto(eventQueue, events); + } + }, + + /** + * Dispatches all synthetic events on the event queue. + * + * @internal + */ + processEventQueue: function (simulated) { + // Set `eventQueue` to null before processing it so that we can tell if more + // events get enqueued while processing. + var processingEventQueue = eventQueue; + eventQueue = null; + if (simulated) { + forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); + } else { + forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); + } + !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : undefined; + // This would be a good time to rethrow if any of the event handlers threw. + ReactErrorUtils.rethrowCaughtError(); + }, + + /** + * These are needed for tests only. Do not use! + */ + __purge: function () { + listenerBank = {}; + }, + + __getListenerBank: function () { + return listenerBank; + } + + }; + + module.exports = EventPluginHub; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 221 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EventPluginRegistry + * @typechecks static-only + */ + + 'use strict'; + + var invariant = __webpack_require__(202); + + /** + * Injectable ordering of event plugins. + */ + var EventPluginOrder = null; + + /** + * Injectable mapping from names to event plugin modules. + */ + var namesToPlugins = {}; + + /** + * Recomputes the plugin list using the injected plugins and plugin ordering. + * + * @private + */ + function recomputePluginOrdering() { + if (!EventPluginOrder) { + // Wait until an `EventPluginOrder` is injected. + return; + } + for (var pluginName in namesToPlugins) { + var PluginModule = namesToPlugins[pluginName]; + var pluginIndex = EventPluginOrder.indexOf(pluginName); + !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : undefined; + if (EventPluginRegistry.plugins[pluginIndex]) { + continue; + } + !PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : undefined; + EventPluginRegistry.plugins[pluginIndex] = PluginModule; + var publishedEvents = PluginModule.eventTypes; + for (var eventName in publishedEvents) { + !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : undefined; + } + } + } + + /** + * Publishes an event so that it can be dispatched by the supplied plugin. + * + * @param {object} dispatchConfig Dispatch configuration for the event. + * @param {object} PluginModule Plugin publishing the event. + * @return {boolean} True if the event was successfully published. + * @private + */ + function publishEventForPlugin(dispatchConfig, PluginModule, eventName) { + !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : undefined; + EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; + + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) { + if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, PluginModule, eventName); + } + } + return true; + } else if (dispatchConfig.registrationName) { + publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName); + return true; + } + return false; + } + + /** + * Publishes a registration name that is used to identify dispatched events and + * can be used with `EventPluginHub.putListener` to register listeners. + * + * @param {string} registrationName Registration name to add. + * @param {object} PluginModule Plugin publishing the event. + * @private + */ + function publishRegistrationName(registrationName, PluginModule, eventName) { + !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : undefined; + EventPluginRegistry.registrationNameModules[registrationName] = PluginModule; + EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies; + } + + /** + * Registers plugins so that they can extract and dispatch events. + * + * @see {EventPluginHub} + */ + var EventPluginRegistry = { + + /** + * Ordered list of injected plugins. + */ + plugins: [], + + /** + * Mapping from event name to dispatch config + */ + eventNameDispatchConfigs: {}, + + /** + * Mapping from registration name to plugin module + */ + registrationNameModules: {}, + + /** + * Mapping from registration name to event name + */ + registrationNameDependencies: {}, + + /** + * Injects an ordering of plugins (by plugin name). This allows the ordering + * to be decoupled from injection of the actual plugins so that ordering is + * always deterministic regardless of packaging, on-the-fly injection, etc. + * + * @param {array} InjectedEventPluginOrder + * @internal + * @see {EventPluginHub.injection.injectEventPluginOrder} + */ + injectEventPluginOrder: function (InjectedEventPluginOrder) { + !!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : undefined; + // Clone the ordering so it cannot be dynamically mutated. + EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder); + recomputePluginOrdering(); + }, + + /** + * Injects plugins to be used by `EventPluginHub`. The plugin names must be + * in the ordering injected by `injectEventPluginOrder`. + * + * Plugins can be injected as part of page initialization or on-the-fly. + * + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + * @internal + * @see {EventPluginHub.injection.injectEventPluginsByName} + */ + injectEventPluginsByName: function (injectedNamesToPlugins) { + var isOrderingDirty = false; + for (var pluginName in injectedNamesToPlugins) { + if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { + continue; + } + var PluginModule = injectedNamesToPlugins[pluginName]; + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) { + !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : undefined; + namesToPlugins[pluginName] = PluginModule; + isOrderingDirty = true; + } + } + if (isOrderingDirty) { + recomputePluginOrdering(); + } + }, + + /** + * Looks up the plugin for the supplied event. + * + * @param {object} event A synthetic event. + * @return {?object} The plugin that created the supplied event. + * @internal + */ + getPluginModuleForEvent: function (event) { + var dispatchConfig = event.dispatchConfig; + if (dispatchConfig.registrationName) { + return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null; + } + for (var phase in dispatchConfig.phasedRegistrationNames) { + if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) { + continue; + } + var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]]; + if (PluginModule) { + return PluginModule; + } + } + return null; + }, + + /** + * Exposed for unit testing. + * @private + */ + _resetEventPlugins: function () { + EventPluginOrder = null; + for (var pluginName in namesToPlugins) { + if (namesToPlugins.hasOwnProperty(pluginName)) { + delete namesToPlugins[pluginName]; + } + } + EventPluginRegistry.plugins.length = 0; + + var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs; + for (var eventName in eventNameDispatchConfigs) { + if (eventNameDispatchConfigs.hasOwnProperty(eventName)) { + delete eventNameDispatchConfigs[eventName]; + } + } + + var registrationNameModules = EventPluginRegistry.registrationNameModules; + for (var registrationName in registrationNameModules) { + if (registrationNameModules.hasOwnProperty(registrationName)) { + delete registrationNameModules[registrationName]; + } + } + } + + }; + + module.exports = EventPluginRegistry; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 222 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EventPluginUtils + */ + + 'use strict'; + + var EventConstants = __webpack_require__(219); + var ReactErrorUtils = __webpack_require__(223); + + var invariant = __webpack_require__(202); + var warning = __webpack_require__(214); + + /** + * Injected dependencies: + */ + + /** + * - `Mount`: [required] Module that can convert between React dom IDs and + * actual node references. + */ + var injection = { + Mount: null, + injectMount: function (InjectedMount) { + injection.Mount = InjectedMount; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(InjectedMount && InjectedMount.getNode && InjectedMount.getID, 'EventPluginUtils.injection.injectMount(...): Injected Mount ' + 'module is missing getNode or getID.') : undefined; + } + } + }; + + var topLevelTypes = EventConstants.topLevelTypes; + + function isEndish(topLevelType) { + return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel; + } + + function isMoveish(topLevelType) { + return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove; + } + function isStartish(topLevelType) { + return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart; + } + + var validateEventDispatches; + if (process.env.NODE_ENV !== 'production') { + validateEventDispatches = function (event) { + var dispatchListeners = event._dispatchListeners; + var dispatchIDs = event._dispatchIDs; + + var listenersIsArr = Array.isArray(dispatchListeners); + var idsIsArr = Array.isArray(dispatchIDs); + var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0; + var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; + + process.env.NODE_ENV !== 'production' ? warning(idsIsArr === listenersIsArr && IDsLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : undefined; + }; + } + + /** + * Dispatch the event to the listener. + * @param {SyntheticEvent} event SyntheticEvent to handle + * @param {boolean} simulated If the event is simulated (changes exn behavior) + * @param {function} listener Application-level callback + * @param {string} domID DOM id to pass to the callback. + */ + function executeDispatch(event, simulated, listener, domID) { + var type = event.type || 'unknown-event'; + event.currentTarget = injection.Mount.getNode(domID); + if (simulated) { + ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event, domID); + } else { + ReactErrorUtils.invokeGuardedCallback(type, listener, event, domID); + } + event.currentTarget = null; + } + + /** + * Standard/simple iteration through an event's collected dispatches. + */ + function executeDispatchesInOrder(event, simulated) { + var dispatchListeners = event._dispatchListeners; + var dispatchIDs = event._dispatchIDs; + if (process.env.NODE_ENV !== 'production') { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + // Listeners and IDs are two parallel arrays that are always in sync. + executeDispatch(event, simulated, dispatchListeners[i], dispatchIDs[i]); + } + } else if (dispatchListeners) { + executeDispatch(event, simulated, dispatchListeners, dispatchIDs); + } + event._dispatchListeners = null; + event._dispatchIDs = null; + } + + /** + * Standard/simple iteration through an event's collected dispatches, but stops + * at the first dispatch execution returning true, and returns that id. + * + * @return {?string} id of the first dispatch execution who's listener returns + * true, or null if no listener returned true. + */ + function executeDispatchesInOrderStopAtTrueImpl(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchIDs = event._dispatchIDs; + if (process.env.NODE_ENV !== 'production') { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + // Listeners and IDs are two parallel arrays that are always in sync. + if (dispatchListeners[i](event, dispatchIDs[i])) { + return dispatchIDs[i]; + } + } + } else if (dispatchListeners) { + if (dispatchListeners(event, dispatchIDs)) { + return dispatchIDs; + } + } + return null; + } + + /** + * @see executeDispatchesInOrderStopAtTrueImpl + */ + function executeDispatchesInOrderStopAtTrue(event) { + var ret = executeDispatchesInOrderStopAtTrueImpl(event); + event._dispatchIDs = null; + event._dispatchListeners = null; + return ret; + } + + /** + * Execution of a "direct" dispatch - there must be at most one dispatch + * accumulated on the event or it is considered an error. It doesn't really make + * sense for an event with multiple dispatches (bubbled) to keep track of the + * return values at each dispatch execution, but it does tend to make sense when + * dealing with "direct" dispatches. + * + * @return {*} The return value of executing the single dispatch. + */ + function executeDirectDispatch(event) { + if (process.env.NODE_ENV !== 'production') { + validateEventDispatches(event); + } + var dispatchListener = event._dispatchListeners; + var dispatchID = event._dispatchIDs; + !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : undefined; + var res = dispatchListener ? dispatchListener(event, dispatchID) : null; + event._dispatchListeners = null; + event._dispatchIDs = null; + return res; + } + + /** + * @param {SyntheticEvent} event + * @return {boolean} True iff number of dispatches accumulated is greater than 0. + */ + function hasDispatches(event) { + return !!event._dispatchListeners; + } + + /** + * General utilities that are useful in creating custom Event Plugins. + */ + var EventPluginUtils = { + isEndish: isEndish, + isMoveish: isMoveish, + isStartish: isStartish, + + executeDirectDispatch: executeDirectDispatch, + executeDispatchesInOrder: executeDispatchesInOrder, + executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, + hasDispatches: hasDispatches, + + getNode: function (id) { + return injection.Mount.getNode(id); + }, + getID: function (node) { + return injection.Mount.getID(node); + }, + + injection: injection + }; + + module.exports = EventPluginUtils; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 223 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactErrorUtils + * @typechecks + */ + + 'use strict'; + + var caughtError = null; + + /** + * Call a function while guarding against errors that happens within it. + * + * @param {?String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} a First argument + * @param {*} b Second argument + */ + function invokeGuardedCallback(name, func, a, b) { + try { + return func(a, b); + } catch (x) { + if (caughtError === null) { + caughtError = x; + } + return undefined; + } + } + + var ReactErrorUtils = { + invokeGuardedCallback: invokeGuardedCallback, + + /** + * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event + * handler are sure to be rethrown by rethrowCaughtError. + */ + invokeGuardedCallbackWithCatch: invokeGuardedCallback, + + /** + * During execution of guarded functions we will capture the first error which + * we will rethrow to be handled by the top level error handler. + */ + rethrowCaughtError: function () { + if (caughtError) { + var error = caughtError; + caughtError = null; + throw error; + } + } + }; + + if (process.env.NODE_ENV !== 'production') { + /** + * To help development we can get better devtools integration by simulating a + * real browser event. + */ + if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { + var fakeNode = document.createElement('react'); + ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) { + var boundFunc = func.bind(null, a, b); + var evtType = 'react-' + name; + fakeNode.addEventListener(evtType, boundFunc, false); + var evt = document.createEvent('Event'); + evt.initEvent(evtType, false, false); + fakeNode.dispatchEvent(evt); + fakeNode.removeEventListener(evtType, boundFunc, false); + }; + } + } + + module.exports = ReactErrorUtils; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 224 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule accumulateInto + */ + + 'use strict'; + + var invariant = __webpack_require__(202); + + /** + * + * Accumulates items that must not be null or undefined into the first one. This + * is used to conserve memory by avoiding array allocations, and thus sacrifices + * API cleanness. Since `current` can be null before being passed in and not + * null after this function, make sure to assign it back to `current`: + * + * `a = accumulateInto(a, b);` + * + * This API should be sparingly used. Try `accumulate` for something cleaner. + * + * @return {*|array<*>} An accumulation of items. + */ + + function accumulateInto(current, next) { + !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : undefined; + if (current == null) { + return next; + } + + // Both are not empty. Warning: Never call x.concat(y) when you are not + // certain that x is an Array (x could be a string with concat method). + var currentIsArray = Array.isArray(current); + var nextIsArray = Array.isArray(next); + + if (currentIsArray && nextIsArray) { + current.push.apply(current, next); + return current; + } + + if (currentIsArray) { + current.push(next); + return current; + } + + if (nextIsArray) { + // A bit too dangerous to mutate `next`. + return [current].concat(next); + } + + return [current, next]; + } + + module.exports = accumulateInto; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 225 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule forEachAccumulated + */ + + 'use strict'; + + /** + * @param {array} arr an "accumulation" of items which is either an Array or + * a single item. Useful when paired with the `accumulate` module. This is a + * simple utility that allows us to reason about a collection of items, but + * handling the case when there is exactly one item (and we do not need to + * allocate an array). + */ + var forEachAccumulated = function (arr, cb, scope) { + if (Array.isArray(arr)) { + arr.forEach(cb, scope); + } else if (arr) { + cb.call(scope, arr); + } + }; + + module.exports = forEachAccumulated; + +/***/ }, +/* 226 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactEventEmitterMixin + */ + + 'use strict'; + + var EventPluginHub = __webpack_require__(220); + + function runEventQueueInBatch(events) { + EventPluginHub.enqueueEvents(events); + EventPluginHub.processEventQueue(false); + } + + var ReactEventEmitterMixin = { + + /** + * Streams a fired top-level event to `EventPluginHub` where plugins have the + * opportunity to create `ReactEvent`s to be dispatched. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {object} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native environment event. + */ + handleTopLevel: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) { + var events = EventPluginHub.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget); + runEventQueueInBatch(events); + } + }; + + module.exports = ReactEventEmitterMixin; + +/***/ }, +/* 227 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ViewportMetrics + */ + + 'use strict'; + + var ViewportMetrics = { + + currentScrollLeft: 0, + + currentScrollTop: 0, + + refreshScrollValues: function (scrollPosition) { + ViewportMetrics.currentScrollLeft = scrollPosition.x; + ViewportMetrics.currentScrollTop = scrollPosition.y; + } + + }; + + module.exports = ViewportMetrics; + +/***/ }, +/* 228 */ +/***/ function(module, exports) { + + /** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule Object.assign + */ + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign + + 'use strict'; + + function assign(target, sources) { + if (target == null) { + throw new TypeError('Object.assign target cannot be null or undefined'); + } + + var to = Object(target); + var hasOwnProperty = Object.prototype.hasOwnProperty; + + for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { + var nextSource = arguments[nextIndex]; + if (nextSource == null) { + continue; + } + + var from = Object(nextSource); + + // We don't currently support accessors nor proxies. Therefore this + // copy cannot throw. If we ever supported this then we must handle + // exceptions and side-effects. We don't support symbols so they won't + // be transferred. + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + } + + return to; + } + + module.exports = assign; + +/***/ }, +/* 229 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule isEventSupported + */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(198); + + var useHasFeature; + if (ExecutionEnvironment.canUseDOM) { + useHasFeature = document.implementation && document.implementation.hasFeature && + // always returns true in newer browsers as per the standard. + // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature + document.implementation.hasFeature('', '') !== true; + } + + /** + * Checks if an event is supported in the current execution environment. + * + * NOTE: This will not work correctly for non-generic events such as `change`, + * `reset`, `load`, `error`, and `select`. + * + * Borrows from Modernizr. + * + * @param {string} eventNameSuffix Event name, e.g. "click". + * @param {?boolean} capture Check if the capture phase is supported. + * @return {boolean} True if the event is supported. + * @internal + * @license Modernizr 3.0.0pre (Custom Build) | MIT + */ + function isEventSupported(eventNameSuffix, capture) { + if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) { + return false; + } + + var eventName = 'on' + eventNameSuffix; + var isSupported = (eventName in document); + + if (!isSupported) { + var element = document.createElement('div'); + element.setAttribute(eventName, 'return;'); + isSupported = typeof element[eventName] === 'function'; + } + + if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { + // This is the only way to test support for the `wheel` event in IE9+. + isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); + } + + return isSupported; + } + + module.exports = isEventSupported; + +/***/ }, +/* 230 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMFeatureFlags + */ + + 'use strict'; + + var ReactDOMFeatureFlags = { + useCreateElement: false + }; + + module.exports = ReactDOMFeatureFlags; + +/***/ }, +/* 231 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactElement + */ + + 'use strict'; + + var ReactCurrentOwner = __webpack_require__(194); + + var assign = __webpack_require__(228); + var canDefineProperty = __webpack_require__(232); + + // The Symbol used to tag the ReactElement type. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; + + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; + + /** + * Base constructor for all React elements. This is only used to make this + * work with a dynamic instanceof check. Nothing should live on this prototype. + * + * @param {*} type + * @param {*} key + * @param {string|object} ref + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @param {*} owner + * @param {*} props + * @internal + */ + var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allow us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + + // Record the component responsible for creating this element. + _owner: owner + }; + + if (process.env.NODE_ENV !== 'production') { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; + + // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + if (canDefineProperty) { + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); + // self and source are DEV only properties. + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); + // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + } else { + element._store.validated = false; + element._self = self; + element._source = source; + } + Object.freeze(element.props); + Object.freeze(element); + } + + return element; + }; + + ReactElement.createElement = function (type, config, children) { + var propName; + + // Reserved names are extracted + var props = {}; + + var key = null; + var ref = null; + var self = null; + var source = null; + + if (config != null) { + ref = config.ref === undefined ? null : config.ref; + key = config.key === undefined ? null : '' + config.key; + self = config.__self === undefined ? null : config.__self; + source = config.__source === undefined ? null : config.__source; + // Remaining properties are added to a new props object + for (propName in config) { + if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } + + // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } + + // Resolve default props + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (typeof props[propName] === 'undefined') { + props[propName] = defaultProps[propName]; + } + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + }; + + ReactElement.createFactory = function (type) { + var factory = ReactElement.createElement.bind(null, type); + // Expose the type on the factory and the prototype so that it can be + // easily accessed on elements. E.g. `<Foo />.type === Foo`. + // This should not be named `constructor` since this may not be the function + // that created the element, and it may not even be a constructor. + // Legacy hook TODO: Warn if this is accessed + factory.type = type; + return factory; + }; + + ReactElement.cloneAndReplaceKey = function (oldElement, newKey) { + var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); + + return newElement; + }; + + ReactElement.cloneAndReplaceProps = function (oldElement, newProps) { + var newElement = ReactElement(oldElement.type, oldElement.key, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, newProps); + + if (process.env.NODE_ENV !== 'production') { + // If the key on the original is valid, then the clone is valid + newElement._store.validated = oldElement._store.validated; + } + + return newElement; + }; + + ReactElement.cloneElement = function (element, config, children) { + var propName; + + // Original props are copied + var props = assign({}, element.props); + + // Reserved names are extracted + var key = element.key; + var ref = element.ref; + // Self is preserved since the owner is preserved. + var self = element._self; + // Source is preserved since cloneElement is unlikely to be targeted by a + // transpiler, and the original source is probably a better indicator of the + // true owner. + var source = element._source; + + // Owner will be preserved, unless ref is overridden + var owner = element._owner; + + if (config != null) { + if (config.ref !== undefined) { + // Silently steal the ref from the parent. + ref = config.ref; + owner = ReactCurrentOwner.current; + } + if (config.key !== undefined) { + key = '' + config.key; + } + // Remaining properties override existing props + for (propName in config) { + if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } + + // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } + + return ReactElement(element.type, key, ref, self, source, owner, props); + }; + + /** + * @param {?object} object + * @return {boolean} True if `object` is a valid component. + * @final + */ + ReactElement.isValidElement = function (object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + }; + + module.exports = ReactElement; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 232 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule canDefineProperty + */ + + 'use strict'; + + var canDefineProperty = false; + if (process.env.NODE_ENV !== 'production') { + try { + Object.defineProperty({}, 'x', { get: function () {} }); + canDefineProperty = true; + } catch (x) { + // IE will fail on defineProperty + } + } + + module.exports = canDefineProperty; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 233 */ +/***/ function(module, exports) { + + /** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactEmptyComponentRegistry + */ + + 'use strict'; + + // This registry keeps track of the React IDs of the components that rendered to + // `null` (in reality a placeholder such as `noscript`) + var nullComponentIDsRegistry = {}; + + /** + * @param {string} id Component's `_rootNodeID`. + * @return {boolean} True if the component is rendered to null. + */ + function isNullComponentID(id) { + return !!nullComponentIDsRegistry[id]; + } + + /** + * Mark the component as having rendered to null. + * @param {string} id Component's `_rootNodeID`. + */ + function registerNullComponentID(id) { + nullComponentIDsRegistry[id] = true; + } + + /** + * Unmark the component as having rendered to null: it renders to something now. + * @param {string} id Component's `_rootNodeID`. + */ + function deregisterNullComponentID(id) { + delete nullComponentIDsRegistry[id]; + } + + var ReactEmptyComponentRegistry = { + isNullComponentID: isNullComponentID, + registerNullComponentID: registerNullComponentID, + deregisterNullComponentID: deregisterNullComponentID + }; + + module.exports = ReactEmptyComponentRegistry; + +/***/ }, +/* 234 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactInstanceHandles + * @typechecks static-only + */ + + 'use strict'; + + var ReactRootIndex = __webpack_require__(235); + + var invariant = __webpack_require__(202); + + var SEPARATOR = '.'; + var SEPARATOR_LENGTH = SEPARATOR.length; + + /** + * Maximum depth of traversals before we consider the possibility of a bad ID. + */ + var MAX_TREE_DEPTH = 10000; + + /** + * Creates a DOM ID prefix to use when mounting React components. + * + * @param {number} index A unique integer + * @return {string} React root ID. + * @internal + */ + function getReactRootIDString(index) { + return SEPARATOR + index.toString(36); + } + + /** + * Checks if a character in the supplied ID is a separator or the end. + * + * @param {string} id A React DOM ID. + * @param {number} index Index of the character to check. + * @return {boolean} True if the character is a separator or end of the ID. + * @private + */ + function isBoundary(id, index) { + return id.charAt(index) === SEPARATOR || index === id.length; + } + + /** + * Checks if the supplied string is a valid React DOM ID. + * + * @param {string} id A React DOM ID, maybe. + * @return {boolean} True if the string is a valid React DOM ID. + * @private + */ + function isValidID(id) { + return id === '' || id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR; + } + + /** + * Checks if the first ID is an ancestor of or equal to the second ID. + * + * @param {string} ancestorID + * @param {string} descendantID + * @return {boolean} True if `ancestorID` is an ancestor of `descendantID`. + * @internal + */ + function isAncestorIDOf(ancestorID, descendantID) { + return descendantID.indexOf(ancestorID) === 0 && isBoundary(descendantID, ancestorID.length); + } + + /** + * Gets the parent ID of the supplied React DOM ID, `id`. + * + * @param {string} id ID of a component. + * @return {string} ID of the parent, or an empty string. + * @private + */ + function getParentID(id) { + return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : ''; + } + + /** + * Gets the next DOM ID on the tree path from the supplied `ancestorID` to the + * supplied `destinationID`. If they are equal, the ID is returned. + * + * @param {string} ancestorID ID of an ancestor node of `destinationID`. + * @param {string} destinationID ID of the destination node. + * @return {string} Next ID on the path from `ancestorID` to `destinationID`. + * @private + */ + function getNextDescendantID(ancestorID, destinationID) { + !(isValidID(ancestorID) && isValidID(destinationID)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID) : invariant(false) : undefined; + !isAncestorIDOf(ancestorID, destinationID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID) : invariant(false) : undefined; + if (ancestorID === destinationID) { + return ancestorID; + } + // Skip over the ancestor and the immediate separator. Traverse until we hit + // another separator or we reach the end of `destinationID`. + var start = ancestorID.length + SEPARATOR_LENGTH; + var i; + for (i = start; i < destinationID.length; i++) { + if (isBoundary(destinationID, i)) { + break; + } + } + return destinationID.substr(0, i); + } + + /** + * Gets the nearest common ancestor ID of two IDs. + * + * Using this ID scheme, the nearest common ancestor ID is the longest common + * prefix of the two IDs that immediately preceded a "marker" in both strings. + * + * @param {string} oneID + * @param {string} twoID + * @return {string} Nearest common ancestor ID, or the empty string if none. + * @private + */ + function getFirstCommonAncestorID(oneID, twoID) { + var minLength = Math.min(oneID.length, twoID.length); + if (minLength === 0) { + return ''; + } + var lastCommonMarkerIndex = 0; + // Use `<=` to traverse until the "EOL" of the shorter string. + for (var i = 0; i <= minLength; i++) { + if (isBoundary(oneID, i) && isBoundary(twoID, i)) { + lastCommonMarkerIndex = i; + } else if (oneID.charAt(i) !== twoID.charAt(i)) { + break; + } + } + var longestCommonID = oneID.substr(0, lastCommonMarkerIndex); + !isValidID(longestCommonID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID) : invariant(false) : undefined; + return longestCommonID; + } + + /** + * Traverses the parent path between two IDs (either up or down). The IDs must + * not be the same, and there must exist a parent path between them. If the + * callback returns `false`, traversal is stopped. + * + * @param {?string} start ID at which to start traversal. + * @param {?string} stop ID at which to end traversal. + * @param {function} cb Callback to invoke each ID with. + * @param {*} arg Argument to invoke the callback with. + * @param {?boolean} skipFirst Whether or not to skip the first node. + * @param {?boolean} skipLast Whether or not to skip the last node. + * @private + */ + function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) { + start = start || ''; + stop = stop || ''; + !(start !== stop) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start) : invariant(false) : undefined; + var traverseUp = isAncestorIDOf(stop, start); + !(traverseUp || isAncestorIDOf(start, stop)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop) : invariant(false) : undefined; + // Traverse from `start` to `stop` one depth at a time. + var depth = 0; + var traverse = traverseUp ? getParentID : getNextDescendantID; + for (var id = start;; /* until break */id = traverse(id, stop)) { + var ret; + if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) { + ret = cb(id, traverseUp, arg); + } + if (ret === false || id === stop) { + // Only break //after// visiting `stop`. + break; + } + !(depth++ < MAX_TREE_DEPTH) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop, id) : invariant(false) : undefined; + } + } + + /** + * Manages the IDs assigned to DOM representations of React components. This + * uses a specific scheme in order to traverse the DOM efficiently (e.g. in + * order to simulate events). + * + * @internal + */ + var ReactInstanceHandles = { + + /** + * Constructs a React root ID + * @return {string} A React root ID. + */ + createReactRootID: function () { + return getReactRootIDString(ReactRootIndex.createReactRootIndex()); + }, + + /** + * Constructs a React ID by joining a root ID with a name. + * + * @param {string} rootID Root ID of a parent component. + * @param {string} name A component's name (as flattened children). + * @return {string} A React ID. + * @internal + */ + createReactID: function (rootID, name) { + return rootID + name; + }, + + /** + * Gets the DOM ID of the React component that is the root of the tree that + * contains the React component with the supplied DOM ID. + * + * @param {string} id DOM ID of a React component. + * @return {?string} DOM ID of the React component that is the root. + * @internal + */ + getReactRootIDFromNodeID: function (id) { + if (id && id.charAt(0) === SEPARATOR && id.length > 1) { + var index = id.indexOf(SEPARATOR, 1); + return index > -1 ? id.substr(0, index) : id; + } + return null; + }, + + /** + * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that + * should would receive a `mouseEnter` or `mouseLeave` event. + * + * NOTE: Does not invoke the callback on the nearest common ancestor because + * nothing "entered" or "left" that element. + * + * @param {string} leaveID ID being left. + * @param {string} enterID ID being entered. + * @param {function} cb Callback to invoke on each entered/left ID. + * @param {*} upArg Argument to invoke the callback with on left IDs. + * @param {*} downArg Argument to invoke the callback with on entered IDs. + * @internal + */ + traverseEnterLeave: function (leaveID, enterID, cb, upArg, downArg) { + var ancestorID = getFirstCommonAncestorID(leaveID, enterID); + if (ancestorID !== leaveID) { + traverseParentPath(leaveID, ancestorID, cb, upArg, false, true); + } + if (ancestorID !== enterID) { + traverseParentPath(ancestorID, enterID, cb, downArg, true, false); + } + }, + + /** + * Simulates the traversal of a two-phase, capture/bubble event dispatch. + * + * NOTE: This traversal happens on IDs without touching the DOM. + * + * @param {string} targetID ID of the target node. + * @param {function} cb Callback to invoke. + * @param {*} arg Argument to invoke the callback with. + * @internal + */ + traverseTwoPhase: function (targetID, cb, arg) { + if (targetID) { + traverseParentPath('', targetID, cb, arg, true, false); + traverseParentPath(targetID, '', cb, arg, false, true); + } + }, + + /** + * Same as `traverseTwoPhase` but skips the `targetID`. + */ + traverseTwoPhaseSkipTarget: function (targetID, cb, arg) { + if (targetID) { + traverseParentPath('', targetID, cb, arg, true, true); + traverseParentPath(targetID, '', cb, arg, true, true); + } + }, + + /** + * Traverse a node ID, calling the supplied `cb` for each ancestor ID. For + * example, passing `.0.$row-0.1` would result in `cb` getting called + * with `.0`, `.0.$row-0`, and `.0.$row-0.1`. + * + * NOTE: This traversal happens on IDs without touching the DOM. + * + * @param {string} targetID ID of the target node. + * @param {function} cb Callback to invoke. + * @param {*} arg Argument to invoke the callback with. + * @internal + */ + traverseAncestors: function (targetID, cb, arg) { + traverseParentPath('', targetID, cb, arg, true, false); + }, + + getFirstCommonAncestorID: getFirstCommonAncestorID, + + /** + * Exposed for unit testing. + * @private + */ + _getNextDescendantID: getNextDescendantID, + + isAncestorIDOf: isAncestorIDOf, + + SEPARATOR: SEPARATOR + + }; + + module.exports = ReactInstanceHandles; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 235 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactRootIndex + * @typechecks + */ + + 'use strict'; + + var ReactRootIndexInjection = { + /** + * @param {function} _createReactRootIndex + */ + injectCreateReactRootIndex: function (_createReactRootIndex) { + ReactRootIndex.createReactRootIndex = _createReactRootIndex; + } + }; + + var ReactRootIndex = { + createReactRootIndex: null, + injection: ReactRootIndexInjection + }; + + module.exports = ReactRootIndex; + +/***/ }, +/* 236 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactInstanceMap + */ + + 'use strict'; + + /** + * `ReactInstanceMap` maintains a mapping from a public facing stateful + * instance (key) and the internal representation (value). This allows public + * methods to accept the user facing instance as an argument and map them back + * to internal methods. + */ + + // TODO: Replace this with ES6: var ReactInstanceMap = new Map(); + var ReactInstanceMap = { + + /** + * This API should be called `delete` but we'd have to make sure to always + * transform these to strings for IE support. When this transform is fully + * supported we can rename it. + */ + remove: function (key) { + key._reactInternalInstance = undefined; + }, + + get: function (key) { + return key._reactInternalInstance; + }, + + has: function (key) { + return key._reactInternalInstance !== undefined; + }, + + set: function (key, value) { + key._reactInternalInstance = value; + } + + }; + + module.exports = ReactInstanceMap; + +/***/ }, +/* 237 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactMarkupChecksum + */ + + 'use strict'; + + var adler32 = __webpack_require__(238); + + var TAG_END = /\/?>/; + + var ReactMarkupChecksum = { + CHECKSUM_ATTR_NAME: 'data-react-checksum', + + /** + * @param {string} markup Markup string + * @return {string} Markup string with checksum attribute attached + */ + addChecksumToMarkup: function (markup) { + var checksum = adler32(markup); + + // Add checksum (handle both parent tags and self-closing tags) + return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&'); + }, + + /** + * @param {string} markup to use + * @param {DOMElement} element root React element + * @returns {boolean} whether or not the markup is the same + */ + canReuseMarkup: function (markup, element) { + var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); + existingChecksum = existingChecksum && parseInt(existingChecksum, 10); + var markupChecksum = adler32(markup); + return markupChecksum === existingChecksum; + } + }; + + module.exports = ReactMarkupChecksum; + +/***/ }, +/* 238 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule adler32 + */ + + 'use strict'; + + var MOD = 65521; + + // adler32 is not cryptographically strong, and is only used to sanity check that + // markup generated on the server matches the markup generated on the client. + // This implementation (a modified version of the SheetJS version) has been optimized + // for our use case, at the expense of conforming to the adler32 specification + // for non-ascii inputs. + function adler32(data) { + var a = 1; + var b = 0; + var i = 0; + var l = data.length; + var m = l & ~0x3; + while (i < m) { + for (; i < Math.min(i + 4096, m); i += 4) { + b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3)); + } + a %= MOD; + b %= MOD; + } + for (; i < l; i++) { + b += a += data.charCodeAt(i); + } + a %= MOD; + b %= MOD; + return a | b << 16; + } + + module.exports = adler32; + +/***/ }, +/* 239 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactReconciler + */ + + 'use strict'; + + var ReactRef = __webpack_require__(240); + + /** + * Helper to call ReactRef.attachRefs with this composite component, split out + * to avoid allocations in the transaction mount-ready queue. + */ + function attachRefs() { + ReactRef.attachRefs(this, this._currentElement); + } + + var ReactReconciler = { + + /** + * Initializes the component, renders markup, and registers event listeners. + * + * @param {ReactComponent} internalInstance + * @param {string} rootID DOM ID of the root node. + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @return {?string} Rendered markup to be inserted into the DOM. + * @final + * @internal + */ + mountComponent: function (internalInstance, rootID, transaction, context) { + var markup = internalInstance.mountComponent(rootID, transaction, context); + if (internalInstance._currentElement && internalInstance._currentElement.ref != null) { + transaction.getReactMountReady().enqueue(attachRefs, internalInstance); + } + return markup; + }, + + /** + * Releases any resources allocated by `mountComponent`. + * + * @final + * @internal + */ + unmountComponent: function (internalInstance) { + ReactRef.detachRefs(internalInstance, internalInstance._currentElement); + internalInstance.unmountComponent(); + }, + + /** + * Update a component using a new element. + * + * @param {ReactComponent} internalInstance + * @param {ReactElement} nextElement + * @param {ReactReconcileTransaction} transaction + * @param {object} context + * @internal + */ + receiveComponent: function (internalInstance, nextElement, transaction, context) { + var prevElement = internalInstance._currentElement; + + if (nextElement === prevElement && context === internalInstance._context) { + // Since elements are immutable after the owner is rendered, + // we can do a cheap identity compare here to determine if this is a + // superfluous reconcile. It's possible for state to be mutable but such + // change should trigger an update of the owner which would recreate + // the element. We explicitly check for the existence of an owner since + // it's possible for an element created outside a composite to be + // deeply mutated and reused. + + // TODO: Bailing out early is just a perf optimization right? + // TODO: Removing the return statement should affect correctness? + return; + } + + var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement); + + if (refsChanged) { + ReactRef.detachRefs(internalInstance, prevElement); + } + + internalInstance.receiveComponent(nextElement, transaction, context); + + if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) { + transaction.getReactMountReady().enqueue(attachRefs, internalInstance); + } + }, + + /** + * Flush any dirty changes in a component. + * + * @param {ReactComponent} internalInstance + * @param {ReactReconcileTransaction} transaction + * @internal + */ + performUpdateIfNecessary: function (internalInstance, transaction) { + internalInstance.performUpdateIfNecessary(transaction); + } + + }; + + module.exports = ReactReconciler; + +/***/ }, +/* 240 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactRef + */ + + 'use strict'; + + var ReactOwner = __webpack_require__(241); + + var ReactRef = {}; + + function attachRef(ref, component, owner) { + if (typeof ref === 'function') { + ref(component.getPublicInstance()); + } else { + // Legacy ref + ReactOwner.addComponentAsRefTo(component, ref, owner); + } + } + + function detachRef(ref, component, owner) { + if (typeof ref === 'function') { + ref(null); + } else { + // Legacy ref + ReactOwner.removeComponentAsRefFrom(component, ref, owner); + } + } + + ReactRef.attachRefs = function (instance, element) { + if (element === null || element === false) { + return; + } + var ref = element.ref; + if (ref != null) { + attachRef(ref, instance, element._owner); + } + }; + + ReactRef.shouldUpdateRefs = function (prevElement, nextElement) { + // If either the owner or a `ref` has changed, make sure the newest owner + // has stored a reference to `this`, and the previous owner (if different) + // has forgotten the reference to `this`. We use the element instead + // of the public this.props because the post processing cannot determine + // a ref. The ref conceptually lives on the element. + + // TODO: Should this even be possible? The owner cannot change because + // it's forbidden by shouldUpdateReactComponent. The ref can change + // if you swap the keys of but not the refs. Reconsider where this check + // is made. It probably belongs where the key checking and + // instantiateReactComponent is done. + + var prevEmpty = prevElement === null || prevElement === false; + var nextEmpty = nextElement === null || nextElement === false; + + return( + // This has a few false positives w/r/t empty components. + prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref + ); + }; + + ReactRef.detachRefs = function (instance, element) { + if (element === null || element === false) { + return; + } + var ref = element.ref; + if (ref != null) { + detachRef(ref, instance, element._owner); + } + }; + + module.exports = ReactRef; + +/***/ }, +/* 241 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactOwner + */ + + 'use strict'; + + var invariant = __webpack_require__(202); + + /** + * ReactOwners are capable of storing references to owned components. + * + * All components are capable of //being// referenced by owner components, but + * only ReactOwner components are capable of //referencing// owned components. + * The named reference is known as a "ref". + * + * Refs are available when mounted and updated during reconciliation. + * + * var MyComponent = React.createClass({ + * render: function() { + * return ( + * <div onClick={this.handleClick}> + * <CustomComponent ref="custom" /> + * </div> + * ); + * }, + * handleClick: function() { + * this.refs.custom.handleClick(); + * }, + * componentDidMount: function() { + * this.refs.custom.initialize(); + * } + * }); + * + * Refs should rarely be used. When refs are used, they should only be done to + * control data that is not handled by React's data flow. + * + * @class ReactOwner + */ + var ReactOwner = { + + /** + * @param {?object} object + * @return {boolean} True if `object` is a valid owner. + * @final + */ + isValidOwner: function (object) { + return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function'); + }, + + /** + * Adds a component by ref to an owner component. + * + * @param {ReactComponent} component Component to reference. + * @param {string} ref Name by which to refer to the component. + * @param {ReactOwner} owner Component on which to record the ref. + * @final + * @internal + */ + addComponentAsRefTo: function (component, ref, owner) { + !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might ' + 'be adding a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : undefined; + owner.attachRef(ref, component); + }, + + /** + * Removes a component by ref from an owner component. + * + * @param {ReactComponent} component Component to dereference. + * @param {string} ref Name of the ref to remove. + * @param {ReactOwner} owner Component on which the ref is recorded. + * @final + * @internal + */ + removeComponentAsRefFrom: function (component, ref, owner) { + !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might ' + 'be removing a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : undefined; + // Check that `component` is still the current ref because we do not want to + // detach the ref if another component stole it. + if (owner.getPublicInstance().refs[ref] === component.getPublicInstance()) { + owner.detachRef(ref); + } + } + + }; + + module.exports = ReactOwner; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 242 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactUpdateQueue + */ + + 'use strict'; + + var ReactCurrentOwner = __webpack_require__(194); + var ReactElement = __webpack_require__(231); + var ReactInstanceMap = __webpack_require__(236); + var ReactUpdates = __webpack_require__(243); + + var assign = __webpack_require__(228); + var invariant = __webpack_require__(202); + var warning = __webpack_require__(214); + + function enqueueUpdate(internalInstance) { + ReactUpdates.enqueueUpdate(internalInstance); + } + + function getInternalInstanceReadyForUpdate(publicInstance, callerName) { + var internalInstance = ReactInstanceMap.get(publicInstance); + if (!internalInstance) { + if (process.env.NODE_ENV !== 'production') { + // Only warn when we have a callerName. Otherwise we should be silent. + // We're probably calling from enqueueCallback. We don't want to warn + // there because we already warned for the corresponding lifecycle method. + process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : undefined; + } + return null; + } + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition ' + '(such as within `render`). Render methods should be a pure function ' + 'of props and state.', callerName) : undefined; + } + + return internalInstance; + } + + /** + * ReactUpdateQueue allows for state updates to be scheduled into a later + * reconciliation step. + */ + var ReactUpdateQueue = { + + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function (publicInstance) { + if (process.env.NODE_ENV !== 'production') { + var owner = ReactCurrentOwner.current; + if (owner !== null) { + process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : undefined; + owner._warnedAboutRefsInRender = true; + } + } + var internalInstance = ReactInstanceMap.get(publicInstance); + if (internalInstance) { + // During componentWillMount and render this will still be null but after + // that will always render to something. At least for now. So we can use + // this hack. + return !!internalInstance._renderedComponent; + } else { + return false; + } + }, + + /** + * Enqueue a callback that will be executed after all the pending updates + * have processed. + * + * @param {ReactClass} publicInstance The instance to use as `this` context. + * @param {?function} callback Called after state is updated. + * @internal + */ + enqueueCallback: function (publicInstance, callback) { + !(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined; + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); + + // Previously we would throw an error if we didn't have an internal + // instance. Since we want to make it a no-op instead, we mirror the same + // behavior we have in other enqueue* methods. + // We also need to ignore callbacks in componentWillMount. See + // enqueueUpdates. + if (!internalInstance) { + return null; + } + + if (internalInstance._pendingCallbacks) { + internalInstance._pendingCallbacks.push(callback); + } else { + internalInstance._pendingCallbacks = [callback]; + } + // TODO: The callback here is ignored when setState is called from + // componentWillMount. Either fix it or disallow doing so completely in + // favor of getInitialState. Alternatively, we can disallow + // componentWillMount during server-side rendering. + enqueueUpdate(internalInstance); + }, + + enqueueCallbackInternal: function (internalInstance, callback) { + !(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined; + if (internalInstance._pendingCallbacks) { + internalInstance._pendingCallbacks.push(callback); + } else { + internalInstance._pendingCallbacks = [callback]; + } + enqueueUpdate(internalInstance); + }, + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @internal + */ + enqueueForceUpdate: function (publicInstance) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate'); + + if (!internalInstance) { + return; + } + + internalInstance._pendingForceUpdate = true; + + enqueueUpdate(internalInstance); + }, + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @internal + */ + enqueueReplaceState: function (publicInstance, completeState) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState'); + + if (!internalInstance) { + return; + } + + internalInstance._pendingStateQueue = [completeState]; + internalInstance._pendingReplaceState = true; + + enqueueUpdate(internalInstance); + }, + + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @internal + */ + enqueueSetState: function (publicInstance, partialState) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState'); + + if (!internalInstance) { + return; + } + + var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []); + queue.push(partialState); + + enqueueUpdate(internalInstance); + }, + + /** + * Sets a subset of the props. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialProps Subset of the next props. + * @internal + */ + enqueueSetProps: function (publicInstance, partialProps) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setProps'); + if (!internalInstance) { + return; + } + ReactUpdateQueue.enqueueSetPropsInternal(internalInstance, partialProps); + }, + + enqueueSetPropsInternal: function (internalInstance, partialProps) { + var topLevelWrapper = internalInstance._topLevelWrapper; + !topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setProps(...): You called `setProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined; + + // Merge with the pending element if it exists, otherwise with existing + // element props. + var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement; + var element = wrapElement.props; + var props = assign({}, element.props, partialProps); + topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props)); + + enqueueUpdate(topLevelWrapper); + }, + + /** + * Replaces all of the props. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} props New props. + * @internal + */ + enqueueReplaceProps: function (publicInstance, props) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceProps'); + if (!internalInstance) { + return; + } + ReactUpdateQueue.enqueueReplacePropsInternal(internalInstance, props); + }, + + enqueueReplacePropsInternal: function (internalInstance, props) { + var topLevelWrapper = internalInstance._topLevelWrapper; + !topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'replaceProps(...): You called `replaceProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined; + + // Merge with the pending element if it exists, otherwise with existing + // element props. + var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement; + var element = wrapElement.props; + topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props)); + + enqueueUpdate(topLevelWrapper); + }, + + enqueueElementInternal: function (internalInstance, newElement) { + internalInstance._pendingElement = newElement; + enqueueUpdate(internalInstance); + } + + }; + + module.exports = ReactUpdateQueue; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 243 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactUpdates + */ + + 'use strict'; + + var CallbackQueue = __webpack_require__(244); + var PooledClass = __webpack_require__(245); + var ReactPerf = __webpack_require__(207); + var ReactReconciler = __webpack_require__(239); + var Transaction = __webpack_require__(246); + + var assign = __webpack_require__(228); + var invariant = __webpack_require__(202); + + var dirtyComponents = []; + var asapCallbackQueue = CallbackQueue.getPooled(); + var asapEnqueued = false; + + var batchingStrategy = null; + + function ensureInjected() { + !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : undefined; + } + + var NESTED_UPDATES = { + initialize: function () { + this.dirtyComponentsLength = dirtyComponents.length; + }, + close: function () { + if (this.dirtyComponentsLength !== dirtyComponents.length) { + // Additional updates were enqueued by componentDidUpdate handlers or + // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run + // these new updates so that if A's componentDidUpdate calls setState on + // B, B will update before the callback A's updater provided when calling + // setState. + dirtyComponents.splice(0, this.dirtyComponentsLength); + flushBatchedUpdates(); + } else { + dirtyComponents.length = 0; + } + } + }; + + var UPDATE_QUEUEING = { + initialize: function () { + this.callbackQueue.reset(); + }, + close: function () { + this.callbackQueue.notifyAll(); + } + }; + + var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; + + function ReactUpdatesFlushTransaction() { + this.reinitializeTransaction(); + this.dirtyComponentsLength = null; + this.callbackQueue = CallbackQueue.getPooled(); + this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( /* forceHTML */false); + } + + assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, { + getTransactionWrappers: function () { + return TRANSACTION_WRAPPERS; + }, + + destructor: function () { + this.dirtyComponentsLength = null; + CallbackQueue.release(this.callbackQueue); + this.callbackQueue = null; + ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); + this.reconcileTransaction = null; + }, + + perform: function (method, scope, a) { + // Essentially calls `this.reconcileTransaction.perform(method, scope, a)` + // with this transaction's wrappers around it. + return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a); + } + }); + + PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); + + function batchedUpdates(callback, a, b, c, d, e) { + ensureInjected(); + batchingStrategy.batchedUpdates(callback, a, b, c, d, e); + } + + /** + * Array comparator for ReactComponents by mount ordering. + * + * @param {ReactComponent} c1 first component you're comparing + * @param {ReactComponent} c2 second component you're comparing + * @return {number} Return value usable by Array.prototype.sort(). + */ + function mountOrderComparator(c1, c2) { + return c1._mountOrder - c2._mountOrder; + } + + function runBatchedUpdates(transaction) { + var len = transaction.dirtyComponentsLength; + !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : undefined; + + // Since reconciling a component higher in the owner hierarchy usually (not + // always -- see shouldComponentUpdate()) will reconcile children, reconcile + // them before their children by sorting the array. + dirtyComponents.sort(mountOrderComparator); + + for (var i = 0; i < len; i++) { + // If a component is unmounted before pending changes apply, it will still + // be here, but we assume that it has cleared its _pendingCallbacks and + // that performUpdateIfNecessary is a noop. + var component = dirtyComponents[i]; + + // If performUpdateIfNecessary happens to enqueue any new updates, we + // shouldn't execute the callbacks until the next render happens, so + // stash the callbacks first + var callbacks = component._pendingCallbacks; + component._pendingCallbacks = null; + + ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction); + + if (callbacks) { + for (var j = 0; j < callbacks.length; j++) { + transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance()); + } + } + } + } + + var flushBatchedUpdates = function () { + // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents + // array and perform any updates enqueued by mount-ready handlers (i.e., + // componentDidUpdate) but we need to check here too in order to catch + // updates enqueued by setState callbacks and asap calls. + while (dirtyComponents.length || asapEnqueued) { + if (dirtyComponents.length) { + var transaction = ReactUpdatesFlushTransaction.getPooled(); + transaction.perform(runBatchedUpdates, null, transaction); + ReactUpdatesFlushTransaction.release(transaction); + } + + if (asapEnqueued) { + asapEnqueued = false; + var queue = asapCallbackQueue; + asapCallbackQueue = CallbackQueue.getPooled(); + queue.notifyAll(); + CallbackQueue.release(queue); + } + } + }; + flushBatchedUpdates = ReactPerf.measure('ReactUpdates', 'flushBatchedUpdates', flushBatchedUpdates); + + /** + * Mark a component as needing a rerender, adding an optional callback to a + * list of functions which will be executed once the rerender occurs. + */ + function enqueueUpdate(component) { + ensureInjected(); + + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. (This is called by each top-level update + // function, like setProps, setState, forceUpdate, etc.; creation and + // destruction of top-level components is guarded in ReactMount.) + + if (!batchingStrategy.isBatchingUpdates) { + batchingStrategy.batchedUpdates(enqueueUpdate, component); + return; + } + + dirtyComponents.push(component); + } + + /** + * Enqueue a callback to be run at the end of the current batching cycle. Throws + * if no updates are currently being performed. + */ + function asap(callback, context) { + !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined; + asapCallbackQueue.enqueue(callback, context); + asapEnqueued = true; + } + + var ReactUpdatesInjection = { + injectReconcileTransaction: function (ReconcileTransaction) { + !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : undefined; + ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; + }, + + injectBatchingStrategy: function (_batchingStrategy) { + !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : undefined; + !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : undefined; + !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : undefined; + batchingStrategy = _batchingStrategy; + } + }; + + var ReactUpdates = { + /** + * React references `ReactReconcileTransaction` using this property in order + * to allow dependency injection. + * + * @internal + */ + ReactReconcileTransaction: null, + + batchedUpdates: batchedUpdates, + enqueueUpdate: enqueueUpdate, + flushBatchedUpdates: flushBatchedUpdates, + injection: ReactUpdatesInjection, + asap: asap + }; + + module.exports = ReactUpdates; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 244 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule CallbackQueue + */ + + 'use strict'; + + var PooledClass = __webpack_require__(245); + + var assign = __webpack_require__(228); + var invariant = __webpack_require__(202); + + /** + * A specialized pseudo-event module to help keep track of components waiting to + * be notified when their DOM representations are available for use. + * + * This implements `PooledClass`, so you should never need to instantiate this. + * Instead, use `CallbackQueue.getPooled()`. + * + * @class ReactMountReady + * @implements PooledClass + * @internal + */ + function CallbackQueue() { + this._callbacks = null; + this._contexts = null; + } + + assign(CallbackQueue.prototype, { + + /** + * Enqueues a callback to be invoked when `notifyAll` is invoked. + * + * @param {function} callback Invoked when `notifyAll` is invoked. + * @param {?object} context Context to call `callback` with. + * @internal + */ + enqueue: function (callback, context) { + this._callbacks = this._callbacks || []; + this._contexts = this._contexts || []; + this._callbacks.push(callback); + this._contexts.push(context); + }, + + /** + * Invokes all enqueued callbacks and clears the queue. This is invoked after + * the DOM representation of a component has been created or updated. + * + * @internal + */ + notifyAll: function () { + var callbacks = this._callbacks; + var contexts = this._contexts; + if (callbacks) { + !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : undefined; + this._callbacks = null; + this._contexts = null; + for (var i = 0; i < callbacks.length; i++) { + callbacks[i].call(contexts[i]); + } + callbacks.length = 0; + contexts.length = 0; + } + }, + + /** + * Resets the internal queue. + * + * @internal + */ + reset: function () { + this._callbacks = null; + this._contexts = null; + }, + + /** + * `PooledClass` looks for this. + */ + destructor: function () { + this.reset(); + } + + }); + + PooledClass.addPoolingTo(CallbackQueue); + + module.exports = CallbackQueue; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 245 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule PooledClass + */ + + 'use strict'; + + var invariant = __webpack_require__(202); + + /** + * Static poolers. Several custom versions for each potential number of + * arguments. A completely generic pooler is easy to implement, but would + * require accessing the `arguments` object. In each of these, `this` refers to + * the Class itself, not an instance. If any others are needed, simply add them + * here, or in their own files. + */ + var oneArgumentPooler = function (copyFieldsFrom) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, copyFieldsFrom); + return instance; + } else { + return new Klass(copyFieldsFrom); + } + }; + + var twoArgumentPooler = function (a1, a2) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2); + return instance; + } else { + return new Klass(a1, a2); + } + }; + + var threeArgumentPooler = function (a1, a2, a3) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3); + return instance; + } else { + return new Klass(a1, a2, a3); + } + }; + + var fourArgumentPooler = function (a1, a2, a3, a4) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3, a4); + return instance; + } else { + return new Klass(a1, a2, a3, a4); + } + }; + + var fiveArgumentPooler = function (a1, a2, a3, a4, a5) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3, a4, a5); + return instance; + } else { + return new Klass(a1, a2, a3, a4, a5); + } + }; + + var standardReleaser = function (instance) { + var Klass = this; + !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : undefined; + instance.destructor(); + if (Klass.instancePool.length < Klass.poolSize) { + Klass.instancePool.push(instance); + } + }; + + var DEFAULT_POOL_SIZE = 10; + var DEFAULT_POOLER = oneArgumentPooler; + + /** + * Augments `CopyConstructor` to be a poolable class, augmenting only the class + * itself (statically) not adding any prototypical fields. Any CopyConstructor + * you give this may have a `poolSize` property, and will look for a + * prototypical `destructor` on instances (optional). + * + * @param {Function} CopyConstructor Constructor that can be used to reset. + * @param {Function} pooler Customizable pooler. + */ + var addPoolingTo = function (CopyConstructor, pooler) { + var NewKlass = CopyConstructor; + NewKlass.instancePool = []; + NewKlass.getPooled = pooler || DEFAULT_POOLER; + if (!NewKlass.poolSize) { + NewKlass.poolSize = DEFAULT_POOL_SIZE; + } + NewKlass.release = standardReleaser; + return NewKlass; + }; + + var PooledClass = { + addPoolingTo: addPoolingTo, + oneArgumentPooler: oneArgumentPooler, + twoArgumentPooler: twoArgumentPooler, + threeArgumentPooler: threeArgumentPooler, + fourArgumentPooler: fourArgumentPooler, + fiveArgumentPooler: fiveArgumentPooler + }; + + module.exports = PooledClass; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 246 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule Transaction + */ + + 'use strict'; + + var invariant = __webpack_require__(202); + + /** + * `Transaction` creates a black box that is able to wrap any method such that + * certain invariants are maintained before and after the method is invoked + * (Even if an exception is thrown while invoking the wrapped method). Whoever + * instantiates a transaction can provide enforcers of the invariants at + * creation time. The `Transaction` class itself will supply one additional + * automatic invariant for you - the invariant that any transaction instance + * should not be run while it is already being run. You would typically create a + * single instance of a `Transaction` for reuse multiple times, that potentially + * is used to wrap several different methods. Wrappers are extremely simple - + * they only require implementing two methods. + * + * <pre> + * wrappers (injected at creation time) + * + + + * | | + * +-----------------|--------|--------------+ + * | v | | + * | +---------------+ | | + * | +--| wrapper1 |---|----+ | + * | | +---------------+ v | | + * | | +-------------+ | | + * | | +----| wrapper2 |--------+ | + * | | | +-------------+ | | | + * | | | | | | + * | v v v v | wrapper + * | +---+ +---+ +---------+ +---+ +---+ | invariants + * perform(anyMethod) | | | | | | | | | | | | maintained + * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|--------> + * | | | | | | | | | | | | + * | | | | | | | | | | | | + * | | | | | | | | | | | | + * | +---+ +---+ +---------+ +---+ +---+ | + * | initialize close | + * +-----------------------------------------+ + * </pre> + * + * Use cases: + * - Preserving the input selection ranges before/after reconciliation. + * Restoring selection even in the event of an unexpected error. + * - Deactivating events while rearranging the DOM, preventing blurs/focuses, + * while guaranteeing that afterwards, the event system is reactivated. + * - Flushing a queue of collected DOM mutations to the main UI thread after a + * reconciliation takes place in a worker thread. + * - Invoking any collected `componentDidUpdate` callbacks after rendering new + * content. + * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue + * to preserve the `scrollTop` (an automatic scroll aware DOM). + * - (Future use case): Layout calculations before and after DOM updates. + * + * Transactional plugin API: + * - A module that has an `initialize` method that returns any precomputation. + * - and a `close` method that accepts the precomputation. `close` is invoked + * when the wrapped process is completed, or has failed. + * + * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules + * that implement `initialize` and `close`. + * @return {Transaction} Single transaction for reuse in thread. + * + * @class Transaction + */ + var Mixin = { + /** + * Sets up this instance so that it is prepared for collecting metrics. Does + * so such that this setup method may be used on an instance that is already + * initialized, in a way that does not consume additional memory upon reuse. + * That can be useful if you decide to make your subclass of this mixin a + * "PooledClass". + */ + reinitializeTransaction: function () { + this.transactionWrappers = this.getTransactionWrappers(); + if (this.wrapperInitData) { + this.wrapperInitData.length = 0; + } else { + this.wrapperInitData = []; + } + this._isInTransaction = false; + }, + + _isInTransaction: false, + + /** + * @abstract + * @return {Array<TransactionWrapper>} Array of transaction wrappers. + */ + getTransactionWrappers: null, + + isInTransaction: function () { + return !!this._isInTransaction; + }, + + /** + * Executes the function within a safety window. Use this for the top level + * methods that result in large amounts of computation/mutations that would + * need to be safety checked. The optional arguments helps prevent the need + * to bind in many cases. + * + * @param {function} method Member of scope to call. + * @param {Object} scope Scope to invoke from. + * @param {Object?=} a Argument to pass to the method. + * @param {Object?=} b Argument to pass to the method. + * @param {Object?=} c Argument to pass to the method. + * @param {Object?=} d Argument to pass to the method. + * @param {Object?=} e Argument to pass to the method. + * @param {Object?=} f Argument to pass to the method. + * + * @return {*} Return value from `method`. + */ + perform: function (method, scope, a, b, c, d, e, f) { + !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : undefined; + var errorThrown; + var ret; + try { + this._isInTransaction = true; + // Catching errors makes debugging more difficult, so we start with + // errorThrown set to true before setting it to false after calling + // close -- if it's still set to true in the finally block, it means + // one of these calls threw. + errorThrown = true; + this.initializeAll(0); + ret = method.call(scope, a, b, c, d, e, f); + errorThrown = false; + } finally { + try { + if (errorThrown) { + // If `method` throws, prefer to show that stack trace over any thrown + // by invoking `closeAll`. + try { + this.closeAll(0); + } catch (err) {} + } else { + // Since `method` didn't throw, we don't want to silence the exception + // here. + this.closeAll(0); + } + } finally { + this._isInTransaction = false; + } + } + return ret; + }, + + initializeAll: function (startIndex) { + var transactionWrappers = this.transactionWrappers; + for (var i = startIndex; i < transactionWrappers.length; i++) { + var wrapper = transactionWrappers[i]; + try { + // Catching errors makes debugging more difficult, so we start with the + // OBSERVED_ERROR state before overwriting it with the real return value + // of initialize -- if it's still set to OBSERVED_ERROR in the finally + // block, it means wrapper.initialize threw. + this.wrapperInitData[i] = Transaction.OBSERVED_ERROR; + this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null; + } finally { + if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) { + // The initializer for wrapper i threw an error; initialize the + // remaining wrappers but silence any exceptions from them to ensure + // that the first error is the one to bubble up. + try { + this.initializeAll(i + 1); + } catch (err) {} + } + } + } + }, + + /** + * Invokes each of `this.transactionWrappers.close[i]` functions, passing into + * them the respective return values of `this.transactionWrappers.init[i]` + * (`close`rs that correspond to initializers that failed will not be + * invoked). + */ + closeAll: function (startIndex) { + !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : undefined; + var transactionWrappers = this.transactionWrappers; + for (var i = startIndex; i < transactionWrappers.length; i++) { + var wrapper = transactionWrappers[i]; + var initData = this.wrapperInitData[i]; + var errorThrown; + try { + // Catching errors makes debugging more difficult, so we start with + // errorThrown set to true before setting it to false after calling + // close -- if it's still set to true in the finally block, it means + // wrapper.close threw. + errorThrown = true; + if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) { + wrapper.close.call(this, initData); + } + errorThrown = false; + } finally { + if (errorThrown) { + // The closer for wrapper i threw an error; close the remaining + // wrappers but silence any exceptions from them to ensure that the + // first error is the one to bubble up. + try { + this.closeAll(i + 1); + } catch (e) {} + } + } + } + this.wrapperInitData.length = 0; + } + }; + + var Transaction = { + + Mixin: Mixin, + + /** + * Token to look for to determine if an error occurred. + */ + OBSERVED_ERROR: {} + + }; + + module.exports = Transaction; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 247 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule emptyObject + */ + + 'use strict'; + + var emptyObject = {}; + + if (process.env.NODE_ENV !== 'production') { + Object.freeze(emptyObject); + } + + module.exports = emptyObject; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 248 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule containsNode + * @typechecks + */ + + 'use strict'; + + var isTextNode = __webpack_require__(249); + + /*eslint-disable no-bitwise */ + + /** + * Checks if a given DOM node contains or is another DOM node. + * + * @param {?DOMNode} outerNode Outer DOM node. + * @param {?DOMNode} innerNode Inner DOM node. + * @return {boolean} True if `outerNode` contains or is `innerNode`. + */ + function containsNode(_x, _x2) { + var _again = true; + + _function: while (_again) { + var outerNode = _x, + innerNode = _x2; + _again = false; + + if (!outerNode || !innerNode) { + return false; + } else if (outerNode === innerNode) { + return true; + } else if (isTextNode(outerNode)) { + return false; + } else if (isTextNode(innerNode)) { + _x = outerNode; + _x2 = innerNode.parentNode; + _again = true; + continue _function; + } else if (outerNode.contains) { + return outerNode.contains(innerNode); + } else if (outerNode.compareDocumentPosition) { + return !!(outerNode.compareDocumentPosition(innerNode) & 16); + } else { + return false; + } + } + } + + module.exports = containsNode; + +/***/ }, +/* 249 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule isTextNode + * @typechecks + */ + + 'use strict'; + + var isNode = __webpack_require__(250); + + /** + * @param {*} object The object to check. + * @return {boolean} Whether or not the object is a DOM text node. + */ + function isTextNode(object) { + return isNode(object) && object.nodeType == 3; + } + + module.exports = isTextNode; + +/***/ }, +/* 250 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule isNode + * @typechecks + */ + + /** + * @param {*} object The object to check. + * @return {boolean} Whether or not the object is a DOM node. + */ + 'use strict'; + + function isNode(object) { + return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); + } + + module.exports = isNode; + +/***/ }, +/* 251 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule instantiateReactComponent + * @typechecks static-only + */ + + 'use strict'; + + var ReactCompositeComponent = __webpack_require__(252); + var ReactEmptyComponent = __webpack_require__(257); + var ReactNativeComponent = __webpack_require__(258); + + var assign = __webpack_require__(228); + var invariant = __webpack_require__(202); + var warning = __webpack_require__(214); + + // To avoid a cyclic dependency, we create the final class in this module + var ReactCompositeComponentWrapper = function () {}; + assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, { + _instantiateReactComponent: instantiateReactComponent + }); + + function getDeclarationErrorAddendum(owner) { + if (owner) { + var name = owner.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; + } + + /** + * Check if the type reference is a known internal type. I.e. not a user + * provided composite type. + * + * @param {function} type + * @return {boolean} Returns true if this is a valid internal type. + */ + function isInternalComponentType(type) { + return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function'; + } + + /** + * Given a ReactNode, create an instance that will actually be mounted. + * + * @param {ReactNode} node + * @return {object} A new instance of the element's constructor. + * @protected + */ + function instantiateReactComponent(node) { + var instance; + + if (node === null || node === false) { + instance = new ReactEmptyComponent(instantiateReactComponent); + } else if (typeof node === 'object') { + var element = node; + !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : undefined; + + // Special case string values + if (typeof element.type === 'string') { + instance = ReactNativeComponent.createInternalComponent(element); + } else if (isInternalComponentType(element.type)) { + // This is temporarily available for custom components that are not string + // representations. I.e. ART. Once those are updated to use the string + // representation, we can drop this code path. + instance = new element.type(element); + } else { + instance = new ReactCompositeComponentWrapper(); + } + } else if (typeof node === 'string' || typeof node === 'number') { + instance = ReactNativeComponent.createInstanceForText(node); + } else { + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : undefined; + } + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(typeof instance.construct === 'function' && typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : undefined; + } + + // Sets up the instance. This can probably just move into the constructor now. + instance.construct(node); + + // These two fields are used by the DOM and ART diffing algorithms + // respectively. Instead of using expandos on components, we should be + // storing the state needed by the diffing algorithms elsewhere. + instance._mountIndex = 0; + instance._mountImage = null; + + if (process.env.NODE_ENV !== 'production') { + instance._isOwnerNecessary = false; + instance._warnedAboutRefsInRender = false; + } + + // Internal instances should fully constructed at this point, so they should + // not get any new fields added to them at this point. + if (process.env.NODE_ENV !== 'production') { + if (Object.preventExtensions) { + Object.preventExtensions(instance); + } + } + + return instance; + } + + module.exports = instantiateReactComponent; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 252 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactCompositeComponent + */ + + 'use strict'; + + var ReactComponentEnvironment = __webpack_require__(253); + var ReactCurrentOwner = __webpack_require__(194); + var ReactElement = __webpack_require__(231); + var ReactInstanceMap = __webpack_require__(236); + var ReactPerf = __webpack_require__(207); + var ReactPropTypeLocations = __webpack_require__(254); + var ReactPropTypeLocationNames = __webpack_require__(255); + var ReactReconciler = __webpack_require__(239); + var ReactUpdateQueue = __webpack_require__(242); + + var assign = __webpack_require__(228); + var emptyObject = __webpack_require__(247); + var invariant = __webpack_require__(202); + var shouldUpdateReactComponent = __webpack_require__(256); + var warning = __webpack_require__(214); + + function getDeclarationErrorAddendum(component) { + var owner = component._currentElement._owner || null; + if (owner) { + var name = owner.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; + } + + function StatelessComponent(Component) {} + StatelessComponent.prototype.render = function () { + var Component = ReactInstanceMap.get(this)._currentElement.type; + return Component(this.props, this.context, this.updater); + }; + + /** + * ------------------ The Life-Cycle of a Composite Component ------------------ + * + * - constructor: Initialization of state. The instance is now retained. + * - componentWillMount + * - render + * - [children's constructors] + * - [children's componentWillMount and render] + * - [children's componentDidMount] + * - componentDidMount + * + * Update Phases: + * - componentWillReceiveProps (only called if parent updated) + * - shouldComponentUpdate + * - componentWillUpdate + * - render + * - [children's constructors or receive props phases] + * - componentDidUpdate + * + * - componentWillUnmount + * - [children's componentWillUnmount] + * - [children destroyed] + * - (destroyed): The instance is now blank, released by React and ready for GC. + * + * ----------------------------------------------------------------------------- + */ + + /** + * An incrementing ID assigned to each component when it is mounted. This is + * used to enforce the order in which `ReactUpdates` updates dirty components. + * + * @private + */ + var nextMountID = 1; + + /** + * @lends {ReactCompositeComponent.prototype} + */ + var ReactCompositeComponentMixin = { + + /** + * Base constructor for all composite component. + * + * @param {ReactElement} element + * @final + * @internal + */ + construct: function (element) { + this._currentElement = element; + this._rootNodeID = null; + this._instance = null; + + // See ReactUpdateQueue + this._pendingElement = null; + this._pendingStateQueue = null; + this._pendingReplaceState = false; + this._pendingForceUpdate = false; + + this._renderedComponent = null; + + this._context = null; + this._mountOrder = 0; + this._topLevelWrapper = null; + + // See ReactUpdates and ReactUpdateQueue. + this._pendingCallbacks = null; + }, + + /** + * Initializes the component, renders markup, and registers event listeners. + * + * @param {string} rootID DOM ID of the root node. + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @return {?string} Rendered markup to be inserted into the DOM. + * @final + * @internal + */ + mountComponent: function (rootID, transaction, context) { + this._context = context; + this._mountOrder = nextMountID++; + this._rootNodeID = rootID; + + var publicProps = this._processProps(this._currentElement.props); + var publicContext = this._processContext(context); + + var Component = this._currentElement.type; + + // Initialize the public class + var inst; + var renderedElement; + + // This is a way to detect if Component is a stateless arrow function + // component, which is not newable. It might not be 100% reliable but is + // something we can do until we start detecting that Component extends + // React.Component. We already assume that typeof Component === 'function'. + var canInstantiate = ('prototype' in Component); + + if (canInstantiate) { + if (process.env.NODE_ENV !== 'production') { + ReactCurrentOwner.current = this; + try { + inst = new Component(publicProps, publicContext, ReactUpdateQueue); + } finally { + ReactCurrentOwner.current = null; + } + } else { + inst = new Component(publicProps, publicContext, ReactUpdateQueue); + } + } + + if (!canInstantiate || inst === null || inst === false || ReactElement.isValidElement(inst)) { + renderedElement = inst; + inst = new StatelessComponent(Component); + } + + if (process.env.NODE_ENV !== 'production') { + // This will throw later in _renderValidatedComponent, but add an early + // warning now to help debugging + if (inst.render == null) { + process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`, returned ' + 'null/false from a stateless component, or tried to render an ' + 'element whose type is a function that isn\'t a React component.', Component.displayName || Component.name || 'Component') : undefined; + } else { + // We support ES6 inheriting from React.Component, the module pattern, + // and stateless components, but not ES6 classes that don't extend + process.env.NODE_ENV !== 'production' ? warning(Component.prototype && Component.prototype.isReactComponent || !canInstantiate || !(inst instanceof Component), '%s(...): React component classes must extend React.Component.', Component.displayName || Component.name || 'Component') : undefined; + } + } + + // These should be set up in the constructor, but as a convenience for + // simpler class abstractions, we set them up after the fact. + inst.props = publicProps; + inst.context = publicContext; + inst.refs = emptyObject; + inst.updater = ReactUpdateQueue; + + this._instance = inst; + + // Store a reference from the instance back to the internal representation + ReactInstanceMap.set(inst, this); + + if (process.env.NODE_ENV !== 'production') { + // Since plain JS classes are defined without any special initialization + // logic, we can not catch common errors early. Therefore, we have to + // catch them here, at initialization time, instead. + process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : undefined; + process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : undefined; + process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : undefined; + process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : undefined; + process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : undefined; + process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : undefined; + process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : undefined; + } + + var initialState = inst.state; + if (initialState === undefined) { + inst.state = initialState = null; + } + !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined; + + this._pendingStateQueue = null; + this._pendingReplaceState = false; + this._pendingForceUpdate = false; + + if (inst.componentWillMount) { + inst.componentWillMount(); + // When mounting, calls to `setState` by `componentWillMount` will set + // `this._pendingStateQueue` without triggering a re-render. + if (this._pendingStateQueue) { + inst.state = this._processPendingState(inst.props, inst.context); + } + } + + // If not a stateless component, we now render + if (renderedElement === undefined) { + renderedElement = this._renderValidatedComponent(); + } + + this._renderedComponent = this._instantiateReactComponent(renderedElement); + + var markup = ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, this._processChildContext(context)); + if (inst.componentDidMount) { + transaction.getReactMountReady().enqueue(inst.componentDidMount, inst); + } + + return markup; + }, + + /** + * Releases any resources allocated by `mountComponent`. + * + * @final + * @internal + */ + unmountComponent: function () { + var inst = this._instance; + + if (inst.componentWillUnmount) { + inst.componentWillUnmount(); + } + + ReactReconciler.unmountComponent(this._renderedComponent); + this._renderedComponent = null; + this._instance = null; + + // Reset pending fields + // Even if this component is scheduled for another update in ReactUpdates, + // it would still be ignored because these fields are reset. + this._pendingStateQueue = null; + this._pendingReplaceState = false; + this._pendingForceUpdate = false; + this._pendingCallbacks = null; + this._pendingElement = null; + + // These fields do not really need to be reset since this object is no + // longer accessible. + this._context = null; + this._rootNodeID = null; + this._topLevelWrapper = null; + + // Delete the reference from the instance to this internal representation + // which allow the internals to be properly cleaned up even if the user + // leaks a reference to the public instance. + ReactInstanceMap.remove(inst); + + // Some existing components rely on inst.props even after they've been + // destroyed (in event handlers). + // TODO: inst.props = null; + // TODO: inst.state = null; + // TODO: inst.context = null; + }, + + /** + * Filters the context object to only contain keys specified in + * `contextTypes` + * + * @param {object} context + * @return {?object} + * @private + */ + _maskContext: function (context) { + var maskedContext = null; + var Component = this._currentElement.type; + var contextTypes = Component.contextTypes; + if (!contextTypes) { + return emptyObject; + } + maskedContext = {}; + for (var contextName in contextTypes) { + maskedContext[contextName] = context[contextName]; + } + return maskedContext; + }, + + /** + * Filters the context object to only contain keys specified in + * `contextTypes`, and asserts that they are valid. + * + * @param {object} context + * @return {?object} + * @private + */ + _processContext: function (context) { + var maskedContext = this._maskContext(context); + if (process.env.NODE_ENV !== 'production') { + var Component = this._currentElement.type; + if (Component.contextTypes) { + this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context); + } + } + return maskedContext; + }, + + /** + * @param {object} currentContext + * @return {object} + * @private + */ + _processChildContext: function (currentContext) { + var Component = this._currentElement.type; + var inst = this._instance; + var childContext = inst.getChildContext && inst.getChildContext(); + if (childContext) { + !(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined; + if (process.env.NODE_ENV !== 'production') { + this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext); + } + for (var name in childContext) { + !(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : undefined; + } + return assign({}, currentContext, childContext); + } + return currentContext; + }, + + /** + * Processes props by setting default values for unspecified props and + * asserting that the props are valid. Does not mutate its argument; returns + * a new props object with defaults merged in. + * + * @param {object} newProps + * @return {object} + * @private + */ + _processProps: function (newProps) { + if (process.env.NODE_ENV !== 'production') { + var Component = this._currentElement.type; + if (Component.propTypes) { + this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop); + } + } + return newProps; + }, + + /** + * Assert that the props are valid + * + * @param {object} propTypes Map of prop name to a ReactPropType + * @param {object} props + * @param {string} location e.g. "prop", "context", "child context" + * @private + */ + _checkPropTypes: function (propTypes, props, location) { + // TODO: Stop validating prop types here and only use the element + // validation. + var componentName = this.getName(); + for (var propName in propTypes) { + if (propTypes.hasOwnProperty(propName)) { + var error; + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + !(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually ' + 'from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined; + error = propTypes[propName](props, propName, componentName, location); + } catch (ex) { + error = ex; + } + if (error instanceof Error) { + // We may want to extend this logic for similar errors in + // top-level render calls, so I'm abstracting it away into + // a function to minimize refactoring in the future + var addendum = getDeclarationErrorAddendum(this); + + if (location === ReactPropTypeLocations.prop) { + // Preface gives us something to blacklist in warning module + process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : undefined; + } else { + process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : undefined; + } + } + } + } + }, + + receiveComponent: function (nextElement, transaction, nextContext) { + var prevElement = this._currentElement; + var prevContext = this._context; + + this._pendingElement = null; + + this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext); + }, + + /** + * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate` + * is set, update the component. + * + * @param {ReactReconcileTransaction} transaction + * @internal + */ + performUpdateIfNecessary: function (transaction) { + if (this._pendingElement != null) { + ReactReconciler.receiveComponent(this, this._pendingElement || this._currentElement, transaction, this._context); + } + + if (this._pendingStateQueue !== null || this._pendingForceUpdate) { + this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context); + } + }, + + /** + * Perform an update to a mounted component. The componentWillReceiveProps and + * shouldComponentUpdate methods are called, then (assuming the update isn't + * skipped) the remaining update lifecycle methods are called and the DOM + * representation is updated. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @param {ReactElement} prevParentElement + * @param {ReactElement} nextParentElement + * @internal + * @overridable + */ + updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) { + var inst = this._instance; + + var nextContext = this._context === nextUnmaskedContext ? inst.context : this._processContext(nextUnmaskedContext); + var nextProps; + + // Distinguish between a props update versus a simple state update + if (prevParentElement === nextParentElement) { + // Skip checking prop types again -- we don't read inst.props to avoid + // warning for DOM component props in this upgrade + nextProps = nextParentElement.props; + } else { + nextProps = this._processProps(nextParentElement.props); + // An update here will schedule an update but immediately set + // _pendingStateQueue which will ensure that any state updates gets + // immediately reconciled instead of waiting for the next batch. + + if (inst.componentWillReceiveProps) { + inst.componentWillReceiveProps(nextProps, nextContext); + } + } + + var nextState = this._processPendingState(nextProps, nextContext); + + var shouldUpdate = this._pendingForceUpdate || !inst.shouldComponentUpdate || inst.shouldComponentUpdate(nextProps, nextState, nextContext); + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(typeof shouldUpdate !== 'undefined', '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : undefined; + } + + if (shouldUpdate) { + this._pendingForceUpdate = false; + // Will set `this.props`, `this.state` and `this.context`. + this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext); + } else { + // If it's determined that a component should not update, we still want + // to set props and state but we shortcut the rest of the update. + this._currentElement = nextParentElement; + this._context = nextUnmaskedContext; + inst.props = nextProps; + inst.state = nextState; + inst.context = nextContext; + } + }, + + _processPendingState: function (props, context) { + var inst = this._instance; + var queue = this._pendingStateQueue; + var replace = this._pendingReplaceState; + this._pendingReplaceState = false; + this._pendingStateQueue = null; + + if (!queue) { + return inst.state; + } + + if (replace && queue.length === 1) { + return queue[0]; + } + + var nextState = assign({}, replace ? queue[0] : inst.state); + for (var i = replace ? 1 : 0; i < queue.length; i++) { + var partial = queue[i]; + assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial); + } + + return nextState; + }, + + /** + * Merges new props and state, notifies delegate methods of update and + * performs update. + * + * @param {ReactElement} nextElement Next element + * @param {object} nextProps Next public object to set as properties. + * @param {?object} nextState Next object to set as state. + * @param {?object} nextContext Next public object to set as context. + * @param {ReactReconcileTransaction} transaction + * @param {?object} unmaskedContext + * @private + */ + _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) { + var inst = this._instance; + + var hasComponentDidUpdate = Boolean(inst.componentDidUpdate); + var prevProps; + var prevState; + var prevContext; + if (hasComponentDidUpdate) { + prevProps = inst.props; + prevState = inst.state; + prevContext = inst.context; + } + + if (inst.componentWillUpdate) { + inst.componentWillUpdate(nextProps, nextState, nextContext); + } + + this._currentElement = nextElement; + this._context = unmaskedContext; + inst.props = nextProps; + inst.state = nextState; + inst.context = nextContext; + + this._updateRenderedComponent(transaction, unmaskedContext); + + if (hasComponentDidUpdate) { + transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst); + } + }, + + /** + * Call the component's `render` method and update the DOM accordingly. + * + * @param {ReactReconcileTransaction} transaction + * @internal + */ + _updateRenderedComponent: function (transaction, context) { + var prevComponentInstance = this._renderedComponent; + var prevRenderedElement = prevComponentInstance._currentElement; + var nextRenderedElement = this._renderValidatedComponent(); + if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) { + ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); + } else { + // These two IDs are actually the same! But nothing should rely on that. + var thisID = this._rootNodeID; + var prevComponentID = prevComponentInstance._rootNodeID; + ReactReconciler.unmountComponent(prevComponentInstance); + + this._renderedComponent = this._instantiateReactComponent(nextRenderedElement); + var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, thisID, transaction, this._processChildContext(context)); + this._replaceNodeWithMarkupByID(prevComponentID, nextMarkup); + } + }, + + /** + * @protected + */ + _replaceNodeWithMarkupByID: function (prevComponentID, nextMarkup) { + ReactComponentEnvironment.replaceNodeWithMarkupByID(prevComponentID, nextMarkup); + }, + + /** + * @protected + */ + _renderValidatedComponentWithoutOwnerOrContext: function () { + var inst = this._instance; + var renderedComponent = inst.render(); + if (process.env.NODE_ENV !== 'production') { + // We allow auto-mocks to proceed as if they're returning null. + if (typeof renderedComponent === 'undefined' && inst.render._isMockFunction) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + renderedComponent = null; + } + } + + return renderedComponent; + }, + + /** + * @private + */ + _renderValidatedComponent: function () { + var renderedComponent; + ReactCurrentOwner.current = this; + try { + renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext(); + } finally { + ReactCurrentOwner.current = null; + } + !( + // TODO: An `isValidNode` function would probably be more appropriate + renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid ReactComponent must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined; + return renderedComponent; + }, + + /** + * Lazily allocates the refs object and stores `component` as `ref`. + * + * @param {string} ref Reference name. + * @param {component} component Component to store as `ref`. + * @final + * @private + */ + attachRef: function (ref, component) { + var inst = this.getPublicInstance(); + !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : undefined; + var publicComponentInstance = component.getPublicInstance(); + if (process.env.NODE_ENV !== 'production') { + var componentName = component && component.getName ? component.getName() : 'a component'; + process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : undefined; + } + var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs; + refs[ref] = publicComponentInstance; + }, + + /** + * Detaches a reference name. + * + * @param {string} ref Name to dereference. + * @final + * @private + */ + detachRef: function (ref) { + var refs = this.getPublicInstance().refs; + delete refs[ref]; + }, + + /** + * Get a text description of the component that can be used to identify it + * in error messages. + * @return {string} The name or null. + * @internal + */ + getName: function () { + var type = this._currentElement.type; + var constructor = this._instance && this._instance.constructor; + return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null; + }, + + /** + * Get the publicly accessible representation of this component - i.e. what + * is exposed by refs and returned by render. Can be null for stateless + * components. + * + * @return {ReactComponent} the public component instance. + * @internal + */ + getPublicInstance: function () { + var inst = this._instance; + if (inst instanceof StatelessComponent) { + return null; + } + return inst; + }, + + // Stub + _instantiateReactComponent: null + + }; + + ReactPerf.measureMethods(ReactCompositeComponentMixin, 'ReactCompositeComponent', { + mountComponent: 'mountComponent', + updateComponent: 'updateComponent', + _renderValidatedComponent: '_renderValidatedComponent' + }); + + var ReactCompositeComponent = { + + Mixin: ReactCompositeComponentMixin + + }; + + module.exports = ReactCompositeComponent; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 253 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactComponentEnvironment + */ + + 'use strict'; + + var invariant = __webpack_require__(202); + + var injected = false; + + var ReactComponentEnvironment = { + + /** + * Optionally injectable environment dependent cleanup hook. (server vs. + * browser etc). Example: A browser system caches DOM nodes based on component + * ID and must remove that cache entry when this instance is unmounted. + */ + unmountIDFromEnvironment: null, + + /** + * Optionally injectable hook for swapping out mount images in the middle of + * the tree. + */ + replaceNodeWithMarkupByID: null, + + /** + * Optionally injectable hook for processing a queue of child updates. Will + * later move into MultiChildComponents. + */ + processChildrenUpdates: null, + + injection: { + injectEnvironment: function (environment) { + !!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : undefined; + ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment; + ReactComponentEnvironment.replaceNodeWithMarkupByID = environment.replaceNodeWithMarkupByID; + ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates; + injected = true; + } + } + + }; + + module.exports = ReactComponentEnvironment; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 254 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactPropTypeLocations + */ + + 'use strict'; + + var keyMirror = __webpack_require__(206); + + var ReactPropTypeLocations = keyMirror({ + prop: null, + context: null, + childContext: null + }); + + module.exports = ReactPropTypeLocations; + +/***/ }, +/* 255 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactPropTypeLocationNames + */ + + 'use strict'; + + var ReactPropTypeLocationNames = {}; + + if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; + } + + module.exports = ReactPropTypeLocationNames; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 256 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule shouldUpdateReactComponent + * @typechecks static-only + */ + + 'use strict'; + + /** + * Given a `prevElement` and `nextElement`, determines if the existing + * instance should be updated as opposed to being destroyed or replaced by a new + * instance. Both arguments are elements. This ensures that this logic can + * operate on stateless trees without any backing instance. + * + * @param {?object} prevElement + * @param {?object} nextElement + * @return {boolean} True if the existing instance should be updated. + * @protected + */ + function shouldUpdateReactComponent(prevElement, nextElement) { + var prevEmpty = prevElement === null || prevElement === false; + var nextEmpty = nextElement === null || nextElement === false; + if (prevEmpty || nextEmpty) { + return prevEmpty === nextEmpty; + } + + var prevType = typeof prevElement; + var nextType = typeof nextElement; + if (prevType === 'string' || prevType === 'number') { + return nextType === 'string' || nextType === 'number'; + } else { + return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key; + } + return false; + } + + module.exports = shouldUpdateReactComponent; + +/***/ }, +/* 257 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactEmptyComponent + */ + + 'use strict'; + + var ReactElement = __webpack_require__(231); + var ReactEmptyComponentRegistry = __webpack_require__(233); + var ReactReconciler = __webpack_require__(239); + + var assign = __webpack_require__(228); + + var placeholderElement; + + var ReactEmptyComponentInjection = { + injectEmptyComponent: function (component) { + placeholderElement = ReactElement.createElement(component); + } + }; + + var ReactEmptyComponent = function (instantiate) { + this._currentElement = null; + this._rootNodeID = null; + this._renderedComponent = instantiate(placeholderElement); + }; + assign(ReactEmptyComponent.prototype, { + construct: function (element) {}, + mountComponent: function (rootID, transaction, context) { + ReactEmptyComponentRegistry.registerNullComponentID(rootID); + this._rootNodeID = rootID; + return ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, context); + }, + receiveComponent: function () {}, + unmountComponent: function (rootID, transaction, context) { + ReactReconciler.unmountComponent(this._renderedComponent); + ReactEmptyComponentRegistry.deregisterNullComponentID(this._rootNodeID); + this._rootNodeID = null; + this._renderedComponent = null; + } + }); + + ReactEmptyComponent.injection = ReactEmptyComponentInjection; + + module.exports = ReactEmptyComponent; + +/***/ }, +/* 258 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactNativeComponent + */ + + 'use strict'; + + var assign = __webpack_require__(228); + var invariant = __webpack_require__(202); + + var autoGenerateWrapperClass = null; + var genericComponentClass = null; + // This registry keeps track of wrapper classes around native tags. + var tagToComponentClass = {}; + var textComponentClass = null; + + var ReactNativeComponentInjection = { + // This accepts a class that receives the tag string. This is a catch all + // that can render any kind of tag. + injectGenericComponentClass: function (componentClass) { + genericComponentClass = componentClass; + }, + // This accepts a text component class that takes the text string to be + // rendered as props. + injectTextComponentClass: function (componentClass) { + textComponentClass = componentClass; + }, + // This accepts a keyed object with classes as values. Each key represents a + // tag. That particular tag will use this class instead of the generic one. + injectComponentClasses: function (componentClasses) { + assign(tagToComponentClass, componentClasses); + } + }; + + /** + * Get a composite component wrapper class for a specific tag. + * + * @param {ReactElement} element The tag for which to get the class. + * @return {function} The React class constructor function. + */ + function getComponentClassForElement(element) { + if (typeof element.type === 'function') { + return element.type; + } + var tag = element.type; + var componentClass = tagToComponentClass[tag]; + if (componentClass == null) { + tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag); + } + return componentClass; + } + + /** + * Get a native internal component class for a specific tag. + * + * @param {ReactElement} element The element to create. + * @return {function} The internal class constructor function. + */ + function createInternalComponent(element) { + !genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : undefined; + return new genericComponentClass(element.type, element.props); + } + + /** + * @param {ReactText} text + * @return {ReactComponent} + */ + function createInstanceForText(text) { + return new textComponentClass(text); + } + + /** + * @param {ReactComponent} component + * @return {boolean} + */ + function isTextComponent(component) { + return component instanceof textComponentClass; + } + + var ReactNativeComponent = { + getComponentClassForElement: getComponentClassForElement, + createInternalComponent: createInternalComponent, + createInstanceForText: createInstanceForText, + isTextComponent: isTextComponent, + injection: ReactNativeComponentInjection + }; + + module.exports = ReactNativeComponent; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 259 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule validateDOMNesting + */ + + 'use strict'; + + var assign = __webpack_require__(228); + var emptyFunction = __webpack_require__(204); + var warning = __webpack_require__(214); + + var validateDOMNesting = emptyFunction; + + if (process.env.NODE_ENV !== 'production') { + // This validation code was written based on the HTML5 parsing spec: + // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope + // + // Note: this does not catch all invalid nesting, nor does it try to (as it's + // not clear what practical benefit doing so provides); instead, we warn only + // for cases where the parser will give a parse tree differing from what React + // intended. For example, <b><div></div></b> is invalid but we don't warn + // because it still parses correctly; we do warn for other cases like nested + // <p> tags where the beginning of the second element implicitly closes the + // first, causing a confusing mess. + + // https://html.spec.whatwg.org/multipage/syntax.html#special + var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; + + // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope + var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', + + // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point + // TODO: Distinguish by namespace here -- for <title>, including it here + // errs on the side of fewer warnings + 'foreignObject', 'desc', 'title']; + + // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope + var buttonScopeTags = inScopeTags.concat(['button']); + + // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags + var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt']; + + var emptyAncestorInfo = { + parentTag: null, + + formTag: null, + aTagInScope: null, + buttonTagInScope: null, + nobrTagInScope: null, + pTagInButtonScope: null, + + listItemTagAutoclosing: null, + dlItemTagAutoclosing: null + }; + + var updatedAncestorInfo = function (oldInfo, tag, instance) { + var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo); + var info = { tag: tag, instance: instance }; + + if (inScopeTags.indexOf(tag) !== -1) { + ancestorInfo.aTagInScope = null; + ancestorInfo.buttonTagInScope = null; + ancestorInfo.nobrTagInScope = null; + } + if (buttonScopeTags.indexOf(tag) !== -1) { + ancestorInfo.pTagInButtonScope = null; + } + + // See rules for 'li', 'dd', 'dt' start tags in + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody + if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') { + ancestorInfo.listItemTagAutoclosing = null; + ancestorInfo.dlItemTagAutoclosing = null; + } + + ancestorInfo.parentTag = info; + + if (tag === 'form') { + ancestorInfo.formTag = info; + } + if (tag === 'a') { + ancestorInfo.aTagInScope = info; + } + if (tag === 'button') { + ancestorInfo.buttonTagInScope = info; + } + if (tag === 'nobr') { + ancestorInfo.nobrTagInScope = info; + } + if (tag === 'p') { + ancestorInfo.pTagInButtonScope = info; + } + if (tag === 'li') { + ancestorInfo.listItemTagAutoclosing = info; + } + if (tag === 'dd' || tag === 'dt') { + ancestorInfo.dlItemTagAutoclosing = info; + } + + return ancestorInfo; + }; + + /** + * Returns whether + */ + var isTagValidWithParent = function (tag, parentTag) { + // First, let's check if we're in an unusual parsing mode... + switch (parentTag) { + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect + case 'select': + return tag === 'option' || tag === 'optgroup' || tag === '#text'; + case 'optgroup': + return tag === 'option' || tag === '#text'; + // Strictly speaking, seeing an <option> doesn't mean we're in a <select> + // but + case 'option': + return tag === '#text'; + + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption + // No special behavior since these rules fall back to "in body" mode for + // all except special table nodes which cause bad parsing behavior anyway. + + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr + case 'tr': + return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template'; + + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody + case 'tbody': + case 'thead': + case 'tfoot': + return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template'; + + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup + case 'colgroup': + return tag === 'col' || tag === 'template'; + + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable + case 'table': + return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template'; + + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead + case 'head': + return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template'; + + // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element + case 'html': + return tag === 'head' || tag === 'body'; + } + + // Probably in the "in body" parsing mode, so we outlaw only tag combos + // where the parsing rules cause implicit opens or closes to be added. + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody + switch (tag) { + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6'; + + case 'rp': + case 'rt': + return impliedEndTags.indexOf(parentTag) === -1; + + case 'caption': + case 'col': + case 'colgroup': + case 'frame': + case 'head': + case 'tbody': + case 'td': + case 'tfoot': + case 'th': + case 'thead': + case 'tr': + // These tags are only valid with a few parents that have special child + // parsing rules -- if we're down here, then none of those matched and + // so we allow it only if we don't know what the parent is, as all other + // cases are invalid. + return parentTag == null; + } + + return true; + }; + + /** + * Returns whether + */ + var findInvalidAncestorForTag = function (tag, ancestorInfo) { + switch (tag) { + case 'address': + case 'article': + case 'aside': + case 'blockquote': + case 'center': + case 'details': + case 'dialog': + case 'dir': + case 'div': + case 'dl': + case 'fieldset': + case 'figcaption': + case 'figure': + case 'footer': + case 'header': + case 'hgroup': + case 'main': + case 'menu': + case 'nav': + case 'ol': + case 'p': + case 'section': + case 'summary': + case 'ul': + + case 'pre': + case 'listing': + + case 'table': + + case 'hr': + + case 'xmp': + + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + return ancestorInfo.pTagInButtonScope; + + case 'form': + return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope; + + case 'li': + return ancestorInfo.listItemTagAutoclosing; + + case 'dd': + case 'dt': + return ancestorInfo.dlItemTagAutoclosing; + + case 'button': + return ancestorInfo.buttonTagInScope; + + case 'a': + // Spec says something about storing a list of markers, but it sounds + // equivalent to this check. + return ancestorInfo.aTagInScope; + + case 'nobr': + return ancestorInfo.nobrTagInScope; + } + + return null; + }; + + /** + * Given a ReactCompositeComponent instance, return a list of its recursive + * owners, starting at the root and ending with the instance itself. + */ + var findOwnerStack = function (instance) { + if (!instance) { + return []; + } + + var stack = []; + /*eslint-disable space-after-keywords */ + do { + /*eslint-enable space-after-keywords */ + stack.push(instance); + } while (instance = instance._currentElement._owner); + stack.reverse(); + return stack; + }; + + var didWarn = {}; + + validateDOMNesting = function (childTag, childInstance, ancestorInfo) { + ancestorInfo = ancestorInfo || emptyAncestorInfo; + var parentInfo = ancestorInfo.parentTag; + var parentTag = parentInfo && parentInfo.tag; + + var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo; + var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo); + var problematic = invalidParent || invalidAncestor; + + if (problematic) { + var ancestorTag = problematic.tag; + var ancestorInstance = problematic.instance; + + var childOwner = childInstance && childInstance._currentElement._owner; + var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner; + + var childOwners = findOwnerStack(childOwner); + var ancestorOwners = findOwnerStack(ancestorOwner); + + var minStackLen = Math.min(childOwners.length, ancestorOwners.length); + var i; + + var deepestCommon = -1; + for (i = 0; i < minStackLen; i++) { + if (childOwners[i] === ancestorOwners[i]) { + deepestCommon = i; + } else { + break; + } + } + + var UNKNOWN = '(unknown)'; + var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) { + return inst.getName() || UNKNOWN; + }); + var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) { + return inst.getName() || UNKNOWN; + }); + var ownerInfo = [].concat( + // If the parent and child instances have a common owner ancestor, start + // with that -- otherwise we just start with the parent's owners. + deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag, + // If we're warning about an invalid (non-parent) ancestry, add '...' + invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > '); + + var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo; + if (didWarn[warnKey]) { + return; + } + didWarn[warnKey] = true; + + if (invalidParent) { + var info = ''; + if (ancestorTag === 'table' && childTag === 'tr') { + info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.'; + } + process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a child of <%s>. ' + 'See %s.%s', childTag, ancestorTag, ownerInfo, info) : undefined; + } else { + process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a descendant of ' + '<%s>. See %s.', childTag, ancestorTag, ownerInfo) : undefined; + } + } + }; + + validateDOMNesting.ancestorInfoContextKey = '__validateDOMNesting_ancestorInfo$' + Math.random().toString(36).slice(2); + + validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo; + + // For testing + validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) { + ancestorInfo = ancestorInfo || emptyAncestorInfo; + var parentInfo = ancestorInfo.parentTag; + var parentTag = parentInfo && parentInfo.tag; + return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo); + }; + } + + module.exports = validateDOMNesting; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 260 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDefaultInjection + */ + + 'use strict'; + + var BeforeInputEventPlugin = __webpack_require__(261); + var ChangeEventPlugin = __webpack_require__(269); + var ClientReactRootIndex = __webpack_require__(272); + var DefaultEventPluginOrder = __webpack_require__(273); + var EnterLeaveEventPlugin = __webpack_require__(274); + var ExecutionEnvironment = __webpack_require__(198); + var HTMLDOMPropertyConfig = __webpack_require__(278); + var ReactBrowserComponentMixin = __webpack_require__(279); + var ReactComponentBrowserEnvironment = __webpack_require__(215); + var ReactDefaultBatchingStrategy = __webpack_require__(281); + var ReactDOMComponent = __webpack_require__(282); + var ReactDOMTextComponent = __webpack_require__(195); + var ReactEventListener = __webpack_require__(307); + var ReactInjection = __webpack_require__(310); + var ReactInstanceHandles = __webpack_require__(234); + var ReactMount = __webpack_require__(217); + var ReactReconcileTransaction = __webpack_require__(314); + var SelectEventPlugin = __webpack_require__(319); + var ServerReactRootIndex = __webpack_require__(320); + var SimpleEventPlugin = __webpack_require__(321); + var SVGDOMPropertyConfig = __webpack_require__(330); + + var alreadyInjected = false; + + function inject() { + if (alreadyInjected) { + // TODO: This is currently true because these injections are shared between + // the client and the server package. They should be built independently + // and not share any injection state. Then this problem will be solved. + return; + } + alreadyInjected = true; + + ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener); + + /** + * Inject modules for resolving DOM hierarchy and plugin ordering. + */ + ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder); + ReactInjection.EventPluginHub.injectInstanceHandle(ReactInstanceHandles); + ReactInjection.EventPluginHub.injectMount(ReactMount); + + /** + * Some important event plugins included by default (without having to require + * them). + */ + ReactInjection.EventPluginHub.injectEventPluginsByName({ + SimpleEventPlugin: SimpleEventPlugin, + EnterLeaveEventPlugin: EnterLeaveEventPlugin, + ChangeEventPlugin: ChangeEventPlugin, + SelectEventPlugin: SelectEventPlugin, + BeforeInputEventPlugin: BeforeInputEventPlugin + }); + + ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent); + + ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent); + + ReactInjection.Class.injectMixin(ReactBrowserComponentMixin); + + ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig); + ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig); + + ReactInjection.EmptyComponent.injectEmptyComponent('noscript'); + + ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction); + ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy); + + ReactInjection.RootIndex.injectCreateReactRootIndex(ExecutionEnvironment.canUseDOM ? ClientReactRootIndex.createReactRootIndex : ServerReactRootIndex.createReactRootIndex); + + ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment); + + if (process.env.NODE_ENV !== 'production') { + var url = ExecutionEnvironment.canUseDOM && window.location.href || ''; + if (/[?&]react_perf\b/.test(url)) { + var ReactDefaultPerf = __webpack_require__(331); + ReactDefaultPerf.start(); + } + } + } + + module.exports = { + inject: inject + }; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 261 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015 Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule BeforeInputEventPlugin + * @typechecks static-only + */ + + 'use strict'; + + var EventConstants = __webpack_require__(219); + var EventPropagators = __webpack_require__(262); + var ExecutionEnvironment = __webpack_require__(198); + var FallbackCompositionState = __webpack_require__(263); + var SyntheticCompositionEvent = __webpack_require__(265); + var SyntheticInputEvent = __webpack_require__(267); + + var keyOf = __webpack_require__(268); + + var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space + var START_KEYCODE = 229; + + var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window; + + var documentMode = null; + if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) { + documentMode = document.documentMode; + } + + // Webkit offers a very useful `textInput` event that can be used to + // directly represent `beforeInput`. The IE `textinput` event is not as + // useful, so we don't use it. + var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto(); + + // In IE9+, we have access to composition events, but the data supplied + // by the native compositionend event may be incorrect. Japanese ideographic + // spaces, for instance (\u3000) are not recorded correctly. + var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); + + /** + * Opera <= 12 includes TextEvent in window, but does not fire + * text input events. Rely on keypress instead. + */ + function isPresto() { + var opera = window.opera; + return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12; + } + + var SPACEBAR_CODE = 32; + var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); + + var topLevelTypes = EventConstants.topLevelTypes; + + // Events and their corresponding property names. + var eventTypes = { + beforeInput: { + phasedRegistrationNames: { + bubbled: keyOf({ onBeforeInput: null }), + captured: keyOf({ onBeforeInputCapture: null }) + }, + dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste] + }, + compositionEnd: { + phasedRegistrationNames: { + bubbled: keyOf({ onCompositionEnd: null }), + captured: keyOf({ onCompositionEndCapture: null }) + }, + dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown] + }, + compositionStart: { + phasedRegistrationNames: { + bubbled: keyOf({ onCompositionStart: null }), + captured: keyOf({ onCompositionStartCapture: null }) + }, + dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown] + }, + compositionUpdate: { + phasedRegistrationNames: { + bubbled: keyOf({ onCompositionUpdate: null }), + captured: keyOf({ onCompositionUpdateCapture: null }) + }, + dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown] + } + }; + + // Track whether we've ever handled a keypress on the space key. + var hasSpaceKeypress = false; + + /** + * Return whether a native keypress event is assumed to be a command. + * This is required because Firefox fires `keypress` events for key commands + * (cut, copy, select-all, etc.) even though no character is inserted. + */ + function isKeypressCommand(nativeEvent) { + return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && + // ctrlKey && altKey is equivalent to AltGr, and is not a command. + !(nativeEvent.ctrlKey && nativeEvent.altKey); + } + + /** + * Translate native top level events into event types. + * + * @param {string} topLevelType + * @return {object} + */ + function getCompositionEventType(topLevelType) { + switch (topLevelType) { + case topLevelTypes.topCompositionStart: + return eventTypes.compositionStart; + case topLevelTypes.topCompositionEnd: + return eventTypes.compositionEnd; + case topLevelTypes.topCompositionUpdate: + return eventTypes.compositionUpdate; + } + } + + /** + * Does our fallback best-guess model think this event signifies that + * composition has begun? + * + * @param {string} topLevelType + * @param {object} nativeEvent + * @return {boolean} + */ + function isFallbackCompositionStart(topLevelType, nativeEvent) { + return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE; + } + + /** + * Does our fallback mode think that this event is the end of composition? + * + * @param {string} topLevelType + * @param {object} nativeEvent + * @return {boolean} + */ + function isFallbackCompositionEnd(topLevelType, nativeEvent) { + switch (topLevelType) { + case topLevelTypes.topKeyUp: + // Command keys insert or clear IME input. + return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; + case topLevelTypes.topKeyDown: + // Expect IME keyCode on each keydown. If we get any other + // code we must have exited earlier. + return nativeEvent.keyCode !== START_KEYCODE; + case topLevelTypes.topKeyPress: + case topLevelTypes.topMouseDown: + case topLevelTypes.topBlur: + // Events are not possible without cancelling IME. + return true; + default: + return false; + } + } + + /** + * Google Input Tools provides composition data via a CustomEvent, + * with the `data` property populated in the `detail` object. If this + * is available on the event object, use it. If not, this is a plain + * composition event and we have nothing special to extract. + * + * @param {object} nativeEvent + * @return {?string} + */ + function getDataFromCustomEvent(nativeEvent) { + var detail = nativeEvent.detail; + if (typeof detail === 'object' && 'data' in detail) { + return detail.data; + } + return null; + } + + // Track the current IME composition fallback object, if any. + var currentComposition = null; + + /** + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {?object} A SyntheticCompositionEvent. + */ + function extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) { + var eventType; + var fallbackData; + + if (canUseCompositionEvent) { + eventType = getCompositionEventType(topLevelType); + } else if (!currentComposition) { + if (isFallbackCompositionStart(topLevelType, nativeEvent)) { + eventType = eventTypes.compositionStart; + } + } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) { + eventType = eventTypes.compositionEnd; + } + + if (!eventType) { + return null; + } + + if (useFallbackCompositionData) { + // The current composition is stored statically and must not be + // overwritten while composition continues. + if (!currentComposition && eventType === eventTypes.compositionStart) { + currentComposition = FallbackCompositionState.getPooled(topLevelTarget); + } else if (eventType === eventTypes.compositionEnd) { + if (currentComposition) { + fallbackData = currentComposition.getData(); + } + } + } + + var event = SyntheticCompositionEvent.getPooled(eventType, topLevelTargetID, nativeEvent, nativeEventTarget); + + if (fallbackData) { + // Inject data generated from fallback path into the synthetic event. + // This matches the property of native CompositionEventInterface. + event.data = fallbackData; + } else { + var customData = getDataFromCustomEvent(nativeEvent); + if (customData !== null) { + event.data = customData; + } + } + + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; + } + + /** + * @param {string} topLevelType Record from `EventConstants`. + * @param {object} nativeEvent Native browser event. + * @return {?string} The string corresponding to this `beforeInput` event. + */ + function getNativeBeforeInputChars(topLevelType, nativeEvent) { + switch (topLevelType) { + case topLevelTypes.topCompositionEnd: + return getDataFromCustomEvent(nativeEvent); + case topLevelTypes.topKeyPress: + /** + * If native `textInput` events are available, our goal is to make + * use of them. However, there is a special case: the spacebar key. + * In Webkit, preventing default on a spacebar `textInput` event + * cancels character insertion, but it *also* causes the browser + * to fall back to its default spacebar behavior of scrolling the + * page. + * + * Tracking at: + * https://code.google.com/p/chromium/issues/detail?id=355103 + * + * To avoid this issue, use the keypress event as if no `textInput` + * event is available. + */ + var which = nativeEvent.which; + if (which !== SPACEBAR_CODE) { + return null; + } + + hasSpaceKeypress = true; + return SPACEBAR_CHAR; + + case topLevelTypes.topTextInput: + // Record the characters to be added to the DOM. + var chars = nativeEvent.data; + + // If it's a spacebar character, assume that we have already handled + // it at the keypress level and bail immediately. Android Chrome + // doesn't give us keycodes, so we need to blacklist it. + if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { + return null; + } + + return chars; + + default: + // For other native event types, do nothing. + return null; + } + } + + /** + * For browsers that do not provide the `textInput` event, extract the + * appropriate string to use for SyntheticInputEvent. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {object} nativeEvent Native browser event. + * @return {?string} The fallback string for this `beforeInput` event. + */ + function getFallbackBeforeInputChars(topLevelType, nativeEvent) { + // If we are currently composing (IME) and using a fallback to do so, + // try to extract the composed characters from the fallback object. + if (currentComposition) { + if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) { + var chars = currentComposition.getData(); + FallbackCompositionState.release(currentComposition); + currentComposition = null; + return chars; + } + return null; + } + + switch (topLevelType) { + case topLevelTypes.topPaste: + // If a paste event occurs after a keypress, throw out the input + // chars. Paste events should not lead to BeforeInput events. + return null; + case topLevelTypes.topKeyPress: + /** + * As of v27, Firefox may fire keypress events even when no character + * will be inserted. A few possibilities: + * + * - `which` is `0`. Arrow keys, Esc key, etc. + * + * - `which` is the pressed key code, but no char is available. + * Ex: 'AltGr + d` in Polish. There is no modified character for + * this key combination and no character is inserted into the + * document, but FF fires the keypress for char code `100` anyway. + * No `input` event will occur. + * + * - `which` is the pressed key code, but a command combination is + * being used. Ex: `Cmd+C`. No character is inserted, and no + * `input` event will occur. + */ + if (nativeEvent.which && !isKeypressCommand(nativeEvent)) { + return String.fromCharCode(nativeEvent.which); + } + return null; + case topLevelTypes.topCompositionEnd: + return useFallbackCompositionData ? null : nativeEvent.data; + default: + return null; + } + } + + /** + * Extract a SyntheticInputEvent for `beforeInput`, based on either native + * `textInput` or fallback behavior. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {?object} A SyntheticInputEvent. + */ + function extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) { + var chars; + + if (canUseTextInputEvent) { + chars = getNativeBeforeInputChars(topLevelType, nativeEvent); + } else { + chars = getFallbackBeforeInputChars(topLevelType, nativeEvent); + } + + // If no characters are being inserted, no BeforeInput event should + // be fired. + if (!chars) { + return null; + } + + var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, topLevelTargetID, nativeEvent, nativeEventTarget); + + event.data = chars; + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; + } + + /** + * Create an `onBeforeInput` event to match + * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. + * + * This event plugin is based on the native `textInput` event + * available in Chrome, Safari, Opera, and IE. This event fires after + * `onKeyPress` and `onCompositionEnd`, but before `onInput`. + * + * `beforeInput` is spec'd but not implemented in any browsers, and + * the `input` event does not provide any useful information about what has + * actually been added, contrary to the spec. Thus, `textInput` is the best + * available event to identify the characters that have actually been inserted + * into the target node. + * + * This plugin is also responsible for emitting `composition` events, thus + * allowing us to share composition fallback code for both `beforeInput` and + * `composition` event types. + */ + var BeforeInputEventPlugin = { + + eventTypes: eventTypes, + + /** + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @see {EventPluginHub.extractEvents} + */ + extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) { + return [extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget)]; + } + }; + + module.exports = BeforeInputEventPlugin; + +/***/ }, +/* 262 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EventPropagators + */ + + 'use strict'; + + var EventConstants = __webpack_require__(219); + var EventPluginHub = __webpack_require__(220); + + var warning = __webpack_require__(214); + + var accumulateInto = __webpack_require__(224); + var forEachAccumulated = __webpack_require__(225); + + var PropagationPhases = EventConstants.PropagationPhases; + var getListener = EventPluginHub.getListener; + + /** + * Some event types have a notion of different registration names for different + * "phases" of propagation. This finds listeners by a given phase. + */ + function listenerAtPhase(id, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListener(id, registrationName); + } + + /** + * Tags a `SyntheticEvent` with dispatched listeners. Creating this function + * here, allows us to not have to bind or create functions for each event. + * Mutating the event's members allows us to not have to create a wrapping + * "dispatch" object that pairs the event with the listener. + */ + function accumulateDirectionalDispatches(domID, upwards, event) { + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(domID, 'Dispatching id must not be null') : undefined; + } + var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured; + var listener = listenerAtPhase(domID, event, phase); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchIDs = accumulateInto(event._dispatchIDs, domID); + } + } + + /** + * Collect dispatches (must be entirely collected before dispatching - see unit + * tests). Lazily allocate the array to conserve memory. We must loop through + * each event and perform the traversal for each one. We cannot perform a + * single traversal for the entire collection of events because each event may + * have a different target. + */ + function accumulateTwoPhaseDispatchesSingle(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event); + } + } + + /** + * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID. + */ + function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event); + } + } + + /** + * Accumulates without regard to direction, does not look for phased + * registration names. Same as `accumulateDirectDispatchesSingle` but without + * requiring that the `dispatchMarker` be the same as the dispatched ID. + */ + function accumulateDispatches(id, ignoredDirection, event) { + if (event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName; + var listener = getListener(id, registrationName); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchIDs = accumulateInto(event._dispatchIDs, id); + } + } + } + + /** + * Accumulates dispatches on an `SyntheticEvent`, but only for the + * `dispatchMarker`. + * @param {SyntheticEvent} event + */ + function accumulateDirectDispatchesSingle(event) { + if (event && event.dispatchConfig.registrationName) { + accumulateDispatches(event.dispatchMarker, null, event); + } + } + + function accumulateTwoPhaseDispatches(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); + } + + function accumulateTwoPhaseDispatchesSkipTarget(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); + } + + function accumulateEnterLeaveDispatches(leave, enter, fromID, toID) { + EventPluginHub.injection.getInstanceHandle().traverseEnterLeave(fromID, toID, accumulateDispatches, leave, enter); + } + + function accumulateDirectDispatches(events) { + forEachAccumulated(events, accumulateDirectDispatchesSingle); + } + + /** + * A small set of propagation patterns, each of which will accept a small amount + * of information, and generate a set of "dispatch ready event objects" - which + * are sets of events that have already been annotated with a set of dispatched + * listener functions/ids. The API is designed this way to discourage these + * propagation strategies from actually executing the dispatches, since we + * always want to collect the entire set of dispatches before executing event a + * single one. + * + * @constructor EventPropagators + */ + var EventPropagators = { + accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, + accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, + accumulateDirectDispatches: accumulateDirectDispatches, + accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches + }; + + module.exports = EventPropagators; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 263 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule FallbackCompositionState + * @typechecks static-only + */ + + 'use strict'; + + var PooledClass = __webpack_require__(245); + + var assign = __webpack_require__(228); + var getTextContentAccessor = __webpack_require__(264); + + /** + * This helper class stores information about text content of a target node, + * allowing comparison of content before and after a given event. + * + * Identify the node where selection currently begins, then observe + * both its text content and its current position in the DOM. Since the + * browser may natively replace the target node during composition, we can + * use its position to find its replacement. + * + * @param {DOMEventTarget} root + */ + function FallbackCompositionState(root) { + this._root = root; + this._startText = this.getText(); + this._fallbackText = null; + } + + assign(FallbackCompositionState.prototype, { + destructor: function () { + this._root = null; + this._startText = null; + this._fallbackText = null; + }, + + /** + * Get current text of input. + * + * @return {string} + */ + getText: function () { + if ('value' in this._root) { + return this._root.value; + } + return this._root[getTextContentAccessor()]; + }, + + /** + * Determine the differing substring between the initially stored + * text content and the current content. + * + * @return {string} + */ + getData: function () { + if (this._fallbackText) { + return this._fallbackText; + } + + var start; + var startValue = this._startText; + var startLength = startValue.length; + var end; + var endValue = this.getText(); + var endLength = endValue.length; + + for (start = 0; start < startLength; start++) { + if (startValue[start] !== endValue[start]) { + break; + } + } + + var minEnd = startLength - start; + for (end = 1; end <= minEnd; end++) { + if (startValue[startLength - end] !== endValue[endLength - end]) { + break; + } + } + + var sliceTail = end > 1 ? 1 - end : undefined; + this._fallbackText = endValue.slice(start, sliceTail); + return this._fallbackText; + } + }); + + PooledClass.addPoolingTo(FallbackCompositionState); + + module.exports = FallbackCompositionState; + +/***/ }, +/* 264 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getTextContentAccessor + */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(198); + + var contentKey = null; + + /** + * Gets the key used to access text content on a DOM node. + * + * @return {?string} Key used to access text content. + * @internal + */ + function getTextContentAccessor() { + if (!contentKey && ExecutionEnvironment.canUseDOM) { + // Prefer textContent to innerText because many browsers support both but + // SVG <text> elements don't support innerText even when <div> does. + contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText'; + } + return contentKey; + } + + module.exports = getTextContentAccessor; + +/***/ }, +/* 265 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticCompositionEvent + * @typechecks static-only + */ + + 'use strict'; + + var SyntheticEvent = __webpack_require__(266); + + /** + * @interface Event + * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents + */ + var CompositionEventInterface = { + data: null + }; + + /** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ + function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + + SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); + + module.exports = SyntheticCompositionEvent; + +/***/ }, +/* 266 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticEvent + * @typechecks static-only + */ + + 'use strict'; + + var PooledClass = __webpack_require__(245); + + var assign = __webpack_require__(228); + var emptyFunction = __webpack_require__(204); + var warning = __webpack_require__(214); + + /** + * @interface Event + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var EventInterface = { + type: null, + // currentTarget is set when dispatching; no use in copying it here + currentTarget: emptyFunction.thatReturnsNull, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function (event) { + return event.timeStamp || Date.now(); + }, + defaultPrevented: null, + isTrusted: null + }; + + /** + * Synthetic events are dispatched by event plugins, typically in response to a + * top-level event delegation handler. + * + * These systems should generally use pooling to reduce the frequency of garbage + * collection. The system should check `isPersistent` to determine whether the + * event should be released into the pool after being dispatched. Users that + * need a persisted event should invoke `persist`. + * + * Synthetic events (and subclasses) implement the DOM Level 3 Events API by + * normalizing browser quirks. Subclasses do not necessarily have to implement a + * DOM interface; custom application-specific events can also subclass this. + * + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + */ + function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + this.dispatchConfig = dispatchConfig; + this.dispatchMarker = dispatchMarker; + this.nativeEvent = nativeEvent; + this.target = nativeEventTarget; + this.currentTarget = nativeEventTarget; + + var Interface = this.constructor.Interface; + for (var propName in Interface) { + if (!Interface.hasOwnProperty(propName)) { + continue; + } + var normalize = Interface[propName]; + if (normalize) { + this[propName] = normalize(nativeEvent); + } else { + this[propName] = nativeEvent[propName]; + } + } + + var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; + if (defaultPrevented) { + this.isDefaultPrevented = emptyFunction.thatReturnsTrue; + } else { + this.isDefaultPrevented = emptyFunction.thatReturnsFalse; + } + this.isPropagationStopped = emptyFunction.thatReturnsFalse; + } + + assign(SyntheticEvent.prototype, { + + preventDefault: function () { + this.defaultPrevented = true; + var event = this.nativeEvent; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `preventDefault` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined; + } + if (!event) { + return; + } + + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + this.isDefaultPrevented = emptyFunction.thatReturnsTrue; + }, + + stopPropagation: function () { + var event = this.nativeEvent; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `stopPropagation` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined; + } + if (!event) { + return; + } + + if (event.stopPropagation) { + event.stopPropagation(); + } else { + event.cancelBubble = true; + } + this.isPropagationStopped = emptyFunction.thatReturnsTrue; + }, + + /** + * We release all dispatched `SyntheticEvent`s after each event loop, adding + * them back into the pool. This allows a way to hold onto a reference that + * won't be added back into the pool. + */ + persist: function () { + this.isPersistent = emptyFunction.thatReturnsTrue; + }, + + /** + * Checks if this event should be released back into the pool. + * + * @return {boolean} True if this should not be released, false otherwise. + */ + isPersistent: emptyFunction.thatReturnsFalse, + + /** + * `PooledClass` looks for `destructor` on each instance it releases. + */ + destructor: function () { + var Interface = this.constructor.Interface; + for (var propName in Interface) { + this[propName] = null; + } + this.dispatchConfig = null; + this.dispatchMarker = null; + this.nativeEvent = null; + } + + }); + + SyntheticEvent.Interface = EventInterface; + + /** + * Helper to reduce boilerplate when creating subclasses. + * + * @param {function} Class + * @param {?object} Interface + */ + SyntheticEvent.augmentClass = function (Class, Interface) { + var Super = this; + + var prototype = Object.create(Super.prototype); + assign(prototype, Class.prototype); + Class.prototype = prototype; + Class.prototype.constructor = Class; + + Class.Interface = assign({}, Super.Interface, Interface); + Class.augmentClass = Super.augmentClass; + + PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler); + }; + + PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler); + + module.exports = SyntheticEvent; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 267 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticInputEvent + * @typechecks static-only + */ + + 'use strict'; + + var SyntheticEvent = __webpack_require__(266); + + /** + * @interface Event + * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 + * /#events-inputevents + */ + var InputEventInterface = { + data: null + }; + + /** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ + function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + + SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface); + + module.exports = SyntheticInputEvent; + +/***/ }, +/* 268 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule keyOf + */ + + /** + * Allows extraction of a minified key. Let's the build system minify keys + * without losing the ability to dynamically use key strings as values + * themselves. Pass in an object with a single key/val pair and it will return + * you the string key of that single record. Suppose you want to grab the + * value for a key 'className' inside of an object. Key/val minification may + * have aliased that key to be 'xa12'. keyOf({className: null}) will return + * 'xa12' in that case. Resolve keys you want to use once at startup time, then + * reuse those resolutions. + */ + "use strict"; + + var keyOf = function (oneKeyObj) { + var key; + for (key in oneKeyObj) { + if (!oneKeyObj.hasOwnProperty(key)) { + continue; + } + return key; + } + return null; + }; + + module.exports = keyOf; + +/***/ }, +/* 269 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ChangeEventPlugin + */ + + 'use strict'; + + var EventConstants = __webpack_require__(219); + var EventPluginHub = __webpack_require__(220); + var EventPropagators = __webpack_require__(262); + var ExecutionEnvironment = __webpack_require__(198); + var ReactUpdates = __webpack_require__(243); + var SyntheticEvent = __webpack_require__(266); + + var getEventTarget = __webpack_require__(270); + var isEventSupported = __webpack_require__(229); + var isTextInputElement = __webpack_require__(271); + var keyOf = __webpack_require__(268); + + var topLevelTypes = EventConstants.topLevelTypes; + + var eventTypes = { + change: { + phasedRegistrationNames: { + bubbled: keyOf({ onChange: null }), + captured: keyOf({ onChangeCapture: null }) + }, + dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange] + } + }; + + /** + * For IE shims + */ + var activeElement = null; + var activeElementID = null; + var activeElementValue = null; + var activeElementValueProp = null; + + /** + * SECTION: handle `change` event + */ + function shouldUseChangeEvent(elem) { + var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); + return nodeName === 'select' || nodeName === 'input' && elem.type === 'file'; + } + + var doesChangeEventBubble = false; + if (ExecutionEnvironment.canUseDOM) { + // See `handleChange` comment below + doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8); + } + + function manualDispatchChangeEvent(nativeEvent) { + var event = SyntheticEvent.getPooled(eventTypes.change, activeElementID, nativeEvent, getEventTarget(nativeEvent)); + EventPropagators.accumulateTwoPhaseDispatches(event); + + // If change and propertychange bubbled, we'd just bind to it like all the + // other events and have it go through ReactBrowserEventEmitter. Since it + // doesn't, we manually listen for the events and so we have to enqueue and + // process the abstract event manually. + // + // Batching is necessary here in order to ensure that all event handlers run + // before the next rerender (including event handlers attached to ancestor + // elements instead of directly on the input). Without this, controlled + // components don't work properly in conjunction with event bubbling because + // the component is rerendered and the value reverted before all the event + // handlers can run. See https://github.com/facebook/react/issues/708. + ReactUpdates.batchedUpdates(runEventInBatch, event); + } + + function runEventInBatch(event) { + EventPluginHub.enqueueEvents(event); + EventPluginHub.processEventQueue(false); + } + + function startWatchingForChangeEventIE8(target, targetID) { + activeElement = target; + activeElementID = targetID; + activeElement.attachEvent('onchange', manualDispatchChangeEvent); + } + + function stopWatchingForChangeEventIE8() { + if (!activeElement) { + return; + } + activeElement.detachEvent('onchange', manualDispatchChangeEvent); + activeElement = null; + activeElementID = null; + } + + function getTargetIDForChangeEvent(topLevelType, topLevelTarget, topLevelTargetID) { + if (topLevelType === topLevelTypes.topChange) { + return topLevelTargetID; + } + } + function handleEventsForChangeEventIE8(topLevelType, topLevelTarget, topLevelTargetID) { + if (topLevelType === topLevelTypes.topFocus) { + // stopWatching() should be a noop here but we call it just in case we + // missed a blur event somehow. + stopWatchingForChangeEventIE8(); + startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID); + } else if (topLevelType === topLevelTypes.topBlur) { + stopWatchingForChangeEventIE8(); + } + } + + /** + * SECTION: handle `input` event + */ + var isInputEventSupported = false; + if (ExecutionEnvironment.canUseDOM) { + // IE9 claims to support the input event but fails to trigger it when + // deleting text, so we ignore its input events + isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 9); + } + + /** + * (For old IE.) Replacement getter/setter for the `value` property that gets + * set on the active element. + */ + var newValueProp = { + get: function () { + return activeElementValueProp.get.call(this); + }, + set: function (val) { + // Cast to a string so we can do equality checks. + activeElementValue = '' + val; + activeElementValueProp.set.call(this, val); + } + }; + + /** + * (For old IE.) Starts tracking propertychange events on the passed-in element + * and override the value property so that we can distinguish user events from + * value changes in JS. + */ + function startWatchingForValueChange(target, targetID) { + activeElement = target; + activeElementID = targetID; + activeElementValue = target.value; + activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value'); + + // Not guarded in a canDefineProperty check: IE8 supports defineProperty only + // on DOM elements + Object.defineProperty(activeElement, 'value', newValueProp); + activeElement.attachEvent('onpropertychange', handlePropertyChange); + } + + /** + * (For old IE.) Removes the event listeners from the currently-tracked element, + * if any exists. + */ + function stopWatchingForValueChange() { + if (!activeElement) { + return; + } + + // delete restores the original property definition + delete activeElement.value; + activeElement.detachEvent('onpropertychange', handlePropertyChange); + + activeElement = null; + activeElementID = null; + activeElementValue = null; + activeElementValueProp = null; + } + + /** + * (For old IE.) Handles a propertychange event, sending a `change` event if + * the value of the active element has changed. + */ + function handlePropertyChange(nativeEvent) { + if (nativeEvent.propertyName !== 'value') { + return; + } + var value = nativeEvent.srcElement.value; + if (value === activeElementValue) { + return; + } + activeElementValue = value; + + manualDispatchChangeEvent(nativeEvent); + } + + /** + * If a `change` event should be fired, returns the target's ID. + */ + function getTargetIDForInputEvent(topLevelType, topLevelTarget, topLevelTargetID) { + if (topLevelType === topLevelTypes.topInput) { + // In modern browsers (i.e., not IE8 or IE9), the input event is exactly + // what we want so fall through here and trigger an abstract event + return topLevelTargetID; + } + } + + // For IE8 and IE9. + function handleEventsForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) { + if (topLevelType === topLevelTypes.topFocus) { + // In IE8, we can capture almost all .value changes by adding a + // propertychange handler and looking for events with propertyName + // equal to 'value' + // In IE9, propertychange fires for most input events but is buggy and + // doesn't fire when text is deleted, but conveniently, selectionchange + // appears to fire in all of the remaining cases so we catch those and + // forward the event if the value has changed + // In either case, we don't want to call the event handler if the value + // is changed from JS so we redefine a setter for `.value` that updates + // our activeElementValue variable, allowing us to ignore those changes + // + // stopWatching() should be a noop here but we call it just in case we + // missed a blur event somehow. + stopWatchingForValueChange(); + startWatchingForValueChange(topLevelTarget, topLevelTargetID); + } else if (topLevelType === topLevelTypes.topBlur) { + stopWatchingForValueChange(); + } + } + + // For IE8 and IE9. + function getTargetIDForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) { + if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) { + // On the selectionchange event, the target is just document which isn't + // helpful for us so just check activeElement instead. + // + // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire + // propertychange on the first input event after setting `value` from a + // script and fires only keydown, keypress, keyup. Catching keyup usually + // gets it and catching keydown lets us fire an event for the first + // keystroke if user does a key repeat (it'll be a little delayed: right + // before the second keystroke). Other input methods (e.g., paste) seem to + // fire selectionchange normally. + if (activeElement && activeElement.value !== activeElementValue) { + activeElementValue = activeElement.value; + return activeElementID; + } + } + } + + /** + * SECTION: handle `click` event + */ + function shouldUseClickEvent(elem) { + // Use the `click` event to detect changes to checkbox and radio inputs. + // This approach works across all browsers, whereas `change` does not fire + // until `blur` in IE8. + return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio'); + } + + function getTargetIDForClickEvent(topLevelType, topLevelTarget, topLevelTargetID) { + if (topLevelType === topLevelTypes.topClick) { + return topLevelTargetID; + } + } + + /** + * This plugin creates an `onChange` event that normalizes change events + * across form elements. This event fires at a time when it's possible to + * change the element's value without seeing a flicker. + * + * Supported elements are: + * - input (see `isTextInputElement`) + * - textarea + * - select + */ + var ChangeEventPlugin = { + + eventTypes: eventTypes, + + /** + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @see {EventPluginHub.extractEvents} + */ + extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) { + + var getTargetIDFunc, handleEventFunc; + if (shouldUseChangeEvent(topLevelTarget)) { + if (doesChangeEventBubble) { + getTargetIDFunc = getTargetIDForChangeEvent; + } else { + handleEventFunc = handleEventsForChangeEventIE8; + } + } else if (isTextInputElement(topLevelTarget)) { + if (isInputEventSupported) { + getTargetIDFunc = getTargetIDForInputEvent; + } else { + getTargetIDFunc = getTargetIDForInputEventIE; + handleEventFunc = handleEventsForInputEventIE; + } + } else if (shouldUseClickEvent(topLevelTarget)) { + getTargetIDFunc = getTargetIDForClickEvent; + } + + if (getTargetIDFunc) { + var targetID = getTargetIDFunc(topLevelType, topLevelTarget, topLevelTargetID); + if (targetID) { + var event = SyntheticEvent.getPooled(eventTypes.change, targetID, nativeEvent, nativeEventTarget); + event.type = 'change'; + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; + } + } + + if (handleEventFunc) { + handleEventFunc(topLevelType, topLevelTarget, topLevelTargetID); + } + } + + }; + + module.exports = ChangeEventPlugin; + +/***/ }, +/* 270 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getEventTarget + * @typechecks static-only + */ + + 'use strict'; + + /** + * Gets the target node from a native browser event by accounting for + * inconsistencies in browser DOM APIs. + * + * @param {object} nativeEvent Native browser event. + * @return {DOMEventTarget} Target node. + */ + function getEventTarget(nativeEvent) { + var target = nativeEvent.target || nativeEvent.srcElement || window; + // Safari may fire events on text nodes (Node.TEXT_NODE is 3). + // @see http://www.quirksmode.org/js/events_properties.html + return target.nodeType === 3 ? target.parentNode : target; + } + + module.exports = getEventTarget; + +/***/ }, +/* 271 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule isTextInputElement + */ + + 'use strict'; + + /** + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary + */ + var supportedInputTypes = { + 'color': true, + 'date': true, + 'datetime': true, + 'datetime-local': true, + 'email': true, + 'month': true, + 'number': true, + 'password': true, + 'range': true, + 'search': true, + 'tel': true, + 'text': true, + 'time': true, + 'url': true, + 'week': true + }; + + function isTextInputElement(elem) { + var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); + return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea'); + } + + module.exports = isTextInputElement; + +/***/ }, +/* 272 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ClientReactRootIndex + * @typechecks + */ + + 'use strict'; + + var nextReactRootIndex = 0; + + var ClientReactRootIndex = { + createReactRootIndex: function () { + return nextReactRootIndex++; + } + }; + + module.exports = ClientReactRootIndex; + +/***/ }, +/* 273 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule DefaultEventPluginOrder + */ + + 'use strict'; + + var keyOf = __webpack_require__(268); + + /** + * Module that is injectable into `EventPluginHub`, that specifies a + * deterministic ordering of `EventPlugin`s. A convenient way to reason about + * plugins, without having to package every one of them. This is better than + * having plugins be ordered in the same order that they are injected because + * that ordering would be influenced by the packaging order. + * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that + * preventing default on events is convenient in `SimpleEventPlugin` handlers. + */ + var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })]; + + module.exports = DefaultEventPluginOrder; + +/***/ }, +/* 274 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EnterLeaveEventPlugin + * @typechecks static-only + */ + + 'use strict'; + + var EventConstants = __webpack_require__(219); + var EventPropagators = __webpack_require__(262); + var SyntheticMouseEvent = __webpack_require__(275); + + var ReactMount = __webpack_require__(217); + var keyOf = __webpack_require__(268); + + var topLevelTypes = EventConstants.topLevelTypes; + var getFirstReactDOM = ReactMount.getFirstReactDOM; + + var eventTypes = { + mouseEnter: { + registrationName: keyOf({ onMouseEnter: null }), + dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver] + }, + mouseLeave: { + registrationName: keyOf({ onMouseLeave: null }), + dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver] + } + }; + + var extractedEvents = [null, null]; + + var EnterLeaveEventPlugin = { + + eventTypes: eventTypes, + + /** + * For almost every interaction we care about, there will be both a top-level + * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that + * we do not extract duplicate events. However, moving the mouse into the + * browser from outside will not fire a `mouseout` event. In this case, we use + * the `mouseover` top-level event. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @see {EventPluginHub.extractEvents} + */ + extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) { + if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { + return null; + } + if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) { + // Must not be a mouse in or mouse out - ignoring. + return null; + } + + var win; + if (topLevelTarget.window === topLevelTarget) { + // `topLevelTarget` is probably a window object. + win = topLevelTarget; + } else { + // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. + var doc = topLevelTarget.ownerDocument; + if (doc) { + win = doc.defaultView || doc.parentWindow; + } else { + win = window; + } + } + + var from; + var to; + var fromID = ''; + var toID = ''; + if (topLevelType === topLevelTypes.topMouseOut) { + from = topLevelTarget; + fromID = topLevelTargetID; + to = getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement); + if (to) { + toID = ReactMount.getID(to); + } else { + to = win; + } + to = to || win; + } else { + from = win; + to = topLevelTarget; + toID = topLevelTargetID; + } + + if (from === to) { + // Nothing pertains to our managed components. + return null; + } + + var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, fromID, nativeEvent, nativeEventTarget); + leave.type = 'mouseleave'; + leave.target = from; + leave.relatedTarget = to; + + var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, toID, nativeEvent, nativeEventTarget); + enter.type = 'mouseenter'; + enter.target = to; + enter.relatedTarget = from; + + EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID); + + extractedEvents[0] = leave; + extractedEvents[1] = enter; + + return extractedEvents; + } + + }; + + module.exports = EnterLeaveEventPlugin; + +/***/ }, +/* 275 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticMouseEvent + * @typechecks static-only + */ + + 'use strict'; + + var SyntheticUIEvent = __webpack_require__(276); + var ViewportMetrics = __webpack_require__(227); + + var getEventModifierState = __webpack_require__(277); + + /** + * @interface MouseEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var MouseEventInterface = { + screenX: null, + screenY: null, + clientX: null, + clientY: null, + ctrlKey: null, + shiftKey: null, + altKey: null, + metaKey: null, + getModifierState: getEventModifierState, + button: function (event) { + // Webkit, Firefox, IE9+ + // which: 1 2 3 + // button: 0 1 2 (standard) + var button = event.button; + if ('which' in event) { + return button; + } + // IE<9 + // which: undefined + // button: 0 0 0 + // button: 1 4 2 (onmouseup) + return button === 2 ? 2 : button === 4 ? 1 : 0; + }, + buttons: null, + relatedTarget: function (event) { + return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); + }, + // "Proprietary" Interface. + pageX: function (event) { + return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft; + }, + pageY: function (event) { + return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop; + } + }; + + /** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ + function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + + SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); + + module.exports = SyntheticMouseEvent; + +/***/ }, +/* 276 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticUIEvent + * @typechecks static-only + */ + + 'use strict'; + + var SyntheticEvent = __webpack_require__(266); + + var getEventTarget = __webpack_require__(270); + + /** + * @interface UIEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var UIEventInterface = { + view: function (event) { + if (event.view) { + return event.view; + } + + var target = getEventTarget(event); + if (target != null && target.window === target) { + // target is a window object + return target; + } + + var doc = target.ownerDocument; + // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. + if (doc) { + return doc.defaultView || doc.parentWindow; + } else { + return window; + } + }, + detail: function (event) { + return event.detail || 0; + } + }; + + /** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticEvent} + */ + function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + + SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); + + module.exports = SyntheticUIEvent; + +/***/ }, +/* 277 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getEventModifierState + * @typechecks static-only + */ + + 'use strict'; + + /** + * Translation from modifier key to the associated property in the event. + * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers + */ + + var modifierKeyToProp = { + 'Alt': 'altKey', + 'Control': 'ctrlKey', + 'Meta': 'metaKey', + 'Shift': 'shiftKey' + }; + + // IE8 does not implement getModifierState so we simply map it to the only + // modifier keys exposed by the event itself, does not support Lock-keys. + // Currently, all major browsers except Chrome seems to support Lock-keys. + function modifierStateGetter(keyArg) { + var syntheticEvent = this; + var nativeEvent = syntheticEvent.nativeEvent; + if (nativeEvent.getModifierState) { + return nativeEvent.getModifierState(keyArg); + } + var keyProp = modifierKeyToProp[keyArg]; + return keyProp ? !!nativeEvent[keyProp] : false; + } + + function getEventModifierState(nativeEvent) { + return modifierStateGetter; + } + + module.exports = getEventModifierState; + +/***/ }, +/* 278 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule HTMLDOMPropertyConfig + */ + + 'use strict'; + + var DOMProperty = __webpack_require__(212); + var ExecutionEnvironment = __webpack_require__(198); + + var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE; + var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; + var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; + var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS; + var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE; + var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE; + var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE; + + var hasSVG; + if (ExecutionEnvironment.canUseDOM) { + var implementation = document.implementation; + hasSVG = implementation && implementation.hasFeature && implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1'); + } + + var HTMLDOMPropertyConfig = { + isCustomAttribute: RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/), + Properties: { + /** + * Standard Properties + */ + accept: null, + acceptCharset: null, + accessKey: null, + action: null, + allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, + allowTransparency: MUST_USE_ATTRIBUTE, + alt: null, + async: HAS_BOOLEAN_VALUE, + autoComplete: null, + // autoFocus is polyfilled/normalized by AutoFocusUtils + // autoFocus: HAS_BOOLEAN_VALUE, + autoPlay: HAS_BOOLEAN_VALUE, + capture: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, + cellPadding: null, + cellSpacing: null, + charSet: MUST_USE_ATTRIBUTE, + challenge: MUST_USE_ATTRIBUTE, + checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + classID: MUST_USE_ATTRIBUTE, + // To set className on SVG elements, it's necessary to use .setAttribute; + // this works on HTML elements too in all browsers except IE8. Conveniently, + // IE8 doesn't support SVG and so we can simply use the attribute in + // browsers that support SVG and the property in browsers that don't, + // regardless of whether the element is HTML or SVG. + className: hasSVG ? MUST_USE_ATTRIBUTE : MUST_USE_PROPERTY, + cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE, + colSpan: null, + content: null, + contentEditable: null, + contextMenu: MUST_USE_ATTRIBUTE, + controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + coords: null, + crossOrigin: null, + data: null, // For `<object />` acts as `src`. + dateTime: MUST_USE_ATTRIBUTE, + 'default': HAS_BOOLEAN_VALUE, + defer: HAS_BOOLEAN_VALUE, + dir: null, + disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, + download: HAS_OVERLOADED_BOOLEAN_VALUE, + draggable: null, + encType: null, + form: MUST_USE_ATTRIBUTE, + formAction: MUST_USE_ATTRIBUTE, + formEncType: MUST_USE_ATTRIBUTE, + formMethod: MUST_USE_ATTRIBUTE, + formNoValidate: HAS_BOOLEAN_VALUE, + formTarget: MUST_USE_ATTRIBUTE, + frameBorder: MUST_USE_ATTRIBUTE, + headers: null, + height: MUST_USE_ATTRIBUTE, + hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, + high: null, + href: null, + hrefLang: null, + htmlFor: null, + httpEquiv: null, + icon: null, + id: MUST_USE_PROPERTY, + inputMode: MUST_USE_ATTRIBUTE, + integrity: null, + is: MUST_USE_ATTRIBUTE, + keyParams: MUST_USE_ATTRIBUTE, + keyType: MUST_USE_ATTRIBUTE, + kind: null, + label: null, + lang: null, + list: MUST_USE_ATTRIBUTE, + loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + low: null, + manifest: MUST_USE_ATTRIBUTE, + marginHeight: null, + marginWidth: null, + max: null, + maxLength: MUST_USE_ATTRIBUTE, + media: MUST_USE_ATTRIBUTE, + mediaGroup: null, + method: null, + min: null, + minLength: MUST_USE_ATTRIBUTE, + multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + name: null, + nonce: MUST_USE_ATTRIBUTE, + noValidate: HAS_BOOLEAN_VALUE, + open: HAS_BOOLEAN_VALUE, + optimum: null, + pattern: null, + placeholder: null, + poster: null, + preload: null, + radioGroup: null, + readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + rel: null, + required: HAS_BOOLEAN_VALUE, + reversed: HAS_BOOLEAN_VALUE, + role: MUST_USE_ATTRIBUTE, + rows: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE, + rowSpan: null, + sandbox: null, + scope: null, + scoped: HAS_BOOLEAN_VALUE, + scrolling: null, + seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, + selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + shape: null, + size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE, + sizes: MUST_USE_ATTRIBUTE, + span: HAS_POSITIVE_NUMERIC_VALUE, + spellCheck: null, + src: null, + srcDoc: MUST_USE_PROPERTY, + srcLang: null, + srcSet: MUST_USE_ATTRIBUTE, + start: HAS_NUMERIC_VALUE, + step: null, + style: null, + summary: null, + tabIndex: null, + target: null, + title: null, + type: null, + useMap: null, + value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS, + width: MUST_USE_ATTRIBUTE, + wmode: MUST_USE_ATTRIBUTE, + wrap: null, + + /** + * RDFa Properties + */ + about: MUST_USE_ATTRIBUTE, + datatype: MUST_USE_ATTRIBUTE, + inlist: MUST_USE_ATTRIBUTE, + prefix: MUST_USE_ATTRIBUTE, + // property is also supported for OpenGraph in meta tags. + property: MUST_USE_ATTRIBUTE, + resource: MUST_USE_ATTRIBUTE, + 'typeof': MUST_USE_ATTRIBUTE, + vocab: MUST_USE_ATTRIBUTE, + + /** + * Non-standard Properties + */ + // autoCapitalize and autoCorrect are supported in Mobile Safari for + // keyboard hints. + autoCapitalize: MUST_USE_ATTRIBUTE, + autoCorrect: MUST_USE_ATTRIBUTE, + // autoSave allows WebKit/Blink to persist values of input fields on page reloads + autoSave: null, + // color is for Safari mask-icon link + color: null, + // itemProp, itemScope, itemType are for + // Microdata support. See http://schema.org/docs/gs.html + itemProp: MUST_USE_ATTRIBUTE, + itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, + itemType: MUST_USE_ATTRIBUTE, + // itemID and itemRef are for Microdata support as well but + // only specified in the the WHATWG spec document. See + // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api + itemID: MUST_USE_ATTRIBUTE, + itemRef: MUST_USE_ATTRIBUTE, + // results show looking glass icon and recent searches on input + // search fields in WebKit/Blink + results: null, + // IE-only attribute that specifies security restrictions on an iframe + // as an alternative to the sandbox attribute on IE<10 + security: MUST_USE_ATTRIBUTE, + // IE-only attribute that controls focus behavior + unselectable: MUST_USE_ATTRIBUTE + }, + DOMAttributeNames: { + acceptCharset: 'accept-charset', + className: 'class', + htmlFor: 'for', + httpEquiv: 'http-equiv' + }, + DOMPropertyNames: { + autoComplete: 'autocomplete', + autoFocus: 'autofocus', + autoPlay: 'autoplay', + autoSave: 'autosave', + // `encoding` is equivalent to `enctype`, IE8 lacks an `enctype` setter. + // http://www.w3.org/TR/html5/forms.html#dom-fs-encoding + encType: 'encoding', + hrefLang: 'hreflang', + radioGroup: 'radiogroup', + spellCheck: 'spellcheck', + srcDoc: 'srcdoc', + srcSet: 'srcset' + } + }; + + module.exports = HTMLDOMPropertyConfig; + +/***/ }, +/* 279 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactBrowserComponentMixin + */ + + 'use strict'; + + var ReactInstanceMap = __webpack_require__(236); + + var findDOMNode = __webpack_require__(280); + var warning = __webpack_require__(214); + + var didWarnKey = '_getDOMNodeDidWarn'; + + var ReactBrowserComponentMixin = { + /** + * Returns the DOM node rendered by this component. + * + * @return {DOMElement} The root node of this component. + * @final + * @protected + */ + getDOMNode: function () { + process.env.NODE_ENV !== 'production' ? warning(this.constructor[didWarnKey], '%s.getDOMNode(...) is deprecated. Please use ' + 'ReactDOM.findDOMNode(instance) instead.', ReactInstanceMap.get(this).getName() || this.tagName || 'Unknown') : undefined; + this.constructor[didWarnKey] = true; + return findDOMNode(this); + } + }; + + module.exports = ReactBrowserComponentMixin; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 280 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule findDOMNode + * @typechecks static-only + */ + + 'use strict'; + + var ReactCurrentOwner = __webpack_require__(194); + var ReactInstanceMap = __webpack_require__(236); + var ReactMount = __webpack_require__(217); + + var invariant = __webpack_require__(202); + var warning = __webpack_require__(214); + + /** + * Returns the DOM node rendered by this element. + * + * @param {ReactComponent|DOMElement} componentOrElement + * @return {?DOMElement} The root node of this element. + */ + function findDOMNode(componentOrElement) { + if (process.env.NODE_ENV !== 'production') { + var owner = ReactCurrentOwner.current; + if (owner !== null) { + process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing getDOMNode or findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : undefined; + owner._warnedAboutRefsInRender = true; + } + } + if (componentOrElement == null) { + return null; + } + if (componentOrElement.nodeType === 1) { + return componentOrElement; + } + if (ReactInstanceMap.has(componentOrElement)) { + return ReactMount.getNodeFromInstance(componentOrElement); + } + !(componentOrElement.render == null || typeof componentOrElement.render !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : undefined; + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : undefined; + } + + module.exports = findDOMNode; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 281 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDefaultBatchingStrategy + */ + + 'use strict'; + + var ReactUpdates = __webpack_require__(243); + var Transaction = __webpack_require__(246); + + var assign = __webpack_require__(228); + var emptyFunction = __webpack_require__(204); + + var RESET_BATCHED_UPDATES = { + initialize: emptyFunction, + close: function () { + ReactDefaultBatchingStrategy.isBatchingUpdates = false; + } + }; + + var FLUSH_BATCHED_UPDATES = { + initialize: emptyFunction, + close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates) + }; + + var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES]; + + function ReactDefaultBatchingStrategyTransaction() { + this.reinitializeTransaction(); + } + + assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, { + getTransactionWrappers: function () { + return TRANSACTION_WRAPPERS; + } + }); + + var transaction = new ReactDefaultBatchingStrategyTransaction(); + + var ReactDefaultBatchingStrategy = { + isBatchingUpdates: false, + + /** + * Call the provided function in a context within which calls to `setState` + * and friends are batched such that components aren't updated unnecessarily. + */ + batchedUpdates: function (callback, a, b, c, d, e) { + var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates; + + ReactDefaultBatchingStrategy.isBatchingUpdates = true; + + // The code is written this way to avoid extra allocations + if (alreadyBatchingUpdates) { + callback(a, b, c, d, e); + } else { + transaction.perform(callback, null, a, b, c, d, e); + } + } + }; + + module.exports = ReactDefaultBatchingStrategy; + +/***/ }, +/* 282 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMComponent + * @typechecks static-only + */ + + /* global hasOwnProperty:true */ + + 'use strict'; + + var AutoFocusUtils = __webpack_require__(283); + var CSSPropertyOperations = __webpack_require__(285); + var DOMProperty = __webpack_require__(212); + var DOMPropertyOperations = __webpack_require__(211); + var EventConstants = __webpack_require__(219); + var ReactBrowserEventEmitter = __webpack_require__(218); + var ReactComponentBrowserEnvironment = __webpack_require__(215); + var ReactDOMButton = __webpack_require__(293); + var ReactDOMInput = __webpack_require__(294); + var ReactDOMOption = __webpack_require__(298); + var ReactDOMSelect = __webpack_require__(301); + var ReactDOMTextarea = __webpack_require__(302); + var ReactMount = __webpack_require__(217); + var ReactMultiChild = __webpack_require__(303); + var ReactPerf = __webpack_require__(207); + var ReactUpdateQueue = __webpack_require__(242); + + var assign = __webpack_require__(228); + var canDefineProperty = __webpack_require__(232); + var escapeTextContentForBrowser = __webpack_require__(210); + var invariant = __webpack_require__(202); + var isEventSupported = __webpack_require__(229); + var keyOf = __webpack_require__(268); + var setInnerHTML = __webpack_require__(208); + var setTextContent = __webpack_require__(209); + var shallowEqual = __webpack_require__(306); + var validateDOMNesting = __webpack_require__(259); + var warning = __webpack_require__(214); + + var deleteListener = ReactBrowserEventEmitter.deleteListener; + var listenTo = ReactBrowserEventEmitter.listenTo; + var registrationNameModules = ReactBrowserEventEmitter.registrationNameModules; + + // For quickly matching children type, to test if can be treated as content. + var CONTENT_TYPES = { 'string': true, 'number': true }; + + var CHILDREN = keyOf({ children: null }); + var STYLE = keyOf({ style: null }); + var HTML = keyOf({ __html: null }); + + var ELEMENT_NODE_TYPE = 1; + + function getDeclarationErrorAddendum(internalInstance) { + if (internalInstance) { + var owner = internalInstance._currentElement._owner || null; + if (owner) { + var name = owner.getName(); + if (name) { + return ' This DOM node was rendered by `' + name + '`.'; + } + } + } + return ''; + } + + var legacyPropsDescriptor; + if (process.env.NODE_ENV !== 'production') { + legacyPropsDescriptor = { + props: { + enumerable: false, + get: function () { + var component = this._reactInternalComponent; + process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .props of a DOM node; instead, ' + 'recreate the props as `render` did originally or read the DOM ' + 'properties/attributes directly from this node (e.g., ' + 'this.refs.box.className).%s', getDeclarationErrorAddendum(component)) : undefined; + return component._currentElement.props; + } + } + }; + } + + function legacyGetDOMNode() { + if (process.env.NODE_ENV !== 'production') { + var component = this._reactInternalComponent; + process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .getDOMNode() of a DOM node; ' + 'instead, use the node directly.%s', getDeclarationErrorAddendum(component)) : undefined; + } + return this; + } + + function legacyIsMounted() { + var component = this._reactInternalComponent; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .isMounted() of a DOM node.%s', getDeclarationErrorAddendum(component)) : undefined; + } + return !!component; + } + + function legacySetStateEtc() { + if (process.env.NODE_ENV !== 'production') { + var component = this._reactInternalComponent; + process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setState(), .replaceState(), or ' + '.forceUpdate() of a DOM node. This is a no-op.%s', getDeclarationErrorAddendum(component)) : undefined; + } + } + + function legacySetProps(partialProps, callback) { + var component = this._reactInternalComponent; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined; + } + if (!component) { + return; + } + ReactUpdateQueue.enqueueSetPropsInternal(component, partialProps); + if (callback) { + ReactUpdateQueue.enqueueCallbackInternal(component, callback); + } + } + + function legacyReplaceProps(partialProps, callback) { + var component = this._reactInternalComponent; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .replaceProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined; + } + if (!component) { + return; + } + ReactUpdateQueue.enqueueReplacePropsInternal(component, partialProps); + if (callback) { + ReactUpdateQueue.enqueueCallbackInternal(component, callback); + } + } + + function friendlyStringify(obj) { + if (typeof obj === 'object') { + if (Array.isArray(obj)) { + return '[' + obj.map(friendlyStringify).join(', ') + ']'; + } else { + var pairs = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key); + pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key])); + } + } + return '{' + pairs.join(', ') + '}'; + } + } else if (typeof obj === 'string') { + return JSON.stringify(obj); + } else if (typeof obj === 'function') { + return '[function object]'; + } + // Differs from JSON.stringify in that undefined becauses undefined and that + // inf and nan don't become null + return String(obj); + } + + var styleMutationWarning = {}; + + function checkAndWarnForMutatedStyle(style1, style2, component) { + if (style1 == null || style2 == null) { + return; + } + if (shallowEqual(style1, style2)) { + return; + } + + var componentName = component._tag; + var owner = component._currentElement._owner; + var ownerName; + if (owner) { + ownerName = owner.getName(); + } + + var hash = ownerName + '|' + componentName; + + if (styleMutationWarning.hasOwnProperty(hash)) { + return; + } + + styleMutationWarning[hash] = true; + + process.env.NODE_ENV !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : undefined; + } + + /** + * @param {object} component + * @param {?object} props + */ + function assertValidProps(component, props) { + if (!props) { + return; + } + // Note the use of `==` which checks for null or undefined. + if (process.env.NODE_ENV !== 'production') { + if (voidElementTags[component._tag]) { + process.env.NODE_ENV !== 'production' ? warning(props.children == null && props.dangerouslySetInnerHTML == null, '%s is a void element tag and must not have `children` or ' + 'use `props.dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : undefined; + } + } + if (props.dangerouslySetInnerHTML != null) { + !(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : undefined; + !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://fb.me/react-invariant-dangerously-set-inner-html ' + 'for more information.') : invariant(false) : undefined; + } + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : undefined; + process.env.NODE_ENV !== 'production' ? warning(!props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : undefined; + } + !(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : undefined; + } + + function enqueuePutListener(id, registrationName, listener, transaction) { + if (process.env.NODE_ENV !== 'production') { + // IE8 has no API for event capturing and the `onScroll` event doesn't + // bubble. + process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : undefined; + } + var container = ReactMount.findReactContainerForID(id); + if (container) { + var doc = container.nodeType === ELEMENT_NODE_TYPE ? container.ownerDocument : container; + listenTo(registrationName, doc); + } + transaction.getReactMountReady().enqueue(putListener, { + id: id, + registrationName: registrationName, + listener: listener + }); + } + + function putListener() { + var listenerToPut = this; + ReactBrowserEventEmitter.putListener(listenerToPut.id, listenerToPut.registrationName, listenerToPut.listener); + } + + // There are so many media events, it makes sense to just + // maintain a list rather than create a `trapBubbledEvent` for each + var mediaEvents = { + 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' + }; + + function trapBubbledEventsLocal() { + var inst = this; + // If a component renders to null or if another component fatals and causes + // the state of the tree to be corrupted, `node` here can be null. + !inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : undefined; + var node = ReactMount.getNode(inst._rootNodeID); + !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : undefined; + + switch (inst._tag) { + case 'iframe': + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)]; + break; + case 'video': + case 'audio': + + inst._wrapperState.listeners = []; + // create listener for each media event + for (var event in mediaEvents) { + if (mediaEvents.hasOwnProperty(event)) { + inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node)); + } + } + + break; + case 'img': + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)]; + break; + case 'form': + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)]; + break; + } + } + + function mountReadyInputWrapper() { + ReactDOMInput.mountReadyWrapper(this); + } + + function postUpdateSelectWrapper() { + ReactDOMSelect.postUpdateWrapper(this); + } + + // For HTML, certain tags should omit their close tag. We keep a whitelist for + // those special cased tags. + + var omittedCloseTags = { + 'area': true, + 'base': true, + 'br': true, + 'col': true, + 'embed': true, + 'hr': true, + 'img': true, + 'input': true, + 'keygen': true, + 'link': true, + 'meta': true, + 'param': true, + 'source': true, + 'track': true, + 'wbr': true + }; + + // NOTE: menuitem's close tag should be omitted, but that causes problems. + var newlineEatingTags = { + 'listing': true, + 'pre': true, + 'textarea': true + }; + + // For HTML, certain tags cannot have children. This has the same purpose as + // `omittedCloseTags` except that `menuitem` should still have its closing tag. + + var voidElementTags = assign({ + 'menuitem': true + }, omittedCloseTags); + + // We accept any tag to be rendered but since this gets injected into arbitrary + // HTML, we want to make sure that it's a safe tag. + // http://www.w3.org/TR/REC-xml/#NT-Name + + var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset + var validatedTagCache = {}; + var hasOwnProperty = ({}).hasOwnProperty; + + function validateDangerousTag(tag) { + if (!hasOwnProperty.call(validatedTagCache, tag)) { + !VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : undefined; + validatedTagCache[tag] = true; + } + } + + function processChildContextDev(context, inst) { + // Pass down our tag name to child components for validation purposes + context = assign({}, context); + var info = context[validateDOMNesting.ancestorInfoContextKey]; + context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(info, inst._tag, inst); + return context; + } + + function isCustomComponent(tagName, props) { + return tagName.indexOf('-') >= 0 || props.is != null; + } + + /** + * Creates a new React class that is idempotent and capable of containing other + * React components. It accepts event listeners and DOM properties that are + * valid according to `DOMProperty`. + * + * - Event listeners: `onClick`, `onMouseDown`, etc. + * - DOM properties: `className`, `name`, `title`, etc. + * + * The `style` property functions differently from the DOM API. It accepts an + * object mapping of style properties to values. + * + * @constructor ReactDOMComponent + * @extends ReactMultiChild + */ + function ReactDOMComponent(tag) { + validateDangerousTag(tag); + this._tag = tag.toLowerCase(); + this._renderedChildren = null; + this._previousStyle = null; + this._previousStyleCopy = null; + this._rootNodeID = null; + this._wrapperState = null; + this._topLevelWrapper = null; + this._nodeWithLegacyProperties = null; + if (process.env.NODE_ENV !== 'production') { + this._unprocessedContextDev = null; + this._processedContextDev = null; + } + } + + ReactDOMComponent.displayName = 'ReactDOMComponent'; + + ReactDOMComponent.Mixin = { + + construct: function (element) { + this._currentElement = element; + }, + + /** + * Generates root tag markup then recurses. This method has side effects and + * is not idempotent. + * + * @internal + * @param {string} rootID The root DOM ID for this node. + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {object} context + * @return {string} The computed markup. + */ + mountComponent: function (rootID, transaction, context) { + this._rootNodeID = rootID; + + var props = this._currentElement.props; + + switch (this._tag) { + case 'iframe': + case 'img': + case 'form': + case 'video': + case 'audio': + this._wrapperState = { + listeners: null + }; + transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); + break; + case 'button': + props = ReactDOMButton.getNativeProps(this, props, context); + break; + case 'input': + ReactDOMInput.mountWrapper(this, props, context); + props = ReactDOMInput.getNativeProps(this, props, context); + break; + case 'option': + ReactDOMOption.mountWrapper(this, props, context); + props = ReactDOMOption.getNativeProps(this, props, context); + break; + case 'select': + ReactDOMSelect.mountWrapper(this, props, context); + props = ReactDOMSelect.getNativeProps(this, props, context); + context = ReactDOMSelect.processChildContext(this, props, context); + break; + case 'textarea': + ReactDOMTextarea.mountWrapper(this, props, context); + props = ReactDOMTextarea.getNativeProps(this, props, context); + break; + } + + assertValidProps(this, props); + if (process.env.NODE_ENV !== 'production') { + if (context[validateDOMNesting.ancestorInfoContextKey]) { + validateDOMNesting(this._tag, this, context[validateDOMNesting.ancestorInfoContextKey]); + } + } + + if (process.env.NODE_ENV !== 'production') { + this._unprocessedContextDev = context; + this._processedContextDev = processChildContextDev(context, this); + context = this._processedContextDev; + } + + var mountImage; + if (transaction.useCreateElement) { + var ownerDocument = context[ReactMount.ownerDocumentContextKey]; + var el = ownerDocument.createElement(this._currentElement.type); + DOMPropertyOperations.setAttributeForID(el, this._rootNodeID); + // Populate node cache + ReactMount.getID(el); + this._updateDOMProperties({}, props, transaction, el); + this._createInitialChildren(transaction, props, context, el); + mountImage = el; + } else { + var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props); + var tagContent = this._createContentMarkup(transaction, props, context); + if (!tagContent && omittedCloseTags[this._tag]) { + mountImage = tagOpen + '/>'; + } else { + mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>'; + } + } + + switch (this._tag) { + case 'input': + transaction.getReactMountReady().enqueue(mountReadyInputWrapper, this); + // falls through + case 'button': + case 'select': + case 'textarea': + if (props.autoFocus) { + transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this); + } + break; + } + + return mountImage; + }, + + /** + * Creates markup for the open tag and all attributes. + * + * This method has side effects because events get registered. + * + * Iterating over object properties is faster than iterating over arrays. + * @see http://jsperf.com/obj-vs-arr-iteration + * + * @private + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {object} props + * @return {string} Markup of opening tag. + */ + _createOpenTagMarkupAndPutListeners: function (transaction, props) { + var ret = '<' + this._currentElement.type; + + for (var propKey in props) { + if (!props.hasOwnProperty(propKey)) { + continue; + } + var propValue = props[propKey]; + if (propValue == null) { + continue; + } + if (registrationNameModules.hasOwnProperty(propKey)) { + if (propValue) { + enqueuePutListener(this._rootNodeID, propKey, propValue, transaction); + } + } else { + if (propKey === STYLE) { + if (propValue) { + if (process.env.NODE_ENV !== 'production') { + // See `_updateDOMProperties`. style block + this._previousStyle = propValue; + } + propValue = this._previousStyleCopy = assign({}, props.style); + } + propValue = CSSPropertyOperations.createMarkupForStyles(propValue); + } + var markup = null; + if (this._tag != null && isCustomComponent(this._tag, props)) { + if (propKey !== CHILDREN) { + markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue); + } + } else { + markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue); + } + if (markup) { + ret += ' ' + markup; + } + } + } + + // For static pages, no need to put React ID and checksum. Saves lots of + // bytes. + if (transaction.renderToStaticMarkup) { + return ret; + } + + var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID); + return ret + ' ' + markupForID; + }, + + /** + * Creates markup for the content between the tags. + * + * @private + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {object} props + * @param {object} context + * @return {string} Content markup. + */ + _createContentMarkup: function (transaction, props, context) { + var ret = ''; + + // Intentional use of != to avoid catching zero/false. + var innerHTML = props.dangerouslySetInnerHTML; + if (innerHTML != null) { + if (innerHTML.__html != null) { + ret = innerHTML.__html; + } + } else { + var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null; + var childrenToUse = contentToUse != null ? null : props.children; + if (contentToUse != null) { + // TODO: Validate that text is allowed as a child of this node + ret = escapeTextContentForBrowser(contentToUse); + } else if (childrenToUse != null) { + var mountImages = this.mountChildren(childrenToUse, transaction, context); + ret = mountImages.join(''); + } + } + if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') { + // text/html ignores the first character in these tags if it's a newline + // Prefer to break application/xml over text/html (for now) by adding + // a newline specifically to get eaten by the parser. (Alternately for + // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first + // \r is normalized out by HTMLTextAreaElement#value.) + // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre> + // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions> + // See: <http://www.w3.org/TR/html5/syntax.html#newlines> + // See: Parsing of "textarea" "listing" and "pre" elements + // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody> + return '\n' + ret; + } else { + return ret; + } + }, + + _createInitialChildren: function (transaction, props, context, el) { + // Intentional use of != to avoid catching zero/false. + var innerHTML = props.dangerouslySetInnerHTML; + if (innerHTML != null) { + if (innerHTML.__html != null) { + setInnerHTML(el, innerHTML.__html); + } + } else { + var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null; + var childrenToUse = contentToUse != null ? null : props.children; + if (contentToUse != null) { + // TODO: Validate that text is allowed as a child of this node + setTextContent(el, contentToUse); + } else if (childrenToUse != null) { + var mountImages = this.mountChildren(childrenToUse, transaction, context); + for (var i = 0; i < mountImages.length; i++) { + el.appendChild(mountImages[i]); + } + } + } + }, + + /** + * Receives a next element and updates the component. + * + * @internal + * @param {ReactElement} nextElement + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {object} context + */ + receiveComponent: function (nextElement, transaction, context) { + var prevElement = this._currentElement; + this._currentElement = nextElement; + this.updateComponent(transaction, prevElement, nextElement, context); + }, + + /** + * Updates a native DOM component after it has already been allocated and + * attached to the DOM. Reconciles the root DOM node, then recurses. + * + * @param {ReactReconcileTransaction} transaction + * @param {ReactElement} prevElement + * @param {ReactElement} nextElement + * @internal + * @overridable + */ + updateComponent: function (transaction, prevElement, nextElement, context) { + var lastProps = prevElement.props; + var nextProps = this._currentElement.props; + + switch (this._tag) { + case 'button': + lastProps = ReactDOMButton.getNativeProps(this, lastProps); + nextProps = ReactDOMButton.getNativeProps(this, nextProps); + break; + case 'input': + ReactDOMInput.updateWrapper(this); + lastProps = ReactDOMInput.getNativeProps(this, lastProps); + nextProps = ReactDOMInput.getNativeProps(this, nextProps); + break; + case 'option': + lastProps = ReactDOMOption.getNativeProps(this, lastProps); + nextProps = ReactDOMOption.getNativeProps(this, nextProps); + break; + case 'select': + lastProps = ReactDOMSelect.getNativeProps(this, lastProps); + nextProps = ReactDOMSelect.getNativeProps(this, nextProps); + break; + case 'textarea': + ReactDOMTextarea.updateWrapper(this); + lastProps = ReactDOMTextarea.getNativeProps(this, lastProps); + nextProps = ReactDOMTextarea.getNativeProps(this, nextProps); + break; + } + + if (process.env.NODE_ENV !== 'production') { + // If the context is reference-equal to the old one, pass down the same + // processed object so the update bailout in ReactReconciler behaves + // correctly (and identically in dev and prod). See #5005. + if (this._unprocessedContextDev !== context) { + this._unprocessedContextDev = context; + this._processedContextDev = processChildContextDev(context, this); + } + context = this._processedContextDev; + } + + assertValidProps(this, nextProps); + this._updateDOMProperties(lastProps, nextProps, transaction, null); + this._updateDOMChildren(lastProps, nextProps, transaction, context); + + if (!canDefineProperty && this._nodeWithLegacyProperties) { + this._nodeWithLegacyProperties.props = nextProps; + } + + if (this._tag === 'select') { + // <select> value update needs to occur after <option> children + // reconciliation + transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this); + } + }, + + /** + * Reconciles the properties by detecting differences in property values and + * updating the DOM as necessary. This function is probably the single most + * critical path for performance optimization. + * + * TODO: Benchmark whether checking for changed values in memory actually + * improves performance (especially statically positioned elements). + * TODO: Benchmark the effects of putting this at the top since 99% of props + * do not change for a given reconciliation. + * TODO: Benchmark areas that can be improved with caching. + * + * @private + * @param {object} lastProps + * @param {object} nextProps + * @param {ReactReconcileTransaction} transaction + * @param {?DOMElement} node + */ + _updateDOMProperties: function (lastProps, nextProps, transaction, node) { + var propKey; + var styleName; + var styleUpdates; + for (propKey in lastProps) { + if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey)) { + continue; + } + if (propKey === STYLE) { + var lastStyle = this._previousStyleCopy; + for (styleName in lastStyle) { + if (lastStyle.hasOwnProperty(styleName)) { + styleUpdates = styleUpdates || {}; + styleUpdates[styleName] = ''; + } + } + this._previousStyleCopy = null; + } else if (registrationNameModules.hasOwnProperty(propKey)) { + if (lastProps[propKey]) { + // Only call deleteListener if there was a listener previously or + // else willDeleteListener gets called when there wasn't actually a + // listener (e.g., onClick={null}) + deleteListener(this._rootNodeID, propKey); + } + } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) { + if (!node) { + node = ReactMount.getNode(this._rootNodeID); + } + DOMPropertyOperations.deleteValueForProperty(node, propKey); + } + } + for (propKey in nextProps) { + var nextProp = nextProps[propKey]; + var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps[propKey]; + if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) { + continue; + } + if (propKey === STYLE) { + if (nextProp) { + if (process.env.NODE_ENV !== 'production') { + checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this); + this._previousStyle = nextProp; + } + nextProp = this._previousStyleCopy = assign({}, nextProp); + } else { + this._previousStyleCopy = null; + } + if (lastProp) { + // Unset styles on `lastProp` but not on `nextProp`. + for (styleName in lastProp) { + if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) { + styleUpdates = styleUpdates || {}; + styleUpdates[styleName] = ''; + } + } + // Update styles that changed since `lastProp`. + for (styleName in nextProp) { + if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) { + styleUpdates = styleUpdates || {}; + styleUpdates[styleName] = nextProp[styleName]; + } + } + } else { + // Relies on `updateStylesByID` not mutating `styleUpdates`. + styleUpdates = nextProp; + } + } else if (registrationNameModules.hasOwnProperty(propKey)) { + if (nextProp) { + enqueuePutListener(this._rootNodeID, propKey, nextProp, transaction); + } else if (lastProp) { + deleteListener(this._rootNodeID, propKey); + } + } else if (isCustomComponent(this._tag, nextProps)) { + if (!node) { + node = ReactMount.getNode(this._rootNodeID); + } + if (propKey === CHILDREN) { + nextProp = null; + } + DOMPropertyOperations.setValueForAttribute(node, propKey, nextProp); + } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) { + if (!node) { + node = ReactMount.getNode(this._rootNodeID); + } + // If we're updating to null or undefined, we should remove the property + // from the DOM node instead of inadvertantly setting to a string. This + // brings us in line with the same behavior we have on initial render. + if (nextProp != null) { + DOMPropertyOperations.setValueForProperty(node, propKey, nextProp); + } else { + DOMPropertyOperations.deleteValueForProperty(node, propKey); + } + } + } + if (styleUpdates) { + if (!node) { + node = ReactMount.getNode(this._rootNodeID); + } + CSSPropertyOperations.setValueForStyles(node, styleUpdates); + } + }, + + /** + * Reconciles the children with the various properties that affect the + * children content. + * + * @param {object} lastProps + * @param {object} nextProps + * @param {ReactReconcileTransaction} transaction + * @param {object} context + */ + _updateDOMChildren: function (lastProps, nextProps, transaction, context) { + var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null; + var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null; + + var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html; + var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html; + + // Note the use of `!=` which checks for null or undefined. + var lastChildren = lastContent != null ? null : lastProps.children; + var nextChildren = nextContent != null ? null : nextProps.children; + + // If we're switching from children to content/html or vice versa, remove + // the old content + var lastHasContentOrHtml = lastContent != null || lastHtml != null; + var nextHasContentOrHtml = nextContent != null || nextHtml != null; + if (lastChildren != null && nextChildren == null) { + this.updateChildren(null, transaction, context); + } else if (lastHasContentOrHtml && !nextHasContentOrHtml) { + this.updateTextContent(''); + } + + if (nextContent != null) { + if (lastContent !== nextContent) { + this.updateTextContent('' + nextContent); + } + } else if (nextHtml != null) { + if (lastHtml !== nextHtml) { + this.updateMarkup('' + nextHtml); + } + } else if (nextChildren != null) { + this.updateChildren(nextChildren, transaction, context); + } + }, + + /** + * Destroys all event registrations for this instance. Does not remove from + * the DOM. That must be done by the parent. + * + * @internal + */ + unmountComponent: function () { + switch (this._tag) { + case 'iframe': + case 'img': + case 'form': + case 'video': + case 'audio': + var listeners = this._wrapperState.listeners; + if (listeners) { + for (var i = 0; i < listeners.length; i++) { + listeners[i].remove(); + } + } + break; + case 'input': + ReactDOMInput.unmountWrapper(this); + break; + case 'html': + case 'head': + case 'body': + /** + * Components like <html> <head> and <body> can't be removed or added + * easily in a cross-browser way, however it's valuable to be able to + * take advantage of React's reconciliation for styling and <title> + * management. So we just document it and throw in dangerous cases. + */ + true ? process.env.NODE_ENV !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is ' + 'impossible to unmount some top-level components (eg <html>, ' + '<head>, and <body>) reliably and efficiently. To fix this, have a ' + 'single top-level component that never unmounts render these ' + 'elements.', this._tag) : invariant(false) : undefined; + break; + } + + this.unmountChildren(); + ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID); + ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID); + this._rootNodeID = null; + this._wrapperState = null; + if (this._nodeWithLegacyProperties) { + var node = this._nodeWithLegacyProperties; + node._reactInternalComponent = null; + this._nodeWithLegacyProperties = null; + } + }, + + getPublicInstance: function () { + if (!this._nodeWithLegacyProperties) { + var node = ReactMount.getNode(this._rootNodeID); + + node._reactInternalComponent = this; + node.getDOMNode = legacyGetDOMNode; + node.isMounted = legacyIsMounted; + node.setState = legacySetStateEtc; + node.replaceState = legacySetStateEtc; + node.forceUpdate = legacySetStateEtc; + node.setProps = legacySetProps; + node.replaceProps = legacyReplaceProps; + + if (process.env.NODE_ENV !== 'production') { + if (canDefineProperty) { + Object.defineProperties(node, legacyPropsDescriptor); + } else { + // updateComponent will update this property on subsequent renders + node.props = this._currentElement.props; + } + } else { + // updateComponent will update this property on subsequent renders + node.props = this._currentElement.props; + } + + this._nodeWithLegacyProperties = node; + } + return this._nodeWithLegacyProperties; + } + + }; + + ReactPerf.measureMethods(ReactDOMComponent, 'ReactDOMComponent', { + mountComponent: 'mountComponent', + updateComponent: 'updateComponent' + }); + + assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin); + + module.exports = ReactDOMComponent; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 283 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule AutoFocusUtils + * @typechecks static-only + */ + + 'use strict'; + + var ReactMount = __webpack_require__(217); + + var findDOMNode = __webpack_require__(280); + var focusNode = __webpack_require__(284); + + var Mixin = { + componentDidMount: function () { + if (this.props.autoFocus) { + focusNode(findDOMNode(this)); + } + } + }; + + var AutoFocusUtils = { + Mixin: Mixin, + + focusDOMComponent: function () { + focusNode(ReactMount.getNode(this._rootNodeID)); + } + }; + + module.exports = AutoFocusUtils; + +/***/ }, +/* 284 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule focusNode + */ + + 'use strict'; + + /** + * @param {DOMElement} node input/textarea to focus + */ + function focusNode(node) { + // IE8 can throw "Can't move focus to the control because it is invisible, + // not enabled, or of a type that does not accept the focus." for all kinds of + // reasons that are too expensive and fragile to test. + try { + node.focus(); + } catch (e) {} + } + + module.exports = focusNode; + +/***/ }, +/* 285 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule CSSPropertyOperations + * @typechecks static-only + */ + + 'use strict'; + + var CSSProperty = __webpack_require__(286); + var ExecutionEnvironment = __webpack_require__(198); + var ReactPerf = __webpack_require__(207); + + var camelizeStyleName = __webpack_require__(287); + var dangerousStyleValue = __webpack_require__(289); + var hyphenateStyleName = __webpack_require__(290); + var memoizeStringOnly = __webpack_require__(292); + var warning = __webpack_require__(214); + + var processStyleName = memoizeStringOnly(function (styleName) { + return hyphenateStyleName(styleName); + }); + + var hasShorthandPropertyBug = false; + var styleFloatAccessor = 'cssFloat'; + if (ExecutionEnvironment.canUseDOM) { + var tempStyle = document.createElement('div').style; + try { + // IE8 throws "Invalid argument." if resetting shorthand style properties. + tempStyle.font = ''; + } catch (e) { + hasShorthandPropertyBug = true; + } + // IE8 only supports accessing cssFloat (standard) as styleFloat + if (document.documentElement.style.cssFloat === undefined) { + styleFloatAccessor = 'styleFloat'; + } + } + + if (process.env.NODE_ENV !== 'production') { + // 'msTransform' is correct, but the other prefixes should be capitalized + var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; + + // style values shouldn't contain a semicolon + var badStyleValueWithSemicolonPattern = /;\s*$/; + + var warnedStyleNames = {}; + var warnedStyleValues = {}; + + var warnHyphenatedStyleName = function (name) { + if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { + return; + } + + warnedStyleNames[name] = true; + process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?', name, camelizeStyleName(name)) : undefined; + }; + + var warnBadVendoredStyleName = function (name) { + if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { + return; + } + + warnedStyleNames[name] = true; + process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)) : undefined; + }; + + var warnStyleValueWithSemicolon = function (name, value) { + if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { + return; + } + + warnedStyleValues[value] = true; + process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon. ' + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')) : undefined; + }; + + /** + * @param {string} name + * @param {*} value + */ + var warnValidStyle = function (name, value) { + if (name.indexOf('-') > -1) { + warnHyphenatedStyleName(name); + } else if (badVendoredStyleNamePattern.test(name)) { + warnBadVendoredStyleName(name); + } else if (badStyleValueWithSemicolonPattern.test(value)) { + warnStyleValueWithSemicolon(name, value); + } + }; + } + + /** + * Operations for dealing with CSS properties. + */ + var CSSPropertyOperations = { + + /** + * Serializes a mapping of style properties for use as inline styles: + * + * > createMarkupForStyles({width: '200px', height: 0}) + * "width:200px;height:0;" + * + * Undefined values are ignored so that declarative programming is easier. + * The result should be HTML-escaped before insertion into the DOM. + * + * @param {object} styles + * @return {?string} + */ + createMarkupForStyles: function (styles) { + var serialized = ''; + for (var styleName in styles) { + if (!styles.hasOwnProperty(styleName)) { + continue; + } + var styleValue = styles[styleName]; + if (process.env.NODE_ENV !== 'production') { + warnValidStyle(styleName, styleValue); + } + if (styleValue != null) { + serialized += processStyleName(styleName) + ':'; + serialized += dangerousStyleValue(styleName, styleValue) + ';'; + } + } + return serialized || null; + }, + + /** + * Sets the value for multiple styles on a node. If a value is specified as + * '' (empty string), the corresponding style property will be unset. + * + * @param {DOMElement} node + * @param {object} styles + */ + setValueForStyles: function (node, styles) { + var style = node.style; + for (var styleName in styles) { + if (!styles.hasOwnProperty(styleName)) { + continue; + } + if (process.env.NODE_ENV !== 'production') { + warnValidStyle(styleName, styles[styleName]); + } + var styleValue = dangerousStyleValue(styleName, styles[styleName]); + if (styleName === 'float') { + styleName = styleFloatAccessor; + } + if (styleValue) { + style[styleName] = styleValue; + } else { + var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName]; + if (expansion) { + // Shorthand property that IE8 won't like unsetting, so unset each + // component to placate it + for (var individualStyleName in expansion) { + style[individualStyleName] = ''; + } + } else { + style[styleName] = ''; + } + } + } + } + + }; + + ReactPerf.measureMethods(CSSPropertyOperations, 'CSSPropertyOperations', { + setValueForStyles: 'setValueForStyles' + }); + + module.exports = CSSPropertyOperations; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 286 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule CSSProperty + */ + + 'use strict'; + + /** + * CSS properties which accept numbers but are not in units of "px". + */ + var isUnitlessNumber = { + animationIterationCount: true, + boxFlex: true, + boxFlexGroup: true, + boxOrdinalGroup: true, + columnCount: true, + flex: true, + flexGrow: true, + flexPositive: true, + flexShrink: true, + flexNegative: true, + flexOrder: true, + fontWeight: true, + lineClamp: true, + lineHeight: true, + opacity: true, + order: true, + orphans: true, + tabSize: true, + widows: true, + zIndex: true, + zoom: true, + + // SVG-related properties + fillOpacity: true, + stopOpacity: true, + strokeDashoffset: true, + strokeOpacity: true, + strokeWidth: true + }; + + /** + * @param {string} prefix vendor-specific prefix, eg: Webkit + * @param {string} key style name, eg: transitionDuration + * @return {string} style name prefixed with `prefix`, properly camelCased, eg: + * WebkitTransitionDuration + */ + function prefixKey(prefix, key) { + return prefix + key.charAt(0).toUpperCase() + key.substring(1); + } + + /** + * Support style names that may come passed in prefixed by adding permutations + * of vendor prefixes. + */ + var prefixes = ['Webkit', 'ms', 'Moz', 'O']; + + // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an + // infinite loop, because it iterates over the newly added props too. + Object.keys(isUnitlessNumber).forEach(function (prop) { + prefixes.forEach(function (prefix) { + isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; + }); + }); + + /** + * Most style properties can be unset by doing .style[prop] = '' but IE8 + * doesn't like doing that with shorthand properties so for the properties that + * IE8 breaks on, which are listed here, we instead unset each of the + * individual properties. See http://bugs.jquery.com/ticket/12385. + * The 4-value 'clock' properties like margin, padding, border-width seem to + * behave without any problems. Curiously, list-style works too without any + * special prodding. + */ + var shorthandPropertyExpansions = { + background: { + backgroundAttachment: true, + backgroundColor: true, + backgroundImage: true, + backgroundPositionX: true, + backgroundPositionY: true, + backgroundRepeat: true + }, + backgroundPosition: { + backgroundPositionX: true, + backgroundPositionY: true + }, + border: { + borderWidth: true, + borderStyle: true, + borderColor: true + }, + borderBottom: { + borderBottomWidth: true, + borderBottomStyle: true, + borderBottomColor: true + }, + borderLeft: { + borderLeftWidth: true, + borderLeftStyle: true, + borderLeftColor: true + }, + borderRight: { + borderRightWidth: true, + borderRightStyle: true, + borderRightColor: true + }, + borderTop: { + borderTopWidth: true, + borderTopStyle: true, + borderTopColor: true + }, + font: { + fontStyle: true, + fontVariant: true, + fontWeight: true, + fontSize: true, + lineHeight: true, + fontFamily: true + }, + outline: { + outlineWidth: true, + outlineStyle: true, + outlineColor: true + } + }; + + var CSSProperty = { + isUnitlessNumber: isUnitlessNumber, + shorthandPropertyExpansions: shorthandPropertyExpansions + }; + + module.exports = CSSProperty; + +/***/ }, +/* 287 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule camelizeStyleName + * @typechecks + */ + + 'use strict'; + + var camelize = __webpack_require__(288); + + var msPattern = /^-ms-/; + + /** + * Camelcases a hyphenated CSS property name, for example: + * + * > camelizeStyleName('background-color') + * < "backgroundColor" + * > camelizeStyleName('-moz-transition') + * < "MozTransition" + * > camelizeStyleName('-ms-transition') + * < "msTransition" + * + * As Andi Smith suggests + * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix + * is converted to lowercase `ms`. + * + * @param {string} string + * @return {string} + */ + function camelizeStyleName(string) { + return camelize(string.replace(msPattern, 'ms-')); + } + + module.exports = camelizeStyleName; + +/***/ }, +/* 288 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule camelize + * @typechecks + */ + + "use strict"; + + var _hyphenPattern = /-(.)/g; + + /** + * Camelcases a hyphenated string, for example: + * + * > camelize('background-color') + * < "backgroundColor" + * + * @param {string} string + * @return {string} + */ + function camelize(string) { + return string.replace(_hyphenPattern, function (_, character) { + return character.toUpperCase(); + }); + } + + module.exports = camelize; + +/***/ }, +/* 289 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule dangerousStyleValue + * @typechecks static-only + */ + + 'use strict'; + + var CSSProperty = __webpack_require__(286); + + var isUnitlessNumber = CSSProperty.isUnitlessNumber; + + /** + * Convert a value into the proper css writable value. The style name `name` + * should be logical (no hyphens), as specified + * in `CSSProperty.isUnitlessNumber`. + * + * @param {string} name CSS property name such as `topMargin`. + * @param {*} value CSS property value such as `10px`. + * @return {string} Normalized style value with dimensions applied. + */ + function dangerousStyleValue(name, value) { + // Note that we've removed escapeTextForBrowser() calls here since the + // whole string will be escaped when the attribute is injected into + // the markup. If you provide unsafe user data here they can inject + // arbitrary CSS which may be problematic (I couldn't repro this): + // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet + // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/ + // This is not an XSS hole but instead a potential CSS injection issue + // which has lead to a greater discussion about how we're going to + // trust URLs moving forward. See #2115901 + + var isEmpty = value == null || typeof value === 'boolean' || value === ''; + if (isEmpty) { + return ''; + } + + var isNonNumeric = isNaN(value); + if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) { + return '' + value; // cast to string + } + + if (typeof value === 'string') { + value = value.trim(); + } + return value + 'px'; + } + + module.exports = dangerousStyleValue; + +/***/ }, +/* 290 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule hyphenateStyleName + * @typechecks + */ + + 'use strict'; + + var hyphenate = __webpack_require__(291); + + var msPattern = /^ms-/; + + /** + * Hyphenates a camelcased CSS property name, for example: + * + * > hyphenateStyleName('backgroundColor') + * < "background-color" + * > hyphenateStyleName('MozTransition') + * < "-moz-transition" + * > hyphenateStyleName('msTransition') + * < "-ms-transition" + * + * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix + * is converted to `-ms-`. + * + * @param {string} string + * @return {string} + */ + function hyphenateStyleName(string) { + return hyphenate(string).replace(msPattern, '-ms-'); + } + + module.exports = hyphenateStyleName; + +/***/ }, +/* 291 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule hyphenate + * @typechecks + */ + + 'use strict'; + + var _uppercasePattern = /([A-Z])/g; + + /** + * Hyphenates a camelcased string, for example: + * + * > hyphenate('backgroundColor') + * < "background-color" + * + * For CSS style names, use `hyphenateStyleName` instead which works properly + * with all vendor prefixes, including `ms`. + * + * @param {string} string + * @return {string} + */ + function hyphenate(string) { + return string.replace(_uppercasePattern, '-$1').toLowerCase(); + } + + module.exports = hyphenate; + +/***/ }, +/* 292 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule memoizeStringOnly + * @typechecks static-only + */ + + 'use strict'; + + /** + * Memoizes the return value of a function that accepts one string argument. + * + * @param {function} callback + * @return {function} + */ + function memoizeStringOnly(callback) { + var cache = {}; + return function (string) { + if (!cache.hasOwnProperty(string)) { + cache[string] = callback.call(this, string); + } + return cache[string]; + }; + } + + module.exports = memoizeStringOnly; + +/***/ }, +/* 293 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMButton + */ + + 'use strict'; + + var mouseListenerNames = { + onClick: true, + onDoubleClick: true, + onMouseDown: true, + onMouseMove: true, + onMouseUp: true, + + onClickCapture: true, + onDoubleClickCapture: true, + onMouseDownCapture: true, + onMouseMoveCapture: true, + onMouseUpCapture: true + }; + + /** + * Implements a <button> native component that does not receive mouse events + * when `disabled` is set. + */ + var ReactDOMButton = { + getNativeProps: function (inst, props, context) { + if (!props.disabled) { + return props; + } + + // Copy the props, except the mouse listeners + var nativeProps = {}; + for (var key in props) { + if (props.hasOwnProperty(key) && !mouseListenerNames[key]) { + nativeProps[key] = props[key]; + } + } + + return nativeProps; + } + }; + + module.exports = ReactDOMButton; + +/***/ }, +/* 294 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMInput + */ + + 'use strict'; + + var ReactDOMIDOperations = __webpack_require__(216); + var LinkedValueUtils = __webpack_require__(295); + var ReactMount = __webpack_require__(217); + var ReactUpdates = __webpack_require__(243); + + var assign = __webpack_require__(228); + var invariant = __webpack_require__(202); + + var instancesByReactID = {}; + + function forceUpdateIfMounted() { + if (this._rootNodeID) { + // DOM component is still mounted; update + ReactDOMInput.updateWrapper(this); + } + } + + /** + * Implements an <input> native component that allows setting these optional + * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. + * + * If `checked` or `value` are not supplied (or null/undefined), user actions + * that affect the checked state or value will trigger updates to the element. + * + * If they are supplied (and not null/undefined), the rendered element will not + * trigger updates to the element. Instead, the props must change in order for + * the rendered element to be updated. + * + * The rendered element will be initialized as unchecked (or `defaultChecked`) + * with an empty value (or `defaultValue`). + * + * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html + */ + var ReactDOMInput = { + getNativeProps: function (inst, props, context) { + var value = LinkedValueUtils.getValue(props); + var checked = LinkedValueUtils.getChecked(props); + + var nativeProps = assign({}, props, { + defaultChecked: undefined, + defaultValue: undefined, + value: value != null ? value : inst._wrapperState.initialValue, + checked: checked != null ? checked : inst._wrapperState.initialChecked, + onChange: inst._wrapperState.onChange + }); + + return nativeProps; + }, + + mountWrapper: function (inst, props) { + if (process.env.NODE_ENV !== 'production') { + LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner); + } + + var defaultValue = props.defaultValue; + inst._wrapperState = { + initialChecked: props.defaultChecked || false, + initialValue: defaultValue != null ? defaultValue : null, + onChange: _handleChange.bind(inst) + }; + }, + + mountReadyWrapper: function (inst) { + // Can't be in mountWrapper or else server rendering leaks. + instancesByReactID[inst._rootNodeID] = inst; + }, + + unmountWrapper: function (inst) { + delete instancesByReactID[inst._rootNodeID]; + }, + + updateWrapper: function (inst) { + var props = inst._currentElement.props; + + // TODO: Shouldn't this be getChecked(props)? + var checked = props.checked; + if (checked != null) { + ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'checked', checked || false); + } + + var value = LinkedValueUtils.getValue(props); + if (value != null) { + // Cast `value` to a string to ensure the value is set correctly. While + // browsers typically do this as necessary, jsdom doesn't. + ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value); + } + } + }; + + function _handleChange(event) { + var props = this._currentElement.props; + + var returnValue = LinkedValueUtils.executeOnChange(props, event); + + // Here we use asap to wait until all updates have propagated, which + // is important when using controlled components within layers: + // https://github.com/facebook/react/issues/1698 + ReactUpdates.asap(forceUpdateIfMounted, this); + + var name = props.name; + if (props.type === 'radio' && name != null) { + var rootNode = ReactMount.getNode(this._rootNodeID); + var queryRoot = rootNode; + + while (queryRoot.parentNode) { + queryRoot = queryRoot.parentNode; + } + + // If `rootNode.form` was non-null, then we could try `form.elements`, + // but that sometimes behaves strangely in IE8. We could also try using + // `form.getElementsByName`, but that will only return direct children + // and won't include inputs that use the HTML5 `form=` attribute. Since + // the input might not even be in a form, let's just use the global + // `querySelectorAll` to ensure we don't miss anything. + var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); + + for (var i = 0; i < group.length; i++) { + var otherNode = group[i]; + if (otherNode === rootNode || otherNode.form !== rootNode.form) { + continue; + } + // This will throw if radio buttons rendered by different copies of React + // and the same name are rendered into the same form (same as #1939). + // That's probably okay; we don't support it just as we don't support + // mixing React with non-React. + var otherID = ReactMount.getID(otherNode); + !otherID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : undefined; + var otherInstance = instancesByReactID[otherID]; + !otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Unknown radio button ID %s.', otherID) : invariant(false) : undefined; + // If this is a controlled radio button group, forcing the input that + // was previously checked to update will cause it to be come re-checked + // as appropriate. + ReactUpdates.asap(forceUpdateIfMounted, otherInstance); + } + } + + return returnValue; + } + + module.exports = ReactDOMInput; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 295 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule LinkedValueUtils + * @typechecks static-only + */ + + 'use strict'; + + var ReactPropTypes = __webpack_require__(296); + var ReactPropTypeLocations = __webpack_require__(254); + + var invariant = __webpack_require__(202); + var warning = __webpack_require__(214); + + var hasReadOnlyValue = { + 'button': true, + 'checkbox': true, + 'image': true, + 'hidden': true, + 'radio': true, + 'reset': true, + 'submit': true + }; + + function _assertSingleLink(inputProps) { + !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : undefined; + } + function _assertValueLink(inputProps) { + _assertSingleLink(inputProps); + !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : undefined; + } + + function _assertCheckedLink(inputProps) { + _assertSingleLink(inputProps); + !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : undefined; + } + + var propTypes = { + value: function (props, propName, componentName) { + if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) { + return null; + } + return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + checked: function (props, propName, componentName) { + if (!props[propName] || props.onChange || props.readOnly || props.disabled) { + return null; + } + return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + onChange: ReactPropTypes.func + }; + + var loggedTypeFailures = {}; + function getDeclarationErrorAddendum(owner) { + if (owner) { + var name = owner.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; + } + + /** + * Provide a linked `value` attribute for controlled forms. You should not use + * this outside of the ReactDOM controlled form components. + */ + var LinkedValueUtils = { + checkPropTypes: function (tagName, props, owner) { + for (var propName in propTypes) { + if (propTypes.hasOwnProperty(propName)) { + var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var addendum = getDeclarationErrorAddendum(owner); + process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : undefined; + } + } + }, + + /** + * @param {object} inputProps Props for form component + * @return {*} current value of the input either from value prop or link. + */ + getValue: function (inputProps) { + if (inputProps.valueLink) { + _assertValueLink(inputProps); + return inputProps.valueLink.value; + } + return inputProps.value; + }, + + /** + * @param {object} inputProps Props for form component + * @return {*} current checked status of the input either from checked prop + * or link. + */ + getChecked: function (inputProps) { + if (inputProps.checkedLink) { + _assertCheckedLink(inputProps); + return inputProps.checkedLink.value; + } + return inputProps.checked; + }, + + /** + * @param {object} inputProps Props for form component + * @param {SyntheticEvent} event change event to handle + */ + executeOnChange: function (inputProps, event) { + if (inputProps.valueLink) { + _assertValueLink(inputProps); + return inputProps.valueLink.requestChange(event.target.value); + } else if (inputProps.checkedLink) { + _assertCheckedLink(inputProps); + return inputProps.checkedLink.requestChange(event.target.checked); + } else if (inputProps.onChange) { + return inputProps.onChange.call(undefined, event); + } + } + }; + + module.exports = LinkedValueUtils; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 296 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactPropTypes + */ + + 'use strict'; + + var ReactElement = __webpack_require__(231); + var ReactPropTypeLocationNames = __webpack_require__(255); + + var emptyFunction = __webpack_require__(204); + var getIteratorFn = __webpack_require__(297); + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<<anonymous>>'; + + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker + }; + + function createChainableTypeChecker(validate) { + function checkType(isRequired, props, propName, componentName, location, propFullName) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + if (props[propName] == null) { + var locationName = ReactPropTypeLocationNames[location]; + if (isRequired) { + return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + var locationName = ReactPropTypeLocationNames[location]; + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturns(null)); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var locationName = ReactPropTypeLocationNames[location]; + var propType = getPropType(propValue); + return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']'); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!ReactElement.isValidElement(props[propName])) { + var locationName = ReactPropTypeLocationNames[location]; + return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var locationName = ReactPropTypeLocationNames[location]; + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + return createChainableTypeChecker(function () { + return new Error('Invalid argument supplied to oneOf, expected an instance of array.'); + }); + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (propValue === expectedValues[i]) { + return null; + } + } + + var locationName = ReactPropTypeLocationNames[location]; + var valuesString = JSON.stringify(expectedValues); + return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + var locationName = ReactPropTypeLocationNames[location]; + return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + return createChainableTypeChecker(function () { + return new Error('Invalid argument supplied to oneOfType, expected an instance of array.'); + }); + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName) == null) { + return null; + } + } + + var locationName = ReactPropTypeLocationNames[location]; + return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + var locationName = ReactPropTypeLocationNames[location]; + return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + var locationName = ReactPropTypeLocationNames[location]; + return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || ReactElement.isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return '<<anonymous>>'; + } + return propValue.constructor.name; + } + + module.exports = ReactPropTypes; + +/***/ }, +/* 297 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getIteratorFn + * @typechecks static-only + */ + + 'use strict'; + + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + module.exports = getIteratorFn; + +/***/ }, +/* 298 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMOption + */ + + 'use strict'; + + var ReactChildren = __webpack_require__(299); + var ReactDOMSelect = __webpack_require__(301); + + var assign = __webpack_require__(228); + var warning = __webpack_require__(214); + + var valueContextKey = ReactDOMSelect.valueContextKey; + + /** + * Implements an <option> native component that warns when `selected` is set. + */ + var ReactDOMOption = { + mountWrapper: function (inst, props, context) { + // TODO (yungsters): Remove support for `selected` in <option>. + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : undefined; + } + + // Look up whether this option is 'selected' via context + var selectValue = context[valueContextKey]; + + // If context key is null (e.g., no specified value or after initial mount) + // or missing (e.g., for <datalist>), we don't change props.selected + var selected = null; + if (selectValue != null) { + selected = false; + if (Array.isArray(selectValue)) { + // multiple + for (var i = 0; i < selectValue.length; i++) { + if ('' + selectValue[i] === '' + props.value) { + selected = true; + break; + } + } + } else { + selected = '' + selectValue === '' + props.value; + } + } + + inst._wrapperState = { selected: selected }; + }, + + getNativeProps: function (inst, props, context) { + var nativeProps = assign({ selected: undefined, children: undefined }, props); + + // Read state only from initial mount because <select> updates value + // manually; we need the initial state only for server rendering + if (inst._wrapperState.selected != null) { + nativeProps.selected = inst._wrapperState.selected; + } + + var content = ''; + + // Flatten children and warn if they aren't strings or numbers; + // invalid types are ignored. + ReactChildren.forEach(props.children, function (child) { + if (child == null) { + return; + } + if (typeof child === 'string' || typeof child === 'number') { + content += child; + } else { + process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : undefined; + } + }); + + nativeProps.children = content; + return nativeProps; + } + + }; + + module.exports = ReactDOMOption; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 299 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactChildren + */ + + 'use strict'; + + var PooledClass = __webpack_require__(245); + var ReactElement = __webpack_require__(231); + + var emptyFunction = __webpack_require__(204); + var traverseAllChildren = __webpack_require__(300); + + var twoArgumentPooler = PooledClass.twoArgumentPooler; + var fourArgumentPooler = PooledClass.fourArgumentPooler; + + var userProvidedKeyEscapeRegex = /\/(?!\/)/g; + function escapeUserProvidedKey(text) { + return ('' + text).replace(userProvidedKeyEscapeRegex, '//'); + } + + /** + * PooledClass representing the bookkeeping associated with performing a child + * traversal. Allows avoiding binding callbacks. + * + * @constructor ForEachBookKeeping + * @param {!function} forEachFunction Function to perform traversal with. + * @param {?*} forEachContext Context to perform context with. + */ + function ForEachBookKeeping(forEachFunction, forEachContext) { + this.func = forEachFunction; + this.context = forEachContext; + this.count = 0; + } + ForEachBookKeeping.prototype.destructor = function () { + this.func = null; + this.context = null; + this.count = 0; + }; + PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); + + function forEachSingleChild(bookKeeping, child, name) { + var func = bookKeeping.func; + var context = bookKeeping.context; + + func.call(context, child, bookKeeping.count++); + } + + /** + * Iterates through children that are typically specified as `props.children`. + * + * The provided forEachFunc(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} forEachFunc + * @param {*} forEachContext Context for forEachContext. + */ + function forEachChildren(children, forEachFunc, forEachContext) { + if (children == null) { + return children; + } + var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); + traverseAllChildren(children, forEachSingleChild, traverseContext); + ForEachBookKeeping.release(traverseContext); + } + + /** + * PooledClass representing the bookkeeping associated with performing a child + * mapping. Allows avoiding binding callbacks. + * + * @constructor MapBookKeeping + * @param {!*} mapResult Object containing the ordered map of results. + * @param {!function} mapFunction Function to perform mapping with. + * @param {?*} mapContext Context to perform mapping with. + */ + function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { + this.result = mapResult; + this.keyPrefix = keyPrefix; + this.func = mapFunction; + this.context = mapContext; + this.count = 0; + } + MapBookKeeping.prototype.destructor = function () { + this.result = null; + this.keyPrefix = null; + this.func = null; + this.context = null; + this.count = 0; + }; + PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); + + function mapSingleChildIntoContext(bookKeeping, child, childKey) { + var result = bookKeeping.result; + var keyPrefix = bookKeeping.keyPrefix; + var func = bookKeeping.func; + var context = bookKeeping.context; + + var mappedChild = func.call(context, child, bookKeeping.count++); + if (Array.isArray(mappedChild)) { + mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); + } else if (mappedChild != null) { + if (ReactElement.isValidElement(mappedChild)) { + mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, + // Keep both the (mapped) and old keys if they differ, just as + // traverseAllChildren used to do for objects as children + keyPrefix + (mappedChild !== child ? escapeUserProvidedKey(mappedChild.key || '') + '/' : '') + childKey); + } + result.push(mappedChild); + } + } + + function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { + var escapedPrefix = ''; + if (prefix != null) { + escapedPrefix = escapeUserProvidedKey(prefix) + '/'; + } + var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); + traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); + MapBookKeeping.release(traverseContext); + } + + /** + * Maps children that are typically specified as `props.children`. + * + * The provided mapFunction(child, key, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} func The map function. + * @param {*} context Context for mapFunction. + * @return {object} Object containing the ordered map of results. + */ + function mapChildren(children, func, context) { + if (children == null) { + return children; + } + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, func, context); + return result; + } + + function forEachSingleChildDummy(traverseContext, child, name) { + return null; + } + + /** + * Count the number of children that are typically specified as + * `props.children`. + * + * @param {?*} children Children tree container. + * @return {number} The number of children. + */ + function countChildren(children, context) { + return traverseAllChildren(children, forEachSingleChildDummy, null); + } + + /** + * Flatten a children object (typically specified as `props.children`) and + * return an array with appropriately re-keyed children. + */ + function toArray(children) { + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); + return result; + } + + var ReactChildren = { + forEach: forEachChildren, + map: mapChildren, + mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, + count: countChildren, + toArray: toArray + }; + + module.exports = ReactChildren; + +/***/ }, +/* 300 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule traverseAllChildren + */ + + 'use strict'; + + var ReactCurrentOwner = __webpack_require__(194); + var ReactElement = __webpack_require__(231); + var ReactInstanceHandles = __webpack_require__(234); + + var getIteratorFn = __webpack_require__(297); + var invariant = __webpack_require__(202); + var warning = __webpack_require__(214); + + var SEPARATOR = ReactInstanceHandles.SEPARATOR; + var SUBSEPARATOR = ':'; + + /** + * TODO: Test that a single child and an array with one item have the same key + * pattern. + */ + + var userProvidedKeyEscaperLookup = { + '=': '=0', + '.': '=1', + ':': '=2' + }; + + var userProvidedKeyEscapeRegex = /[=.:]/g; + + var didWarnAboutMaps = false; + + function userProvidedKeyEscaper(match) { + return userProvidedKeyEscaperLookup[match]; + } + + /** + * Generate a key string that identifies a component within a set. + * + * @param {*} component A component that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} + */ + function getComponentKey(component, index) { + if (component && component.key != null) { + // Explicit key + return wrapUserProvidedKey(component.key); + } + // Implicit key determined by the index in the set + return index.toString(36); + } + + /** + * Escape a component key so that it is safe to use in a reactid. + * + * @param {*} text Component key to be escaped. + * @return {string} An escaped string. + */ + function escapeUserProvidedKey(text) { + return ('' + text).replace(userProvidedKeyEscapeRegex, userProvidedKeyEscaper); + } + + /** + * Wrap a `key` value explicitly provided by the user to distinguish it from + * implicitly-generated keys generated by a component's index in its parent. + * + * @param {string} key Value of a user-provided `key` attribute + * @return {string} + */ + function wrapUserProvidedKey(key) { + return '$' + escapeUserProvidedKey(key); + } + + /** + * @param {?*} children Children tree container. + * @param {!string} nameSoFar Name of the key path so far. + * @param {!function} callback Callback to invoke with each child found. + * @param {?*} traverseContext Used to pass information throughout the traversal + * process. + * @return {!number} The number of children in this subtree. + */ + function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { + var type = typeof children; + + if (type === 'undefined' || type === 'boolean') { + // All of the above are perceived as null. + children = null; + } + + if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) { + callback(traverseContext, children, + // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows. + nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); + return 1; + } + + var child; + var nextName; + var subtreeCount = 0; // Count of children found in the current subtree. + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + child = children[i]; + nextName = nextNamePrefix + getComponentKey(child, i); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else { + var iteratorFn = getIteratorFn(children); + if (iteratorFn) { + var iterator = iteratorFn.call(children); + var step; + if (iteratorFn !== children.entries) { + var ii = 0; + while (!(step = iterator.next()).done) { + child = step.value; + nextName = nextNamePrefix + getComponentKey(child, ii++); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else { + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : undefined; + didWarnAboutMaps = true; + } + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + child = entry[1]; + nextName = nextNamePrefix + wrapUserProvidedKey(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } + } + } else if (type === 'object') { + var addendum = ''; + if (process.env.NODE_ENV !== 'production') { + addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; + if (children._isReactElement) { + addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.'; + } + if (ReactCurrentOwner.current) { + var name = ReactCurrentOwner.current.getName(); + if (name) { + addendum += ' Check the render method of `' + name + '`.'; + } + } + } + var childrenString = String(children); + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : undefined; + } + } + + return subtreeCount; + } + + /** + * Traverses children that are typically specified as `props.children`, but + * might also be specified through attributes: + * + * - `traverseAllChildren(this.props.children, ...)` + * - `traverseAllChildren(this.props.leftPanelChildren, ...)` + * + * The `traverseContext` is an optional argument that is passed through the + * entire traversal. It can be used to store accumulations or anything else that + * the callback might find relevant. + * + * @param {?*} children Children tree object. + * @param {!function} callback To invoke upon traversing each child. + * @param {?*} traverseContext Context for traversal. + * @return {!number} The number of children in this subtree. + */ + function traverseAllChildren(children, callback, traverseContext) { + if (children == null) { + return 0; + } + + return traverseAllChildrenImpl(children, '', callback, traverseContext); + } + + module.exports = traverseAllChildren; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 301 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMSelect + */ + + 'use strict'; + + var LinkedValueUtils = __webpack_require__(295); + var ReactMount = __webpack_require__(217); + var ReactUpdates = __webpack_require__(243); + + var assign = __webpack_require__(228); + var warning = __webpack_require__(214); + + var valueContextKey = '__ReactDOMSelect_value$' + Math.random().toString(36).slice(2); + + function updateOptionsIfPendingUpdateAndMounted() { + if (this._rootNodeID && this._wrapperState.pendingUpdate) { + this._wrapperState.pendingUpdate = false; + + var props = this._currentElement.props; + var value = LinkedValueUtils.getValue(props); + + if (value != null) { + updateOptions(this, Boolean(props.multiple), value); + } + } + } + + function getDeclarationErrorAddendum(owner) { + if (owner) { + var name = owner.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; + } + + var valuePropNames = ['value', 'defaultValue']; + + /** + * Validation function for `value` and `defaultValue`. + * @private + */ + function checkSelectPropTypes(inst, props) { + var owner = inst._currentElement._owner; + LinkedValueUtils.checkPropTypes('select', props, owner); + + for (var i = 0; i < valuePropNames.length; i++) { + var propName = valuePropNames[i]; + if (props[propName] == null) { + continue; + } + if (props.multiple) { + process.env.NODE_ENV !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : undefined; + } else { + process.env.NODE_ENV !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : undefined; + } + } + } + + /** + * @param {ReactDOMComponent} inst + * @param {boolean} multiple + * @param {*} propValue A stringable (with `multiple`, a list of stringables). + * @private + */ + function updateOptions(inst, multiple, propValue) { + var selectedValue, i; + var options = ReactMount.getNode(inst._rootNodeID).options; + + if (multiple) { + selectedValue = {}; + for (i = 0; i < propValue.length; i++) { + selectedValue['' + propValue[i]] = true; + } + for (i = 0; i < options.length; i++) { + var selected = selectedValue.hasOwnProperty(options[i].value); + if (options[i].selected !== selected) { + options[i].selected = selected; + } + } + } else { + // Do not set `select.value` as exact behavior isn't consistent across all + // browsers for all cases. + selectedValue = '' + propValue; + for (i = 0; i < options.length; i++) { + if (options[i].value === selectedValue) { + options[i].selected = true; + return; + } + } + if (options.length) { + options[0].selected = true; + } + } + } + + /** + * Implements a <select> native component that allows optionally setting the + * props `value` and `defaultValue`. If `multiple` is false, the prop must be a + * stringable. If `multiple` is true, the prop must be an array of stringables. + * + * If `value` is not supplied (or null/undefined), user actions that change the + * selected option will trigger updates to the rendered options. + * + * If it is supplied (and not null/undefined), the rendered options will not + * update in response to user actions. Instead, the `value` prop must change in + * order for the rendered options to update. + * + * If `defaultValue` is provided, any options with the supplied values will be + * selected. + */ + var ReactDOMSelect = { + valueContextKey: valueContextKey, + + getNativeProps: function (inst, props, context) { + return assign({}, props, { + onChange: inst._wrapperState.onChange, + value: undefined + }); + }, + + mountWrapper: function (inst, props) { + if (process.env.NODE_ENV !== 'production') { + checkSelectPropTypes(inst, props); + } + + var value = LinkedValueUtils.getValue(props); + inst._wrapperState = { + pendingUpdate: false, + initialValue: value != null ? value : props.defaultValue, + onChange: _handleChange.bind(inst), + wasMultiple: Boolean(props.multiple) + }; + }, + + processChildContext: function (inst, props, context) { + // Pass down initial value so initial generated markup has correct + // `selected` attributes + var childContext = assign({}, context); + childContext[valueContextKey] = inst._wrapperState.initialValue; + return childContext; + }, + + postUpdateWrapper: function (inst) { + var props = inst._currentElement.props; + + // After the initial mount, we control selected-ness manually so don't pass + // the context value down + inst._wrapperState.initialValue = undefined; + + var wasMultiple = inst._wrapperState.wasMultiple; + inst._wrapperState.wasMultiple = Boolean(props.multiple); + + var value = LinkedValueUtils.getValue(props); + if (value != null) { + inst._wrapperState.pendingUpdate = false; + updateOptions(inst, Boolean(props.multiple), value); + } else if (wasMultiple !== Boolean(props.multiple)) { + // For simplicity, reapply `defaultValue` if `multiple` is toggled. + if (props.defaultValue != null) { + updateOptions(inst, Boolean(props.multiple), props.defaultValue); + } else { + // Revert the select back to its default unselected state. + updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : ''); + } + } + } + }; + + function _handleChange(event) { + var props = this._currentElement.props; + var returnValue = LinkedValueUtils.executeOnChange(props, event); + + this._wrapperState.pendingUpdate = true; + ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this); + return returnValue; + } + + module.exports = ReactDOMSelect; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 302 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMTextarea + */ + + 'use strict'; + + var LinkedValueUtils = __webpack_require__(295); + var ReactDOMIDOperations = __webpack_require__(216); + var ReactUpdates = __webpack_require__(243); + + var assign = __webpack_require__(228); + var invariant = __webpack_require__(202); + var warning = __webpack_require__(214); + + function forceUpdateIfMounted() { + if (this._rootNodeID) { + // DOM component is still mounted; update + ReactDOMTextarea.updateWrapper(this); + } + } + + /** + * Implements a <textarea> native component that allows setting `value`, and + * `defaultValue`. This differs from the traditional DOM API because value is + * usually set as PCDATA children. + * + * If `value` is not supplied (or null/undefined), user actions that affect the + * value will trigger updates to the element. + * + * If `value` is supplied (and not null/undefined), the rendered element will + * not trigger updates to the element. Instead, the `value` prop must change in + * order for the rendered element to be updated. + * + * The rendered element will be initialized with an empty value, the prop + * `defaultValue` if specified, or the children content (deprecated). + */ + var ReactDOMTextarea = { + getNativeProps: function (inst, props, context) { + !(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : undefined; + + // Always set children to the same thing. In IE9, the selection range will + // get reset if `textContent` is mutated. + var nativeProps = assign({}, props, { + defaultValue: undefined, + value: undefined, + children: inst._wrapperState.initialValue, + onChange: inst._wrapperState.onChange + }); + + return nativeProps; + }, + + mountWrapper: function (inst, props) { + if (process.env.NODE_ENV !== 'production') { + LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner); + } + + var defaultValue = props.defaultValue; + // TODO (yungsters): Remove support for children content in <textarea>. + var children = props.children; + if (children != null) { + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : undefined; + } + !(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : undefined; + if (Array.isArray(children)) { + !(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : undefined; + children = children[0]; + } + + defaultValue = '' + children; + } + if (defaultValue == null) { + defaultValue = ''; + } + var value = LinkedValueUtils.getValue(props); + + inst._wrapperState = { + // We save the initial value so that `ReactDOMComponent` doesn't update + // `textContent` (unnecessary since we update value). + // The initial value can be a boolean or object so that's why it's + // forced to be a string. + initialValue: '' + (value != null ? value : defaultValue), + onChange: _handleChange.bind(inst) + }; + }, + + updateWrapper: function (inst) { + var props = inst._currentElement.props; + var value = LinkedValueUtils.getValue(props); + if (value != null) { + // Cast `value` to a string to ensure the value is set correctly. While + // browsers typically do this as necessary, jsdom doesn't. + ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value); + } + } + }; + + function _handleChange(event) { + var props = this._currentElement.props; + var returnValue = LinkedValueUtils.executeOnChange(props, event); + ReactUpdates.asap(forceUpdateIfMounted, this); + return returnValue; + } + + module.exports = ReactDOMTextarea; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 303 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactMultiChild + * @typechecks static-only + */ + + 'use strict'; + + var ReactComponentEnvironment = __webpack_require__(253); + var ReactMultiChildUpdateTypes = __webpack_require__(205); + + var ReactCurrentOwner = __webpack_require__(194); + var ReactReconciler = __webpack_require__(239); + var ReactChildReconciler = __webpack_require__(304); + + var flattenChildren = __webpack_require__(305); + + /** + * Updating children of a component may trigger recursive updates. The depth is + * used to batch recursive updates to render markup more efficiently. + * + * @type {number} + * @private + */ + var updateDepth = 0; + + /** + * Queue of update configuration objects. + * + * Each object has a `type` property that is in `ReactMultiChildUpdateTypes`. + * + * @type {array<object>} + * @private + */ + var updateQueue = []; + + /** + * Queue of markup to be rendered. + * + * @type {array<string>} + * @private + */ + var markupQueue = []; + + /** + * Enqueues markup to be rendered and inserted at a supplied index. + * + * @param {string} parentID ID of the parent component. + * @param {string} markup Markup that renders into an element. + * @param {number} toIndex Destination index. + * @private + */ + function enqueueInsertMarkup(parentID, markup, toIndex) { + // NOTE: Null values reduce hidden classes. + updateQueue.push({ + parentID: parentID, + parentNode: null, + type: ReactMultiChildUpdateTypes.INSERT_MARKUP, + markupIndex: markupQueue.push(markup) - 1, + content: null, + fromIndex: null, + toIndex: toIndex + }); + } + + /** + * Enqueues moving an existing element to another index. + * + * @param {string} parentID ID of the parent component. + * @param {number} fromIndex Source index of the existing element. + * @param {number} toIndex Destination index of the element. + * @private + */ + function enqueueMove(parentID, fromIndex, toIndex) { + // NOTE: Null values reduce hidden classes. + updateQueue.push({ + parentID: parentID, + parentNode: null, + type: ReactMultiChildUpdateTypes.MOVE_EXISTING, + markupIndex: null, + content: null, + fromIndex: fromIndex, + toIndex: toIndex + }); + } + + /** + * Enqueues removing an element at an index. + * + * @param {string} parentID ID of the parent component. + * @param {number} fromIndex Index of the element to remove. + * @private + */ + function enqueueRemove(parentID, fromIndex) { + // NOTE: Null values reduce hidden classes. + updateQueue.push({ + parentID: parentID, + parentNode: null, + type: ReactMultiChildUpdateTypes.REMOVE_NODE, + markupIndex: null, + content: null, + fromIndex: fromIndex, + toIndex: null + }); + } + + /** + * Enqueues setting the markup of a node. + * + * @param {string} parentID ID of the parent component. + * @param {string} markup Markup that renders into an element. + * @private + */ + function enqueueSetMarkup(parentID, markup) { + // NOTE: Null values reduce hidden classes. + updateQueue.push({ + parentID: parentID, + parentNode: null, + type: ReactMultiChildUpdateTypes.SET_MARKUP, + markupIndex: null, + content: markup, + fromIndex: null, + toIndex: null + }); + } + + /** + * Enqueues setting the text content. + * + * @param {string} parentID ID of the parent component. + * @param {string} textContent Text content to set. + * @private + */ + function enqueueTextContent(parentID, textContent) { + // NOTE: Null values reduce hidden classes. + updateQueue.push({ + parentID: parentID, + parentNode: null, + type: ReactMultiChildUpdateTypes.TEXT_CONTENT, + markupIndex: null, + content: textContent, + fromIndex: null, + toIndex: null + }); + } + + /** + * Processes any enqueued updates. + * + * @private + */ + function processQueue() { + if (updateQueue.length) { + ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue); + clearQueue(); + } + } + + /** + * Clears any enqueued updates. + * + * @private + */ + function clearQueue() { + updateQueue.length = 0; + markupQueue.length = 0; + } + + /** + * ReactMultiChild are capable of reconciling multiple children. + * + * @class ReactMultiChild + * @internal + */ + var ReactMultiChild = { + + /** + * Provides common functionality for components that must reconcile multiple + * children. This is used by `ReactDOMComponent` to mount, update, and + * unmount child components. + * + * @lends {ReactMultiChild.prototype} + */ + Mixin: { + + _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) { + if (process.env.NODE_ENV !== 'production') { + if (this._currentElement) { + try { + ReactCurrentOwner.current = this._currentElement._owner; + return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context); + } finally { + ReactCurrentOwner.current = null; + } + } + } + return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context); + }, + + _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, transaction, context) { + var nextChildren; + if (process.env.NODE_ENV !== 'production') { + if (this._currentElement) { + try { + ReactCurrentOwner.current = this._currentElement._owner; + nextChildren = flattenChildren(nextNestedChildrenElements); + } finally { + ReactCurrentOwner.current = null; + } + return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context); + } + } + nextChildren = flattenChildren(nextNestedChildrenElements); + return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context); + }, + + /** + * Generates a "mount image" for each of the supplied children. In the case + * of `ReactDOMComponent`, a mount image is a string of markup. + * + * @param {?object} nestedChildren Nested child maps. + * @return {array} An array of mounted representations. + * @internal + */ + mountChildren: function (nestedChildren, transaction, context) { + var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context); + this._renderedChildren = children; + var mountImages = []; + var index = 0; + for (var name in children) { + if (children.hasOwnProperty(name)) { + var child = children[name]; + // Inlined for performance, see `ReactInstanceHandles.createReactID`. + var rootID = this._rootNodeID + name; + var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context); + child._mountIndex = index++; + mountImages.push(mountImage); + } + } + return mountImages; + }, + + /** + * Replaces any rendered children with a text content string. + * + * @param {string} nextContent String of content. + * @internal + */ + updateTextContent: function (nextContent) { + updateDepth++; + var errorThrown = true; + try { + var prevChildren = this._renderedChildren; + // Remove any rendered children. + ReactChildReconciler.unmountChildren(prevChildren); + // TODO: The setTextContent operation should be enough + for (var name in prevChildren) { + if (prevChildren.hasOwnProperty(name)) { + this._unmountChild(prevChildren[name]); + } + } + // Set new text content. + this.setTextContent(nextContent); + errorThrown = false; + } finally { + updateDepth--; + if (!updateDepth) { + if (errorThrown) { + clearQueue(); + } else { + processQueue(); + } + } + } + }, + + /** + * Replaces any rendered children with a markup string. + * + * @param {string} nextMarkup String of markup. + * @internal + */ + updateMarkup: function (nextMarkup) { + updateDepth++; + var errorThrown = true; + try { + var prevChildren = this._renderedChildren; + // Remove any rendered children. + ReactChildReconciler.unmountChildren(prevChildren); + for (var name in prevChildren) { + if (prevChildren.hasOwnProperty(name)) { + this._unmountChildByName(prevChildren[name], name); + } + } + this.setMarkup(nextMarkup); + errorThrown = false; + } finally { + updateDepth--; + if (!updateDepth) { + if (errorThrown) { + clearQueue(); + } else { + processQueue(); + } + } + } + }, + + /** + * Updates the rendered children with new children. + * + * @param {?object} nextNestedChildrenElements Nested child element maps. + * @param {ReactReconcileTransaction} transaction + * @internal + */ + updateChildren: function (nextNestedChildrenElements, transaction, context) { + updateDepth++; + var errorThrown = true; + try { + this._updateChildren(nextNestedChildrenElements, transaction, context); + errorThrown = false; + } finally { + updateDepth--; + if (!updateDepth) { + if (errorThrown) { + clearQueue(); + } else { + processQueue(); + } + } + } + }, + + /** + * Improve performance by isolating this hot code path from the try/catch + * block in `updateChildren`. + * + * @param {?object} nextNestedChildrenElements Nested child element maps. + * @param {ReactReconcileTransaction} transaction + * @final + * @protected + */ + _updateChildren: function (nextNestedChildrenElements, transaction, context) { + var prevChildren = this._renderedChildren; + var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, transaction, context); + this._renderedChildren = nextChildren; + if (!nextChildren && !prevChildren) { + return; + } + var name; + // `nextIndex` will increment for each child in `nextChildren`, but + // `lastIndex` will be the last index visited in `prevChildren`. + var lastIndex = 0; + var nextIndex = 0; + for (name in nextChildren) { + if (!nextChildren.hasOwnProperty(name)) { + continue; + } + var prevChild = prevChildren && prevChildren[name]; + var nextChild = nextChildren[name]; + if (prevChild === nextChild) { + this.moveChild(prevChild, nextIndex, lastIndex); + lastIndex = Math.max(prevChild._mountIndex, lastIndex); + prevChild._mountIndex = nextIndex; + } else { + if (prevChild) { + // Update `lastIndex` before `_mountIndex` gets unset by unmounting. + lastIndex = Math.max(prevChild._mountIndex, lastIndex); + this._unmountChild(prevChild); + } + // The child must be instantiated before it's mounted. + this._mountChildByNameAtIndex(nextChild, name, nextIndex, transaction, context); + } + nextIndex++; + } + // Remove children that are no longer present. + for (name in prevChildren) { + if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) { + this._unmountChild(prevChildren[name]); + } + } + }, + + /** + * Unmounts all rendered children. This should be used to clean up children + * when this component is unmounted. + * + * @internal + */ + unmountChildren: function () { + var renderedChildren = this._renderedChildren; + ReactChildReconciler.unmountChildren(renderedChildren); + this._renderedChildren = null; + }, + + /** + * Moves a child component to the supplied index. + * + * @param {ReactComponent} child Component to move. + * @param {number} toIndex Destination index of the element. + * @param {number} lastIndex Last index visited of the siblings of `child`. + * @protected + */ + moveChild: function (child, toIndex, lastIndex) { + // If the index of `child` is less than `lastIndex`, then it needs to + // be moved. Otherwise, we do not need to move it because a child will be + // inserted or moved before `child`. + if (child._mountIndex < lastIndex) { + enqueueMove(this._rootNodeID, child._mountIndex, toIndex); + } + }, + + /** + * Creates a child component. + * + * @param {ReactComponent} child Component to create. + * @param {string} mountImage Markup to insert. + * @protected + */ + createChild: function (child, mountImage) { + enqueueInsertMarkup(this._rootNodeID, mountImage, child._mountIndex); + }, + + /** + * Removes a child component. + * + * @param {ReactComponent} child Child to remove. + * @protected + */ + removeChild: function (child) { + enqueueRemove(this._rootNodeID, child._mountIndex); + }, + + /** + * Sets this text content string. + * + * @param {string} textContent Text content to set. + * @protected + */ + setTextContent: function (textContent) { + enqueueTextContent(this._rootNodeID, textContent); + }, + + /** + * Sets this markup string. + * + * @param {string} markup Markup to set. + * @protected + */ + setMarkup: function (markup) { + enqueueSetMarkup(this._rootNodeID, markup); + }, + + /** + * Mounts a child with the supplied name. + * + * NOTE: This is part of `updateChildren` and is here for readability. + * + * @param {ReactComponent} child Component to mount. + * @param {string} name Name of the child. + * @param {number} index Index at which to insert the child. + * @param {ReactReconcileTransaction} transaction + * @private + */ + _mountChildByNameAtIndex: function (child, name, index, transaction, context) { + // Inlined for performance, see `ReactInstanceHandles.createReactID`. + var rootID = this._rootNodeID + name; + var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context); + child._mountIndex = index; + this.createChild(child, mountImage); + }, + + /** + * Unmounts a rendered child. + * + * NOTE: This is part of `updateChildren` and is here for readability. + * + * @param {ReactComponent} child Component to unmount. + * @private + */ + _unmountChild: function (child) { + this.removeChild(child); + child._mountIndex = null; + } + + } + + }; + + module.exports = ReactMultiChild; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 304 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactChildReconciler + * @typechecks static-only + */ + + 'use strict'; + + var ReactReconciler = __webpack_require__(239); + + var instantiateReactComponent = __webpack_require__(251); + var shouldUpdateReactComponent = __webpack_require__(256); + var traverseAllChildren = __webpack_require__(300); + var warning = __webpack_require__(214); + + function instantiateChild(childInstances, child, name) { + // We found a component instance. + var keyUnique = childInstances[name] === undefined; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined; + } + if (child != null && keyUnique) { + childInstances[name] = instantiateReactComponent(child, null); + } + } + + /** + * ReactChildReconciler provides helpers for initializing or updating a set of + * children. Its output is suitable for passing it onto ReactMultiChild which + * does diffed reordering and insertion. + */ + var ReactChildReconciler = { + /** + * Generates a "mount image" for each of the supplied children. In the case + * of `ReactDOMComponent`, a mount image is a string of markup. + * + * @param {?object} nestedChildNodes Nested child maps. + * @return {?object} A set of child instances. + * @internal + */ + instantiateChildren: function (nestedChildNodes, transaction, context) { + if (nestedChildNodes == null) { + return null; + } + var childInstances = {}; + traverseAllChildren(nestedChildNodes, instantiateChild, childInstances); + return childInstances; + }, + + /** + * Updates the rendered children and returns a new set of children. + * + * @param {?object} prevChildren Previously initialized set of children. + * @param {?object} nextChildren Flat child element maps. + * @param {ReactReconcileTransaction} transaction + * @param {object} context + * @return {?object} A new set of child instances. + * @internal + */ + updateChildren: function (prevChildren, nextChildren, transaction, context) { + // We currently don't have a way to track moves here but if we use iterators + // instead of for..in we can zip the iterators and check if an item has + // moved. + // TODO: If nothing has changed, return the prevChildren object so that we + // can quickly bailout if nothing has changed. + if (!nextChildren && !prevChildren) { + return null; + } + var name; + for (name in nextChildren) { + if (!nextChildren.hasOwnProperty(name)) { + continue; + } + var prevChild = prevChildren && prevChildren[name]; + var prevElement = prevChild && prevChild._currentElement; + var nextElement = nextChildren[name]; + if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) { + ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context); + nextChildren[name] = prevChild; + } else { + if (prevChild) { + ReactReconciler.unmountComponent(prevChild, name); + } + // The child must be instantiated before it's mounted. + var nextChildInstance = instantiateReactComponent(nextElement, null); + nextChildren[name] = nextChildInstance; + } + } + // Unmount children that are no longer present. + for (name in prevChildren) { + if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) { + ReactReconciler.unmountComponent(prevChildren[name]); + } + } + return nextChildren; + }, + + /** + * Unmounts all rendered children. This should be used to clean up children + * when this component is unmounted. + * + * @param {?object} renderedChildren Previously initialized set of children. + * @internal + */ + unmountChildren: function (renderedChildren) { + for (var name in renderedChildren) { + if (renderedChildren.hasOwnProperty(name)) { + var renderedChild = renderedChildren[name]; + ReactReconciler.unmountComponent(renderedChild); + } + } + } + + }; + + module.exports = ReactChildReconciler; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 305 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule flattenChildren + */ + + 'use strict'; + + var traverseAllChildren = __webpack_require__(300); + var warning = __webpack_require__(214); + + /** + * @param {function} traverseContext Context passed through traversal. + * @param {?ReactComponent} child React child component. + * @param {!string} name String name of key path to child. + */ + function flattenSingleChildIntoContext(traverseContext, child, name) { + // We found a component instance. + var result = traverseContext; + var keyUnique = result[name] === undefined; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined; + } + if (keyUnique && child != null) { + result[name] = child; + } + } + + /** + * Flattens children that are typically specified as `props.children`. Any null + * children will not be included in the resulting object. + * @return {!object} flattened children keyed by name. + */ + function flattenChildren(children) { + if (children == null) { + return children; + } + var result = {}; + traverseAllChildren(children, flattenSingleChildIntoContext, result); + return result; + } + + module.exports = flattenChildren; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 306 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule shallowEqual + * @typechecks + * + */ + + 'use strict'; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + /** + * Performs equality by iterating through keys on an object and returning false + * when any key has values which are not strictly equal between the arguments. + * Returns true when the values of all keys are strictly equal. + */ + function shallowEqual(objA, objB) { + if (objA === objB) { + return true; + } + + if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { + return false; + } + + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); + + if (keysA.length !== keysB.length) { + return false; + } + + // Test for A's keys different from B. + var bHasOwnProperty = hasOwnProperty.bind(objB); + for (var i = 0; i < keysA.length; i++) { + if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) { + return false; + } + } + + return true; + } + + module.exports = shallowEqual; + +/***/ }, +/* 307 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactEventListener + * @typechecks static-only + */ + + 'use strict'; + + var EventListener = __webpack_require__(308); + var ExecutionEnvironment = __webpack_require__(198); + var PooledClass = __webpack_require__(245); + var ReactInstanceHandles = __webpack_require__(234); + var ReactMount = __webpack_require__(217); + var ReactUpdates = __webpack_require__(243); + + var assign = __webpack_require__(228); + var getEventTarget = __webpack_require__(270); + var getUnboundedScrollPosition = __webpack_require__(309); + + var DOCUMENT_FRAGMENT_NODE_TYPE = 11; + + /** + * Finds the parent React component of `node`. + * + * @param {*} node + * @return {?DOMEventTarget} Parent container, or `null` if the specified node + * is not nested. + */ + function findParent(node) { + // TODO: It may be a good idea to cache this to prevent unnecessary DOM + // traversal, but caching is difficult to do correctly without using a + // mutation observer to listen for all DOM changes. + var nodeID = ReactMount.getID(node); + var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID); + var container = ReactMount.findReactContainerForID(rootID); + var parent = ReactMount.getFirstReactDOM(container); + return parent; + } + + // Used to store ancestor hierarchy in top level callback + function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) { + this.topLevelType = topLevelType; + this.nativeEvent = nativeEvent; + this.ancestors = []; + } + assign(TopLevelCallbackBookKeeping.prototype, { + destructor: function () { + this.topLevelType = null; + this.nativeEvent = null; + this.ancestors.length = 0; + } + }); + PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler); + + function handleTopLevelImpl(bookKeeping) { + // TODO: Re-enable event.path handling + // + // if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) { + // // New browsers have a path attribute on native events + // handleTopLevelWithPath(bookKeeping); + // } else { + // // Legacy browsers don't have a path attribute on native events + // handleTopLevelWithoutPath(bookKeeping); + // } + + void handleTopLevelWithPath; // temporarily unused + handleTopLevelWithoutPath(bookKeeping); + } + + // Legacy browsers don't have a path attribute on native events + function handleTopLevelWithoutPath(bookKeeping) { + var topLevelTarget = ReactMount.getFirstReactDOM(getEventTarget(bookKeeping.nativeEvent)) || window; + + // Loop through the hierarchy, in case there's any nested components. + // It's important that we build the array of ancestors before calling any + // event handlers, because event handlers can modify the DOM, leading to + // inconsistencies with ReactMount's node cache. See #1105. + var ancestor = topLevelTarget; + while (ancestor) { + bookKeeping.ancestors.push(ancestor); + ancestor = findParent(ancestor); + } + + for (var i = 0; i < bookKeeping.ancestors.length; i++) { + topLevelTarget = bookKeeping.ancestors[i]; + var topLevelTargetID = ReactMount.getID(topLevelTarget) || ''; + ReactEventListener._handleTopLevel(bookKeeping.topLevelType, topLevelTarget, topLevelTargetID, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent)); + } + } + + // New browsers have a path attribute on native events + function handleTopLevelWithPath(bookKeeping) { + var path = bookKeeping.nativeEvent.path; + var currentNativeTarget = path[0]; + var eventsFired = 0; + for (var i = 0; i < path.length; i++) { + var currentPathElement = path[i]; + if (currentPathElement.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE) { + currentNativeTarget = path[i + 1]; + } + // TODO: slow + var reactParent = ReactMount.getFirstReactDOM(currentPathElement); + if (reactParent === currentPathElement) { + var currentPathElementID = ReactMount.getID(currentPathElement); + var newRootID = ReactInstanceHandles.getReactRootIDFromNodeID(currentPathElementID); + bookKeeping.ancestors.push(currentPathElement); + + var topLevelTargetID = ReactMount.getID(currentPathElement) || ''; + eventsFired++; + ReactEventListener._handleTopLevel(bookKeeping.topLevelType, currentPathElement, topLevelTargetID, bookKeeping.nativeEvent, currentNativeTarget); + + // Jump to the root of this React render tree + while (currentPathElementID !== newRootID) { + i++; + currentPathElement = path[i]; + currentPathElementID = ReactMount.getID(currentPathElement); + } + } + } + if (eventsFired === 0) { + ReactEventListener._handleTopLevel(bookKeeping.topLevelType, window, '', bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent)); + } + } + + function scrollValueMonitor(cb) { + var scrollPosition = getUnboundedScrollPosition(window); + cb(scrollPosition); + } + + var ReactEventListener = { + _enabled: true, + _handleTopLevel: null, + + WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null, + + setHandleTopLevel: function (handleTopLevel) { + ReactEventListener._handleTopLevel = handleTopLevel; + }, + + setEnabled: function (enabled) { + ReactEventListener._enabled = !!enabled; + }, + + isEnabled: function () { + return ReactEventListener._enabled; + }, + + /** + * Traps top-level events by using event bubbling. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {string} handlerBaseName Event name (e.g. "click"). + * @param {object} handle Element on which to attach listener. + * @return {?object} An object with a remove function which will forcefully + * remove the listener. + * @internal + */ + trapBubbledEvent: function (topLevelType, handlerBaseName, handle) { + var element = handle; + if (!element) { + return null; + } + return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType)); + }, + + /** + * Traps a top-level event by using event capturing. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {string} handlerBaseName Event name (e.g. "click"). + * @param {object} handle Element on which to attach listener. + * @return {?object} An object with a remove function which will forcefully + * remove the listener. + * @internal + */ + trapCapturedEvent: function (topLevelType, handlerBaseName, handle) { + var element = handle; + if (!element) { + return null; + } + return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType)); + }, + + monitorScrollValue: function (refresh) { + var callback = scrollValueMonitor.bind(null, refresh); + EventListener.listen(window, 'scroll', callback); + }, + + dispatchEvent: function (topLevelType, nativeEvent) { + if (!ReactEventListener._enabled) { + return; + } + + var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent); + try { + // Event queue being processed in the same cycle allows + // `preventDefault`. + ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping); + } finally { + TopLevelCallbackBookKeeping.release(bookKeeping); + } + } + }; + + module.exports = ReactEventListener; + +/***/ }, +/* 308 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @providesModule EventListener + * @typechecks + */ + + 'use strict'; + + var emptyFunction = __webpack_require__(204); + + /** + * Upstream version of event listener. Does not take into account specific + * nature of platform. + */ + var EventListener = { + /** + * Listen to DOM events during the bubble phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + listen: function (target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, false); + return { + remove: function () { + target.removeEventListener(eventType, callback, false); + } + }; + } else if (target.attachEvent) { + target.attachEvent('on' + eventType, callback); + return { + remove: function () { + target.detachEvent('on' + eventType, callback); + } + }; + } + }, + + /** + * Listen to DOM events during the capture phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + capture: function (target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, true); + return { + remove: function () { + target.removeEventListener(eventType, callback, true); + } + }; + } else { + if (process.env.NODE_ENV !== 'production') { + console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); + } + return { + remove: emptyFunction + }; + } + }, + + registerDefault: function () {} + }; + + module.exports = EventListener; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 309 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getUnboundedScrollPosition + * @typechecks + */ + + 'use strict'; + + /** + * Gets the scroll position of the supplied element or window. + * + * The return values are unbounded, unlike `getScrollPosition`. This means they + * may be negative or exceed the element boundaries (which is possible using + * inertial scrolling). + * + * @param {DOMWindow|DOMElement} scrollable + * @return {object} Map with `x` and `y` keys. + */ + function getUnboundedScrollPosition(scrollable) { + if (scrollable === window) { + return { + x: window.pageXOffset || document.documentElement.scrollLeft, + y: window.pageYOffset || document.documentElement.scrollTop + }; + } + return { + x: scrollable.scrollLeft, + y: scrollable.scrollTop + }; + } + + module.exports = getUnboundedScrollPosition; + +/***/ }, +/* 310 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactInjection + */ + + 'use strict'; + + var DOMProperty = __webpack_require__(212); + var EventPluginHub = __webpack_require__(220); + var ReactComponentEnvironment = __webpack_require__(253); + var ReactClass = __webpack_require__(311); + var ReactEmptyComponent = __webpack_require__(257); + var ReactBrowserEventEmitter = __webpack_require__(218); + var ReactNativeComponent = __webpack_require__(258); + var ReactPerf = __webpack_require__(207); + var ReactRootIndex = __webpack_require__(235); + var ReactUpdates = __webpack_require__(243); + + var ReactInjection = { + Component: ReactComponentEnvironment.injection, + Class: ReactClass.injection, + DOMProperty: DOMProperty.injection, + EmptyComponent: ReactEmptyComponent.injection, + EventPluginHub: EventPluginHub.injection, + EventEmitter: ReactBrowserEventEmitter.injection, + NativeComponent: ReactNativeComponent.injection, + Perf: ReactPerf.injection, + RootIndex: ReactRootIndex.injection, + Updates: ReactUpdates.injection + }; + + module.exports = ReactInjection; + +/***/ }, +/* 311 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactClass + */ + + 'use strict'; + + var ReactComponent = __webpack_require__(312); + var ReactElement = __webpack_require__(231); + var ReactPropTypeLocations = __webpack_require__(254); + var ReactPropTypeLocationNames = __webpack_require__(255); + var ReactNoopUpdateQueue = __webpack_require__(313); + + var assign = __webpack_require__(228); + var emptyObject = __webpack_require__(247); + var invariant = __webpack_require__(202); + var keyMirror = __webpack_require__(206); + var keyOf = __webpack_require__(268); + var warning = __webpack_require__(214); + + var MIXINS_KEY = keyOf({ mixins: null }); + + /** + * Policies that describe methods in `ReactClassInterface`. + */ + var SpecPolicy = keyMirror({ + /** + * These methods may be defined only once by the class specification or mixin. + */ + DEFINE_ONCE: null, + /** + * These methods may be defined by both the class specification and mixins. + * Subsequent definitions will be chained. These methods must return void. + */ + DEFINE_MANY: null, + /** + * These methods are overriding the base class. + */ + OVERRIDE_BASE: null, + /** + * These methods are similar to DEFINE_MANY, except we assume they return + * objects. We try to merge the keys of the return values of all the mixed in + * functions. If there is a key conflict we throw. + */ + DEFINE_MANY_MERGED: null + }); + + var injectedMixins = []; + + var warnedSetProps = false; + function warnSetProps() { + if (!warnedSetProps) { + warnedSetProps = true; + process.env.NODE_ENV !== 'production' ? warning(false, 'setProps(...) and replaceProps(...) are deprecated. ' + 'Instead, call render again at the top level.') : undefined; + } + } + + /** + * Composite components are higher-level components that compose other composite + * or native components. + * + * To create a new type of `ReactClass`, pass a specification of + * your new class to `React.createClass`. The only requirement of your class + * specification is that you implement a `render` method. + * + * var MyComponent = React.createClass({ + * render: function() { + * return <div>Hello World</div>; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: SpecPolicy.DEFINE_MANY, + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: SpecPolicy.DEFINE_MANY, + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: SpecPolicy.DEFINE_MANY, + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: SpecPolicy.DEFINE_MANY, + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: SpecPolicy.DEFINE_MANY, + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED, + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: SpecPolicy.DEFINE_MANY_MERGED, + + /** + * @return {object} + * @optional + */ + getChildContext: SpecPolicy.DEFINE_MANY_MERGED, + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return <div>Hello, {name}!</div>; + * } + * + * @return {ReactComponent} + * @nosideeffects + * @required + */ + render: SpecPolicy.DEFINE_ONCE, + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: SpecPolicy.DEFINE_MANY, + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: SpecPolicy.DEFINE_MANY, + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: SpecPolicy.DEFINE_MANY, + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: SpecPolicy.DEFINE_ONCE, + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: SpecPolicy.DEFINE_MANY, + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: SpecPolicy.DEFINE_MANY, + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: SpecPolicy.DEFINE_MANY, + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: SpecPolicy.OVERRIDE_BASE + + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function (Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function (Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function (Constructor, childContextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext); + } + Constructor.childContextTypes = assign({}, Constructor.childContextTypes, childContextTypes); + }, + contextTypes: function (Constructor, contextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context); + } + Constructor.contextTypes = assign({}, Constructor.contextTypes, contextTypes); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function (Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function (Constructor, propTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop); + } + Constructor.propTypes = assign({}, Constructor.propTypes, propTypes); + }, + statics: function (Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function () {} }; + + // noop + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an invariant so components + // don't show up in prod but not in __DEV__ + process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : undefined; + } + } + } + + function validateMethodOverride(proto, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : undefined; + } + + // Disallow defining methods more than once unless explicitly allowed. + if (proto.hasOwnProperty(name)) { + !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : undefined; + } + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classses. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + return; + } + + !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class as a mixin. Instead, just use a regular object.') : invariant(false) : undefined; + !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : undefined; + + var proto = Constructor.prototype; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } + + var property = spec[name]; + validateMethodOverride(proto, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isAlreadyDefined = proto.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; + + if (shouldAutoBind) { + if (!proto.__reactAutoBindMap) { + proto.__reactAutoBindMap = {}; + } + proto.__reactAutoBindMap[name] = property; + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : undefined; + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === SpecPolicy.DEFINE_MANY) { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (process.env.NODE_ENV !== 'production') { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = (name in RESERVED_SPEC_KEYS); + !!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, '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.', name) : invariant(false) : undefined; + + var isInherited = (name in Constructor); + !!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : undefined; + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : undefined; + + for (var key in two) { + if (two.hasOwnProperty(key)) { + !(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, '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.', key) : invariant(false) : undefined; + one[key] = two[key]; + } + } + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (process.env.NODE_ENV !== 'production') { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + /* eslint-disable block-scoped-var, no-undef */ + boundMethod.bind = function (newThis) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : undefined; + } else if (!args.length) { + process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : undefined; + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + /* eslint-enable */ + }; + } + return boundMethod; + } + + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + for (var autoBindKey in component.__reactAutoBindMap) { + if (component.__reactAutoBindMap.hasOwnProperty(autoBindKey)) { + var method = component.__reactAutoBindMap[autoBindKey]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + } + + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function (newState, callback) { + this.updater.enqueueReplaceState(this, newState); + if (callback) { + this.updater.enqueueCallback(this, callback); + } + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function () { + return this.updater.isMounted(this); + }, + + /** + * Sets a subset of the props. + * + * @param {object} partialProps Subset of the next props. + * @param {?function} callback Called after props are updated. + * @final + * @public + * @deprecated + */ + setProps: function (partialProps, callback) { + if (process.env.NODE_ENV !== 'production') { + warnSetProps(); + } + this.updater.enqueueSetProps(this, partialProps); + if (callback) { + this.updater.enqueueCallback(this, callback); + } + }, + + /** + * Replace all the props. + * + * @param {object} newProps Subset of the next props. + * @param {?function} callback Called after props are updated. + * @final + * @public + * @deprecated + */ + replaceProps: function (newProps, callback) { + if (process.env.NODE_ENV !== 'production') { + warnSetProps(); + } + this.updater.enqueueReplaceProps(this, newProps); + if (callback) { + this.updater.enqueueCallback(this, callback); + } + } + }; + + var ReactClassComponent = function () {}; + assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); + + /** + * Module for creating composite components. + * + * @class ReactClass + */ + var ReactClass = { + + /** + * Creates a composite component class given a class specification. + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + createClass: function (spec) { + var Constructor = function (props, context, updater) { + // This constructor is overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : undefined; + } + + // Wire up auto-binding + if (this.__reactAutoBindMap) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. + + var initialState = this.getInitialState ? this.getInitialState() : null; + if (process.env.NODE_ENV !== 'production') { + // We allow auto-mocks to proceed as if they're returning null. + if (typeof initialState === 'undefined' && this.getInitialState._isMockFunction) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : undefined; + + this.state = initialState; + }; + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, spec); + + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if (process.env.NODE_ENV !== 'production') { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + !Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : undefined; + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : undefined; + process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : undefined; + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + }, + + injection: { + injectMixin: function (mixin) { + injectedMixins.push(mixin); + } + } + + }; + + module.exports = ReactClass; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 312 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactComponent + */ + + 'use strict'; + + var ReactNoopUpdateQueue = __webpack_require__(313); + + var canDefineProperty = __webpack_require__(232); + var emptyObject = __webpack_require__(247); + var invariant = __webpack_require__(202); + var warning = __webpack_require__(214); + + /** + * Base class helpers for the updating state of a component. + */ + function ReactComponent(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + // We initialize the default updater but the real one gets injected by the + // renderer. + this.updater = updater || ReactNoopUpdateQueue; + } + + ReactComponent.prototype.isReactComponent = {}; + + /** + * Sets a subset of the state. Always use this to mutate + * state. You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * There is no guarantee that calls to `setState` will run synchronously, + * as they may eventually be batched together. You can provide an optional + * callback that will be executed when the call to setState is actually + * completed. + * + * When a function is provided to setState, it will be called at some point in + * the future (not synchronously). It will be called with the up to date + * component arguments (state, props, context). These values can be different + * from this.* because your function may be called after receiveProps but before + * shouldComponentUpdate, and this new state, props, and context will not yet be + * assigned to this. + * + * @param {object|function} partialState Next partial state or function to + * produce next partial state to be merged with current state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */ + ReactComponent.prototype.setState = function (partialState, callback) { + !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : undefined; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : undefined; + } + this.updater.enqueueSetState(this, partialState); + if (callback) { + this.updater.enqueueCallback(this, callback); + } + }; + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {?function} callback Called after update is complete. + * @final + * @protected + */ + ReactComponent.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this); + if (callback) { + this.updater.enqueueCallback(this, callback); + } + }; + + /** + * Deprecated APIs. These APIs used to exist on classic React classes but since + * we would like to deprecate them, we're not going to move them over to this + * modern base class. Instead, we define a getter that warns if it's accessed. + */ + if (process.env.NODE_ENV !== 'production') { + var deprecatedAPIs = { + getDOMNode: ['getDOMNode', 'Use ReactDOM.findDOMNode(component) instead.'], + isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], + replaceProps: ['replaceProps', 'Instead, call render again at the top level.'], + replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'], + setProps: ['setProps', 'Instead, call render again at the top level.'] + }; + var defineDeprecationWarning = function (methodName, info) { + if (canDefineProperty) { + Object.defineProperty(ReactComponent.prototype, methodName, { + get: function () { + process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : undefined; + return undefined; + } + }); + } + }; + for (var fnName in deprecatedAPIs) { + if (deprecatedAPIs.hasOwnProperty(fnName)) { + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + } + } + } + + module.exports = ReactComponent; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 313 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactNoopUpdateQueue + */ + + 'use strict'; + + var warning = __webpack_require__(214); + + function warnTDZ(publicInstance, callerName) { + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor && publicInstance.constructor.displayName || '') : undefined; + } + } + + /** + * This is the abstract API for an update queue. + */ + var ReactNoopUpdateQueue = { + + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function (publicInstance) { + return false; + }, + + /** + * Enqueue a callback that will be executed after all the pending updates + * have processed. + * + * @param {ReactClass} publicInstance The instance to use as `this` context. + * @param {?function} callback Called after state is updated. + * @internal + */ + enqueueCallback: function (publicInstance, callback) {}, + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @internal + */ + enqueueForceUpdate: function (publicInstance) { + warnTDZ(publicInstance, 'forceUpdate'); + }, + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @internal + */ + enqueueReplaceState: function (publicInstance, completeState) { + warnTDZ(publicInstance, 'replaceState'); + }, + + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @internal + */ + enqueueSetState: function (publicInstance, partialState) { + warnTDZ(publicInstance, 'setState'); + }, + + /** + * Sets a subset of the props. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialProps Subset of the next props. + * @internal + */ + enqueueSetProps: function (publicInstance, partialProps) { + warnTDZ(publicInstance, 'setProps'); + }, + + /** + * Replaces all of the props. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} props New props. + * @internal + */ + enqueueReplaceProps: function (publicInstance, props) { + warnTDZ(publicInstance, 'replaceProps'); + } + + }; + + module.exports = ReactNoopUpdateQueue; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 314 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactReconcileTransaction + * @typechecks static-only + */ + + 'use strict'; + + var CallbackQueue = __webpack_require__(244); + var PooledClass = __webpack_require__(245); + var ReactBrowserEventEmitter = __webpack_require__(218); + var ReactDOMFeatureFlags = __webpack_require__(230); + var ReactInputSelection = __webpack_require__(315); + var Transaction = __webpack_require__(246); + + var assign = __webpack_require__(228); + + /** + * Ensures that, when possible, the selection range (currently selected text + * input) is not disturbed by performing the transaction. + */ + var SELECTION_RESTORATION = { + /** + * @return {Selection} Selection information. + */ + initialize: ReactInputSelection.getSelectionInformation, + /** + * @param {Selection} sel Selection information returned from `initialize`. + */ + close: ReactInputSelection.restoreSelection + }; + + /** + * Suppresses events (blur/focus) that could be inadvertently dispatched due to + * high level DOM manipulations (like temporarily removing a text input from the + * DOM). + */ + var EVENT_SUPPRESSION = { + /** + * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before + * the reconciliation. + */ + initialize: function () { + var currentlyEnabled = ReactBrowserEventEmitter.isEnabled(); + ReactBrowserEventEmitter.setEnabled(false); + return currentlyEnabled; + }, + + /** + * @param {boolean} previouslyEnabled Enabled status of + * `ReactBrowserEventEmitter` before the reconciliation occurred. `close` + * restores the previous value. + */ + close: function (previouslyEnabled) { + ReactBrowserEventEmitter.setEnabled(previouslyEnabled); + } + }; + + /** + * Provides a queue for collecting `componentDidMount` and + * `componentDidUpdate` callbacks during the the transaction. + */ + var ON_DOM_READY_QUEUEING = { + /** + * Initializes the internal `onDOMReady` queue. + */ + initialize: function () { + this.reactMountReady.reset(); + }, + + /** + * After DOM is flushed, invoke all registered `onDOMReady` callbacks. + */ + close: function () { + this.reactMountReady.notifyAll(); + } + }; + + /** + * Executed within the scope of the `Transaction` instance. Consider these as + * being member methods, but with an implied ordering while being isolated from + * each other. + */ + var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING]; + + /** + * Currently: + * - The order that these are listed in the transaction is critical: + * - Suppresses events. + * - Restores selection range. + * + * Future: + * - Restore document/overflow scroll positions that were unintentionally + * modified via DOM insertions above the top viewport boundary. + * - Implement/integrate with customized constraint based layout system and keep + * track of which dimensions must be remeasured. + * + * @class ReactReconcileTransaction + */ + function ReactReconcileTransaction(forceHTML) { + this.reinitializeTransaction(); + // Only server-side rendering really needs this option (see + // `ReactServerRendering`), but server-side uses + // `ReactServerRenderingTransaction` instead. This option is here so that it's + // accessible and defaults to false when `ReactDOMComponent` and + // `ReactTextComponent` checks it in `mountComponent`.` + this.renderToStaticMarkup = false; + this.reactMountReady = CallbackQueue.getPooled(null); + this.useCreateElement = !forceHTML && ReactDOMFeatureFlags.useCreateElement; + } + + var Mixin = { + /** + * @see Transaction + * @abstract + * @final + * @return {array<object>} List of operation wrap procedures. + * TODO: convert to array<TransactionWrapper> + */ + getTransactionWrappers: function () { + return TRANSACTION_WRAPPERS; + }, + + /** + * @return {object} The queue to collect `onDOMReady` callbacks with. + */ + getReactMountReady: function () { + return this.reactMountReady; + }, + + /** + * `PooledClass` looks for this, and will invoke this before allowing this + * instance to be reused. + */ + destructor: function () { + CallbackQueue.release(this.reactMountReady); + this.reactMountReady = null; + } + }; + + assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin); + + PooledClass.addPoolingTo(ReactReconcileTransaction); + + module.exports = ReactReconcileTransaction; + +/***/ }, +/* 315 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactInputSelection + */ + + 'use strict'; + + var ReactDOMSelection = __webpack_require__(316); + + var containsNode = __webpack_require__(248); + var focusNode = __webpack_require__(284); + var getActiveElement = __webpack_require__(318); + + function isInDocument(node) { + return containsNode(document.documentElement, node); + } + + /** + * @ReactInputSelection: React input selection module. Based on Selection.js, + * but modified to be suitable for react and has a couple of bug fixes (doesn't + * assume buttons have range selections allowed). + * Input selection module for React. + */ + var ReactInputSelection = { + + hasSelectionCapabilities: function (elem) { + var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); + return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true'); + }, + + getSelectionInformation: function () { + var focusedElem = getActiveElement(); + return { + focusedElem: focusedElem, + selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null + }; + }, + + /** + * @restoreSelection: If any selection information was potentially lost, + * restore it. This is useful when performing operations that could remove dom + * nodes and place them back in, resulting in focus being lost. + */ + restoreSelection: function (priorSelectionInformation) { + var curFocusedElem = getActiveElement(); + var priorFocusedElem = priorSelectionInformation.focusedElem; + var priorSelectionRange = priorSelectionInformation.selectionRange; + if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { + if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) { + ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange); + } + focusNode(priorFocusedElem); + } + }, + + /** + * @getSelection: Gets the selection bounds of a focused textarea, input or + * contentEditable node. + * -@input: Look up selection bounds of this input + * -@return {start: selectionStart, end: selectionEnd} + */ + getSelection: function (input) { + var selection; + + if ('selectionStart' in input) { + // Modern browser with input or textarea. + selection = { + start: input.selectionStart, + end: input.selectionEnd + }; + } else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) { + // IE8 input. + var range = document.selection.createRange(); + // There can only be one selection per document in IE, so it must + // be in our element. + if (range.parentElement() === input) { + selection = { + start: -range.moveStart('character', -input.value.length), + end: -range.moveEnd('character', -input.value.length) + }; + } + } else { + // Content editable or old IE textarea. + selection = ReactDOMSelection.getOffsets(input); + } + + return selection || { start: 0, end: 0 }; + }, + + /** + * @setSelection: Sets the selection bounds of a textarea or input and focuses + * the input. + * -@input Set selection bounds of this input or textarea + * -@offsets Object of same form that is returned from get* + */ + setSelection: function (input, offsets) { + var start = offsets.start; + var end = offsets.end; + if (typeof end === 'undefined') { + end = start; + } + + if ('selectionStart' in input) { + input.selectionStart = start; + input.selectionEnd = Math.min(end, input.value.length); + } else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) { + var range = input.createTextRange(); + range.collapse(true); + range.moveStart('character', start); + range.moveEnd('character', end - start); + range.select(); + } else { + ReactDOMSelection.setOffsets(input, offsets); + } + } + }; + + module.exports = ReactInputSelection; + +/***/ }, +/* 316 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMSelection + */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(198); + + var getNodeForCharacterOffset = __webpack_require__(317); + var getTextContentAccessor = __webpack_require__(264); + + /** + * While `isCollapsed` is available on the Selection object and `collapsed` + * is available on the Range object, IE11 sometimes gets them wrong. + * If the anchor/focus nodes and offsets are the same, the range is collapsed. + */ + function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) { + return anchorNode === focusNode && anchorOffset === focusOffset; + } + + /** + * Get the appropriate anchor and focus node/offset pairs for IE. + * + * The catch here is that IE's selection API doesn't provide information + * about whether the selection is forward or backward, so we have to + * behave as though it's always forward. + * + * IE text differs from modern selection in that it behaves as though + * block elements end with a new line. This means character offsets will + * differ between the two APIs. + * + * @param {DOMElement} node + * @return {object} + */ + function getIEOffsets(node) { + var selection = document.selection; + var selectedRange = selection.createRange(); + var selectedLength = selectedRange.text.length; + + // Duplicate selection so we can move range without breaking user selection. + var fromStart = selectedRange.duplicate(); + fromStart.moveToElementText(node); + fromStart.setEndPoint('EndToStart', selectedRange); + + var startOffset = fromStart.text.length; + var endOffset = startOffset + selectedLength; + + return { + start: startOffset, + end: endOffset + }; + } + + /** + * @param {DOMElement} node + * @return {?object} + */ + function getModernOffsets(node) { + var selection = window.getSelection && window.getSelection(); + + if (!selection || selection.rangeCount === 0) { + return null; + } + + var anchorNode = selection.anchorNode; + var anchorOffset = selection.anchorOffset; + var focusNode = selection.focusNode; + var focusOffset = selection.focusOffset; + + var currentRange = selection.getRangeAt(0); + + // In Firefox, range.startContainer and range.endContainer can be "anonymous + // divs", e.g. the up/down buttons on an <input type="number">. Anonymous + // divs do not seem to expose properties, triggering a "Permission denied + // error" if any of its properties are accessed. The only seemingly possible + // way to avoid erroring is to access a property that typically works for + // non-anonymous divs and catch any error that may otherwise arise. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=208427 + try { + /* eslint-disable no-unused-expressions */ + currentRange.startContainer.nodeType; + currentRange.endContainer.nodeType; + /* eslint-enable no-unused-expressions */ + } catch (e) { + return null; + } + + // If the node and offset values are the same, the selection is collapsed. + // `Selection.isCollapsed` is available natively, but IE sometimes gets + // this value wrong. + var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset); + + var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length; + + var tempRange = currentRange.cloneRange(); + tempRange.selectNodeContents(node); + tempRange.setEnd(currentRange.startContainer, currentRange.startOffset); + + var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset); + + var start = isTempRangeCollapsed ? 0 : tempRange.toString().length; + var end = start + rangeLength; + + // Detect whether the selection is backward. + var detectionRange = document.createRange(); + detectionRange.setStart(anchorNode, anchorOffset); + detectionRange.setEnd(focusNode, focusOffset); + var isBackward = detectionRange.collapsed; + + return { + start: isBackward ? end : start, + end: isBackward ? start : end + }; + } + + /** + * @param {DOMElement|DOMTextNode} node + * @param {object} offsets + */ + function setIEOffsets(node, offsets) { + var range = document.selection.createRange().duplicate(); + var start, end; + + if (typeof offsets.end === 'undefined') { + start = offsets.start; + end = start; + } else if (offsets.start > offsets.end) { + start = offsets.end; + end = offsets.start; + } else { + start = offsets.start; + end = offsets.end; + } + + range.moveToElementText(node); + range.moveStart('character', start); + range.setEndPoint('EndToStart', range); + range.moveEnd('character', end - start); + range.select(); + } + + /** + * In modern non-IE browsers, we can support both forward and backward + * selections. + * + * Note: IE10+ supports the Selection object, but it does not support + * the `extend` method, which means that even in modern IE, it's not possible + * to programatically create a backward selection. Thus, for all IE + * versions, we use the old IE API to create our selections. + * + * @param {DOMElement|DOMTextNode} node + * @param {object} offsets + */ + function setModernOffsets(node, offsets) { + if (!window.getSelection) { + return; + } + + var selection = window.getSelection(); + var length = node[getTextContentAccessor()].length; + var start = Math.min(offsets.start, length); + var end = typeof offsets.end === 'undefined' ? start : Math.min(offsets.end, length); + + // IE 11 uses modern selection, but doesn't support the extend method. + // Flip backward selections, so we can set with a single range. + if (!selection.extend && start > end) { + var temp = end; + end = start; + start = temp; + } + + var startMarker = getNodeForCharacterOffset(node, start); + var endMarker = getNodeForCharacterOffset(node, end); + + if (startMarker && endMarker) { + var range = document.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + + if (start > end) { + selection.addRange(range); + selection.extend(endMarker.node, endMarker.offset); + } else { + range.setEnd(endMarker.node, endMarker.offset); + selection.addRange(range); + } + } + } + + var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window); + + var ReactDOMSelection = { + /** + * @param {DOMElement} node + */ + getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets, + + /** + * @param {DOMElement|DOMTextNode} node + * @param {object} offsets + */ + setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets + }; + + module.exports = ReactDOMSelection; + +/***/ }, +/* 317 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getNodeForCharacterOffset + */ + + 'use strict'; + + /** + * Given any node return the first leaf node without children. + * + * @param {DOMElement|DOMTextNode} node + * @return {DOMElement|DOMTextNode} + */ + function getLeafNode(node) { + while (node && node.firstChild) { + node = node.firstChild; + } + return node; + } + + /** + * Get the next sibling within a container. This will walk up the + * DOM if a node's siblings have been exhausted. + * + * @param {DOMElement|DOMTextNode} node + * @return {?DOMElement|DOMTextNode} + */ + function getSiblingNode(node) { + while (node) { + if (node.nextSibling) { + return node.nextSibling; + } + node = node.parentNode; + } + } + + /** + * Get object describing the nodes which contain characters at offset. + * + * @param {DOMElement|DOMTextNode} root + * @param {number} offset + * @return {?object} + */ + function getNodeForCharacterOffset(root, offset) { + var node = getLeafNode(root); + var nodeStart = 0; + var nodeEnd = 0; + + while (node) { + if (node.nodeType === 3) { + nodeEnd = nodeStart + node.textContent.length; + + if (nodeStart <= offset && nodeEnd >= offset) { + return { + node: node, + offset: offset - nodeStart + }; + } + + nodeStart = nodeEnd; + } + + node = getLeafNode(getSiblingNode(node)); + } + } + + module.exports = getNodeForCharacterOffset; + +/***/ }, +/* 318 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getActiveElement + * @typechecks + */ + + /** + * Same as document.activeElement but wraps in a try-catch block. In IE it is + * not safe to call document.activeElement if there is nothing focused. + * + * The activeElement will be null only if the document body is not yet defined. + */ + "use strict"; + + function getActiveElement() /*?DOMElement*/{ + try { + return document.activeElement || document.body; + } catch (e) { + return document.body; + } + } + + module.exports = getActiveElement; + +/***/ }, +/* 319 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SelectEventPlugin + */ + + 'use strict'; + + var EventConstants = __webpack_require__(219); + var EventPropagators = __webpack_require__(262); + var ExecutionEnvironment = __webpack_require__(198); + var ReactInputSelection = __webpack_require__(315); + var SyntheticEvent = __webpack_require__(266); + + var getActiveElement = __webpack_require__(318); + var isTextInputElement = __webpack_require__(271); + var keyOf = __webpack_require__(268); + var shallowEqual = __webpack_require__(306); + + var topLevelTypes = EventConstants.topLevelTypes; + + var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11; + + var eventTypes = { + select: { + phasedRegistrationNames: { + bubbled: keyOf({ onSelect: null }), + captured: keyOf({ onSelectCapture: null }) + }, + dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange] + } + }; + + var activeElement = null; + var activeElementID = null; + var lastSelection = null; + var mouseDown = false; + + // Track whether a listener exists for this plugin. If none exist, we do + // not extract events. + var hasListener = false; + var ON_SELECT_KEY = keyOf({ onSelect: null }); + + /** + * Get an object which is a unique representation of the current selection. + * + * The return value will not be consistent across nodes or browsers, but + * two identical selections on the same node will return identical objects. + * + * @param {DOMElement} node + * @return {object} + */ + function getSelection(node) { + if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) { + return { + start: node.selectionStart, + end: node.selectionEnd + }; + } else if (window.getSelection) { + var selection = window.getSelection(); + return { + anchorNode: selection.anchorNode, + anchorOffset: selection.anchorOffset, + focusNode: selection.focusNode, + focusOffset: selection.focusOffset + }; + } else if (document.selection) { + var range = document.selection.createRange(); + return { + parentElement: range.parentElement(), + text: range.text, + top: range.boundingTop, + left: range.boundingLeft + }; + } + } + + /** + * Poll selection to see whether it's changed. + * + * @param {object} nativeEvent + * @return {?SyntheticEvent} + */ + function constructSelectEvent(nativeEvent, nativeEventTarget) { + // Ensure we have the right element, and that the user is not dragging a + // selection (this matches native `select` event behavior). In HTML5, select + // fires only on input and textarea thus if there's no focused element we + // won't dispatch. + if (mouseDown || activeElement == null || activeElement !== getActiveElement()) { + return null; + } + + // Only fire when selection has actually changed. + var currentSelection = getSelection(activeElement); + if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { + lastSelection = currentSelection; + + var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementID, nativeEvent, nativeEventTarget); + + syntheticEvent.type = 'select'; + syntheticEvent.target = activeElement; + + EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent); + + return syntheticEvent; + } + + return null; + } + + /** + * This plugin creates an `onSelect` event that normalizes select events + * across form elements. + * + * Supported elements are: + * - input (see `isTextInputElement`) + * - textarea + * - contentEditable + * + * This differs from native browser implementations in the following ways: + * - Fires on contentEditable fields as well as inputs. + * - Fires for collapsed selection. + * - Fires after user input. + */ + var SelectEventPlugin = { + + eventTypes: eventTypes, + + /** + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @see {EventPluginHub.extractEvents} + */ + extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) { + if (!hasListener) { + return null; + } + + switch (topLevelType) { + // Track the input node that has focus. + case topLevelTypes.topFocus: + if (isTextInputElement(topLevelTarget) || topLevelTarget.contentEditable === 'true') { + activeElement = topLevelTarget; + activeElementID = topLevelTargetID; + lastSelection = null; + } + break; + case topLevelTypes.topBlur: + activeElement = null; + activeElementID = null; + lastSelection = null; + break; + + // Don't fire the event while the user is dragging. This matches the + // semantics of the native select event. + case topLevelTypes.topMouseDown: + mouseDown = true; + break; + case topLevelTypes.topContextMenu: + case topLevelTypes.topMouseUp: + mouseDown = false; + return constructSelectEvent(nativeEvent, nativeEventTarget); + + // Chrome and IE fire non-standard event when selection is changed (and + // sometimes when it hasn't). IE's event fires out of order with respect + // to key and input events on deletion, so we discard it. + // + // Firefox doesn't support selectionchange, so check selection status + // after each key entry. The selection changes after keydown and before + // keyup, but we check on keydown as well in the case of holding down a + // key, when multiple keydown events are fired but only one keyup is. + // This is also our approach for IE handling, for the reason above. + case topLevelTypes.topSelectionChange: + if (skipSelectionChangeEvent) { + break; + } + // falls through + case topLevelTypes.topKeyDown: + case topLevelTypes.topKeyUp: + return constructSelectEvent(nativeEvent, nativeEventTarget); + } + + return null; + }, + + didPutListener: function (id, registrationName, listener) { + if (registrationName === ON_SELECT_KEY) { + hasListener = true; + } + } + }; + + module.exports = SelectEventPlugin; + +/***/ }, +/* 320 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ServerReactRootIndex + * @typechecks + */ + + 'use strict'; + + /** + * Size of the reactRoot ID space. We generate random numbers for React root + * IDs and if there's a collision the events and DOM update system will + * get confused. In the future we need a way to generate GUIDs but for + * now this will work on a smaller scale. + */ + var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53); + + var ServerReactRootIndex = { + createReactRootIndex: function () { + return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX); + } + }; + + module.exports = ServerReactRootIndex; + +/***/ }, +/* 321 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SimpleEventPlugin + */ + + 'use strict'; + + var EventConstants = __webpack_require__(219); + var EventListener = __webpack_require__(308); + var EventPropagators = __webpack_require__(262); + var ReactMount = __webpack_require__(217); + var SyntheticClipboardEvent = __webpack_require__(322); + var SyntheticEvent = __webpack_require__(266); + var SyntheticFocusEvent = __webpack_require__(323); + var SyntheticKeyboardEvent = __webpack_require__(324); + var SyntheticMouseEvent = __webpack_require__(275); + var SyntheticDragEvent = __webpack_require__(327); + var SyntheticTouchEvent = __webpack_require__(328); + var SyntheticUIEvent = __webpack_require__(276); + var SyntheticWheelEvent = __webpack_require__(329); + + var emptyFunction = __webpack_require__(204); + var getEventCharCode = __webpack_require__(325); + var invariant = __webpack_require__(202); + var keyOf = __webpack_require__(268); + + var topLevelTypes = EventConstants.topLevelTypes; + + var eventTypes = { + abort: { + phasedRegistrationNames: { + bubbled: keyOf({ onAbort: true }), + captured: keyOf({ onAbortCapture: true }) + } + }, + blur: { + phasedRegistrationNames: { + bubbled: keyOf({ onBlur: true }), + captured: keyOf({ onBlurCapture: true }) + } + }, + canPlay: { + phasedRegistrationNames: { + bubbled: keyOf({ onCanPlay: true }), + captured: keyOf({ onCanPlayCapture: true }) + } + }, + canPlayThrough: { + phasedRegistrationNames: { + bubbled: keyOf({ onCanPlayThrough: true }), + captured: keyOf({ onCanPlayThroughCapture: true }) + } + }, + click: { + phasedRegistrationNames: { + bubbled: keyOf({ onClick: true }), + captured: keyOf({ onClickCapture: true }) + } + }, + contextMenu: { + phasedRegistrationNames: { + bubbled: keyOf({ onContextMenu: true }), + captured: keyOf({ onContextMenuCapture: true }) + } + }, + copy: { + phasedRegistrationNames: { + bubbled: keyOf({ onCopy: true }), + captured: keyOf({ onCopyCapture: true }) + } + }, + cut: { + phasedRegistrationNames: { + bubbled: keyOf({ onCut: true }), + captured: keyOf({ onCutCapture: true }) + } + }, + doubleClick: { + phasedRegistrationNames: { + bubbled: keyOf({ onDoubleClick: true }), + captured: keyOf({ onDoubleClickCapture: true }) + } + }, + drag: { + phasedRegistrationNames: { + bubbled: keyOf({ onDrag: true }), + captured: keyOf({ onDragCapture: true }) + } + }, + dragEnd: { + phasedRegistrationNames: { + bubbled: keyOf({ onDragEnd: true }), + captured: keyOf({ onDragEndCapture: true }) + } + }, + dragEnter: { + phasedRegistrationNames: { + bubbled: keyOf({ onDragEnter: true }), + captured: keyOf({ onDragEnterCapture: true }) + } + }, + dragExit: { + phasedRegistrationNames: { + bubbled: keyOf({ onDragExit: true }), + captured: keyOf({ onDragExitCapture: true }) + } + }, + dragLeave: { + phasedRegistrationNames: { + bubbled: keyOf({ onDragLeave: true }), + captured: keyOf({ onDragLeaveCapture: true }) + } + }, + dragOver: { + phasedRegistrationNames: { + bubbled: keyOf({ onDragOver: true }), + captured: keyOf({ onDragOverCapture: true }) + } + }, + dragStart: { + phasedRegistrationNames: { + bubbled: keyOf({ onDragStart: true }), + captured: keyOf({ onDragStartCapture: true }) + } + }, + drop: { + phasedRegistrationNames: { + bubbled: keyOf({ onDrop: true }), + captured: keyOf({ onDropCapture: true }) + } + }, + durationChange: { + phasedRegistrationNames: { + bubbled: keyOf({ onDurationChange: true }), + captured: keyOf({ onDurationChangeCapture: true }) + } + }, + emptied: { + phasedRegistrationNames: { + bubbled: keyOf({ onEmptied: true }), + captured: keyOf({ onEmptiedCapture: true }) + } + }, + encrypted: { + phasedRegistrationNames: { + bubbled: keyOf({ onEncrypted: true }), + captured: keyOf({ onEncryptedCapture: true }) + } + }, + ended: { + phasedRegistrationNames: { + bubbled: keyOf({ onEnded: true }), + captured: keyOf({ onEndedCapture: true }) + } + }, + error: { + phasedRegistrationNames: { + bubbled: keyOf({ onError: true }), + captured: keyOf({ onErrorCapture: true }) + } + }, + focus: { + phasedRegistrationNames: { + bubbled: keyOf({ onFocus: true }), + captured: keyOf({ onFocusCapture: true }) + } + }, + input: { + phasedRegistrationNames: { + bubbled: keyOf({ onInput: true }), + captured: keyOf({ onInputCapture: true }) + } + }, + keyDown: { + phasedRegistrationNames: { + bubbled: keyOf({ onKeyDown: true }), + captured: keyOf({ onKeyDownCapture: true }) + } + }, + keyPress: { + phasedRegistrationNames: { + bubbled: keyOf({ onKeyPress: true }), + captured: keyOf({ onKeyPressCapture: true }) + } + }, + keyUp: { + phasedRegistrationNames: { + bubbled: keyOf({ onKeyUp: true }), + captured: keyOf({ onKeyUpCapture: true }) + } + }, + load: { + phasedRegistrationNames: { + bubbled: keyOf({ onLoad: true }), + captured: keyOf({ onLoadCapture: true }) + } + }, + loadedData: { + phasedRegistrationNames: { + bubbled: keyOf({ onLoadedData: true }), + captured: keyOf({ onLoadedDataCapture: true }) + } + }, + loadedMetadata: { + phasedRegistrationNames: { + bubbled: keyOf({ onLoadedMetadata: true }), + captured: keyOf({ onLoadedMetadataCapture: true }) + } + }, + loadStart: { + phasedRegistrationNames: { + bubbled: keyOf({ onLoadStart: true }), + captured: keyOf({ onLoadStartCapture: true }) + } + }, + // Note: We do not allow listening to mouseOver events. Instead, use the + // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`. + mouseDown: { + phasedRegistrationNames: { + bubbled: keyOf({ onMouseDown: true }), + captured: keyOf({ onMouseDownCapture: true }) + } + }, + mouseMove: { + phasedRegistrationNames: { + bubbled: keyOf({ onMouseMove: true }), + captured: keyOf({ onMouseMoveCapture: true }) + } + }, + mouseOut: { + phasedRegistrationNames: { + bubbled: keyOf({ onMouseOut: true }), + captured: keyOf({ onMouseOutCapture: true }) + } + }, + mouseOver: { + phasedRegistrationNames: { + bubbled: keyOf({ onMouseOver: true }), + captured: keyOf({ onMouseOverCapture: true }) + } + }, + mouseUp: { + phasedRegistrationNames: { + bubbled: keyOf({ onMouseUp: true }), + captured: keyOf({ onMouseUpCapture: true }) + } + }, + paste: { + phasedRegistrationNames: { + bubbled: keyOf({ onPaste: true }), + captured: keyOf({ onPasteCapture: true }) + } + }, + pause: { + phasedRegistrationNames: { + bubbled: keyOf({ onPause: true }), + captured: keyOf({ onPauseCapture: true }) + } + }, + play: { + phasedRegistrationNames: { + bubbled: keyOf({ onPlay: true }), + captured: keyOf({ onPlayCapture: true }) + } + }, + playing: { + phasedRegistrationNames: { + bubbled: keyOf({ onPlaying: true }), + captured: keyOf({ onPlayingCapture: true }) + } + }, + progress: { + phasedRegistrationNames: { + bubbled: keyOf({ onProgress: true }), + captured: keyOf({ onProgressCapture: true }) + } + }, + rateChange: { + phasedRegistrationNames: { + bubbled: keyOf({ onRateChange: true }), + captured: keyOf({ onRateChangeCapture: true }) + } + }, + reset: { + phasedRegistrationNames: { + bubbled: keyOf({ onReset: true }), + captured: keyOf({ onResetCapture: true }) + } + }, + scroll: { + phasedRegistrationNames: { + bubbled: keyOf({ onScroll: true }), + captured: keyOf({ onScrollCapture: true }) + } + }, + seeked: { + phasedRegistrationNames: { + bubbled: keyOf({ onSeeked: true }), + captured: keyOf({ onSeekedCapture: true }) + } + }, + seeking: { + phasedRegistrationNames: { + bubbled: keyOf({ onSeeking: true }), + captured: keyOf({ onSeekingCapture: true }) + } + }, + stalled: { + phasedRegistrationNames: { + bubbled: keyOf({ onStalled: true }), + captured: keyOf({ onStalledCapture: true }) + } + }, + submit: { + phasedRegistrationNames: { + bubbled: keyOf({ onSubmit: true }), + captured: keyOf({ onSubmitCapture: true }) + } + }, + suspend: { + phasedRegistrationNames: { + bubbled: keyOf({ onSuspend: true }), + captured: keyOf({ onSuspendCapture: true }) + } + }, + timeUpdate: { + phasedRegistrationNames: { + bubbled: keyOf({ onTimeUpdate: true }), + captured: keyOf({ onTimeUpdateCapture: true }) + } + }, + touchCancel: { + phasedRegistrationNames: { + bubbled: keyOf({ onTouchCancel: true }), + captured: keyOf({ onTouchCancelCapture: true }) + } + }, + touchEnd: { + phasedRegistrationNames: { + bubbled: keyOf({ onTouchEnd: true }), + captured: keyOf({ onTouchEndCapture: true }) + } + }, + touchMove: { + phasedRegistrationNames: { + bubbled: keyOf({ onTouchMove: true }), + captured: keyOf({ onTouchMoveCapture: true }) + } + }, + touchStart: { + phasedRegistrationNames: { + bubbled: keyOf({ onTouchStart: true }), + captured: keyOf({ onTouchStartCapture: true }) + } + }, + volumeChange: { + phasedRegistrationNames: { + bubbled: keyOf({ onVolumeChange: true }), + captured: keyOf({ onVolumeChangeCapture: true }) + } + }, + waiting: { + phasedRegistrationNames: { + bubbled: keyOf({ onWaiting: true }), + captured: keyOf({ onWaitingCapture: true }) + } + }, + wheel: { + phasedRegistrationNames: { + bubbled: keyOf({ onWheel: true }), + captured: keyOf({ onWheelCapture: true }) + } + } + }; + + var topLevelEventsToDispatchConfig = { + topAbort: eventTypes.abort, + topBlur: eventTypes.blur, + topCanPlay: eventTypes.canPlay, + topCanPlayThrough: eventTypes.canPlayThrough, + topClick: eventTypes.click, + topContextMenu: eventTypes.contextMenu, + topCopy: eventTypes.copy, + topCut: eventTypes.cut, + topDoubleClick: eventTypes.doubleClick, + topDrag: eventTypes.drag, + topDragEnd: eventTypes.dragEnd, + topDragEnter: eventTypes.dragEnter, + topDragExit: eventTypes.dragExit, + topDragLeave: eventTypes.dragLeave, + topDragOver: eventTypes.dragOver, + topDragStart: eventTypes.dragStart, + topDrop: eventTypes.drop, + topDurationChange: eventTypes.durationChange, + topEmptied: eventTypes.emptied, + topEncrypted: eventTypes.encrypted, + topEnded: eventTypes.ended, + topError: eventTypes.error, + topFocus: eventTypes.focus, + topInput: eventTypes.input, + topKeyDown: eventTypes.keyDown, + topKeyPress: eventTypes.keyPress, + topKeyUp: eventTypes.keyUp, + topLoad: eventTypes.load, + topLoadedData: eventTypes.loadedData, + topLoadedMetadata: eventTypes.loadedMetadata, + topLoadStart: eventTypes.loadStart, + topMouseDown: eventTypes.mouseDown, + topMouseMove: eventTypes.mouseMove, + topMouseOut: eventTypes.mouseOut, + topMouseOver: eventTypes.mouseOver, + topMouseUp: eventTypes.mouseUp, + topPaste: eventTypes.paste, + topPause: eventTypes.pause, + topPlay: eventTypes.play, + topPlaying: eventTypes.playing, + topProgress: eventTypes.progress, + topRateChange: eventTypes.rateChange, + topReset: eventTypes.reset, + topScroll: eventTypes.scroll, + topSeeked: eventTypes.seeked, + topSeeking: eventTypes.seeking, + topStalled: eventTypes.stalled, + topSubmit: eventTypes.submit, + topSuspend: eventTypes.suspend, + topTimeUpdate: eventTypes.timeUpdate, + topTouchCancel: eventTypes.touchCancel, + topTouchEnd: eventTypes.touchEnd, + topTouchMove: eventTypes.touchMove, + topTouchStart: eventTypes.touchStart, + topVolumeChange: eventTypes.volumeChange, + topWaiting: eventTypes.waiting, + topWheel: eventTypes.wheel + }; + + for (var type in topLevelEventsToDispatchConfig) { + topLevelEventsToDispatchConfig[type].dependencies = [type]; + } + + var ON_CLICK_KEY = keyOf({ onClick: null }); + var onClickListeners = {}; + + var SimpleEventPlugin = { + + eventTypes: eventTypes, + + /** + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @see {EventPluginHub.extractEvents} + */ + extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) { + var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType]; + if (!dispatchConfig) { + return null; + } + var EventConstructor; + switch (topLevelType) { + case topLevelTypes.topAbort: + case topLevelTypes.topCanPlay: + case topLevelTypes.topCanPlayThrough: + case topLevelTypes.topDurationChange: + case topLevelTypes.topEmptied: + case topLevelTypes.topEncrypted: + case topLevelTypes.topEnded: + case topLevelTypes.topError: + case topLevelTypes.topInput: + case topLevelTypes.topLoad: + case topLevelTypes.topLoadedData: + case topLevelTypes.topLoadedMetadata: + case topLevelTypes.topLoadStart: + case topLevelTypes.topPause: + case topLevelTypes.topPlay: + case topLevelTypes.topPlaying: + case topLevelTypes.topProgress: + case topLevelTypes.topRateChange: + case topLevelTypes.topReset: + case topLevelTypes.topSeeked: + case topLevelTypes.topSeeking: + case topLevelTypes.topStalled: + case topLevelTypes.topSubmit: + case topLevelTypes.topSuspend: + case topLevelTypes.topTimeUpdate: + case topLevelTypes.topVolumeChange: + case topLevelTypes.topWaiting: + // HTML Events + // @see http://www.w3.org/TR/html5/index.html#events-0 + EventConstructor = SyntheticEvent; + break; + case topLevelTypes.topKeyPress: + // FireFox creates a keypress event for function keys too. This removes + // the unwanted keypress events. Enter is however both printable and + // non-printable. One would expect Tab to be as well (but it isn't). + if (getEventCharCode(nativeEvent) === 0) { + return null; + } + /* falls through */ + case topLevelTypes.topKeyDown: + case topLevelTypes.topKeyUp: + EventConstructor = SyntheticKeyboardEvent; + break; + case topLevelTypes.topBlur: + case topLevelTypes.topFocus: + EventConstructor = SyntheticFocusEvent; + break; + case topLevelTypes.topClick: + // Firefox creates a click event on right mouse clicks. This removes the + // unwanted click events. + if (nativeEvent.button === 2) { + return null; + } + /* falls through */ + case topLevelTypes.topContextMenu: + case topLevelTypes.topDoubleClick: + case topLevelTypes.topMouseDown: + case topLevelTypes.topMouseMove: + case topLevelTypes.topMouseOut: + case topLevelTypes.topMouseOver: + case topLevelTypes.topMouseUp: + EventConstructor = SyntheticMouseEvent; + break; + case topLevelTypes.topDrag: + case topLevelTypes.topDragEnd: + case topLevelTypes.topDragEnter: + case topLevelTypes.topDragExit: + case topLevelTypes.topDragLeave: + case topLevelTypes.topDragOver: + case topLevelTypes.topDragStart: + case topLevelTypes.topDrop: + EventConstructor = SyntheticDragEvent; + break; + case topLevelTypes.topTouchCancel: + case topLevelTypes.topTouchEnd: + case topLevelTypes.topTouchMove: + case topLevelTypes.topTouchStart: + EventConstructor = SyntheticTouchEvent; + break; + case topLevelTypes.topScroll: + EventConstructor = SyntheticUIEvent; + break; + case topLevelTypes.topWheel: + EventConstructor = SyntheticWheelEvent; + break; + case topLevelTypes.topCopy: + case topLevelTypes.topCut: + case topLevelTypes.topPaste: + EventConstructor = SyntheticClipboardEvent; + break; + } + !EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : undefined; + var event = EventConstructor.getPooled(dispatchConfig, topLevelTargetID, nativeEvent, nativeEventTarget); + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; + }, + + didPutListener: function (id, registrationName, listener) { + // Mobile Safari does not fire properly bubble click events on + // non-interactive elements, which means delegated click listeners do not + // fire. The workaround for this bug involves attaching an empty click + // listener on the target node. + if (registrationName === ON_CLICK_KEY) { + var node = ReactMount.getNode(id); + if (!onClickListeners[id]) { + onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction); + } + } + }, + + willDeleteListener: function (id, registrationName) { + if (registrationName === ON_CLICK_KEY) { + onClickListeners[id].remove(); + delete onClickListeners[id]; + } + } + + }; + + module.exports = SimpleEventPlugin; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 322 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticClipboardEvent + * @typechecks static-only + */ + + 'use strict'; + + var SyntheticEvent = __webpack_require__(266); + + /** + * @interface Event + * @see http://www.w3.org/TR/clipboard-apis/ + */ + var ClipboardEventInterface = { + clipboardData: function (event) { + return 'clipboardData' in event ? event.clipboardData : window.clipboardData; + } + }; + + /** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ + function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + + SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); + + module.exports = SyntheticClipboardEvent; + +/***/ }, +/* 323 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticFocusEvent + * @typechecks static-only + */ + + 'use strict'; + + var SyntheticUIEvent = __webpack_require__(276); + + /** + * @interface FocusEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var FocusEventInterface = { + relatedTarget: null + }; + + /** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ + function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + + SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); + + module.exports = SyntheticFocusEvent; + +/***/ }, +/* 324 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticKeyboardEvent + * @typechecks static-only + */ + + 'use strict'; + + var SyntheticUIEvent = __webpack_require__(276); + + var getEventCharCode = __webpack_require__(325); + var getEventKey = __webpack_require__(326); + var getEventModifierState = __webpack_require__(277); + + /** + * @interface KeyboardEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var KeyboardEventInterface = { + key: getEventKey, + location: null, + ctrlKey: null, + shiftKey: null, + altKey: null, + metaKey: null, + repeat: null, + locale: null, + getModifierState: getEventModifierState, + // Legacy Interface + charCode: function (event) { + // `charCode` is the result of a KeyPress event and represents the value of + // the actual printable character. + + // KeyPress is deprecated, but its replacement is not yet final and not + // implemented in any major browser. Only KeyPress has charCode. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + return 0; + }, + keyCode: function (event) { + // `keyCode` is the result of a KeyDown/Up event and represents the value of + // physical keyboard key. + + // The actual meaning of the value depends on the users' keyboard layout + // which cannot be detected. Assuming that it is a US keyboard layout + // provides a surprisingly accurate mapping for US and European users. + // Due to this, it is left to the user to implement at this time. + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + return 0; + }, + which: function (event) { + // `which` is an alias for either `keyCode` or `charCode` depending on the + // type of the event. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + return 0; + } + }; + + /** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ + function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + + SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); + + module.exports = SyntheticKeyboardEvent; + +/***/ }, +/* 325 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getEventCharCode + * @typechecks static-only + */ + + 'use strict'; + + /** + * `charCode` represents the actual "character code" and is safe to use with + * `String.fromCharCode`. As such, only keys that correspond to printable + * characters produce a valid `charCode`, the only exception to this is Enter. + * The Tab-key is considered non-printable and does not have a `charCode`, + * presumably because it does not produce a tab-character in browsers. + * + * @param {object} nativeEvent Native browser event. + * @return {number} Normalized `charCode` property. + */ + function getEventCharCode(nativeEvent) { + var charCode; + var keyCode = nativeEvent.keyCode; + + if ('charCode' in nativeEvent) { + charCode = nativeEvent.charCode; + + // FF does not set `charCode` for the Enter-key, check against `keyCode`. + if (charCode === 0 && keyCode === 13) { + charCode = 13; + } + } else { + // IE8 does not implement `charCode`, but `keyCode` has the correct value. + charCode = keyCode; + } + + // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. + // Must not discard the (non-)printable Enter-key. + if (charCode >= 32 || charCode === 13) { + return charCode; + } + + return 0; + } + + module.exports = getEventCharCode; + +/***/ }, +/* 326 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule getEventKey + * @typechecks static-only + */ + + 'use strict'; + + var getEventCharCode = __webpack_require__(325); + + /** + * Normalization of deprecated HTML5 `key` values + * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names + */ + var normalizeKey = { + 'Esc': 'Escape', + 'Spacebar': ' ', + 'Left': 'ArrowLeft', + 'Up': 'ArrowUp', + 'Right': 'ArrowRight', + 'Down': 'ArrowDown', + 'Del': 'Delete', + 'Win': 'OS', + 'Menu': 'ContextMenu', + 'Apps': 'ContextMenu', + 'Scroll': 'ScrollLock', + 'MozPrintableKey': 'Unidentified' + }; + + /** + * Translation from legacy `keyCode` to HTML5 `key` + * Only special keys supported, all others depend on keyboard layout or browser + * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names + */ + var translateToKey = { + 8: 'Backspace', + 9: 'Tab', + 12: 'Clear', + 13: 'Enter', + 16: 'Shift', + 17: 'Control', + 18: 'Alt', + 19: 'Pause', + 20: 'CapsLock', + 27: 'Escape', + 32: ' ', + 33: 'PageUp', + 34: 'PageDown', + 35: 'End', + 36: 'Home', + 37: 'ArrowLeft', + 38: 'ArrowUp', + 39: 'ArrowRight', + 40: 'ArrowDown', + 45: 'Insert', + 46: 'Delete', + 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6', + 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12', + 144: 'NumLock', + 145: 'ScrollLock', + 224: 'Meta' + }; + + /** + * @param {object} nativeEvent Native browser event. + * @return {string} Normalized `key` property. + */ + function getEventKey(nativeEvent) { + if (nativeEvent.key) { + // Normalize inconsistent values reported by browsers due to + // implementations of a working draft specification. + + // FireFox implements `key` but returns `MozPrintableKey` for all + // printable characters (normalized to `Unidentified`), ignore it. + var key = normalizeKey[nativeEvent.key] || nativeEvent.key; + if (key !== 'Unidentified') { + return key; + } + } + + // Browser does not implement `key`, polyfill as much of it as we can. + if (nativeEvent.type === 'keypress') { + var charCode = getEventCharCode(nativeEvent); + + // The enter-key is technically both printable and non-printable and can + // thus be captured by `keypress`, no other non-printable key should. + return charCode === 13 ? 'Enter' : String.fromCharCode(charCode); + } + if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') { + // While user keyboard layout determines the actual meaning of each + // `keyCode` value, almost all function keys have a universal value. + return translateToKey[nativeEvent.keyCode] || 'Unidentified'; + } + return ''; + } + + module.exports = getEventKey; + +/***/ }, +/* 327 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticDragEvent + * @typechecks static-only + */ + + 'use strict'; + + var SyntheticMouseEvent = __webpack_require__(275); + + /** + * @interface DragEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var DragEventInterface = { + dataTransfer: null + }; + + /** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ + function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + + SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); + + module.exports = SyntheticDragEvent; + +/***/ }, +/* 328 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticTouchEvent + * @typechecks static-only + */ + + 'use strict'; + + var SyntheticUIEvent = __webpack_require__(276); + + var getEventModifierState = __webpack_require__(277); + + /** + * @interface TouchEvent + * @see http://www.w3.org/TR/touch-events/ + */ + var TouchEventInterface = { + touches: null, + targetTouches: null, + changedTouches: null, + altKey: null, + metaKey: null, + ctrlKey: null, + shiftKey: null, + getModifierState: getEventModifierState + }; + + /** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticUIEvent} + */ + function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + + SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); + + module.exports = SyntheticTouchEvent; + +/***/ }, +/* 329 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SyntheticWheelEvent + * @typechecks static-only + */ + + 'use strict'; + + var SyntheticMouseEvent = __webpack_require__(275); + + /** + * @interface WheelEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var WheelEventInterface = { + deltaX: function (event) { + return 'deltaX' in event ? event.deltaX : + // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). + 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; + }, + deltaY: function (event) { + return 'deltaY' in event ? event.deltaY : + // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). + 'wheelDeltaY' in event ? -event.wheelDeltaY : + // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). + 'wheelDelta' in event ? -event.wheelDelta : 0; + }, + deltaZ: null, + + // Browsers without "deltaMode" is reporting in raw wheel delta where one + // notch on the scroll is always +/- 120, roughly equivalent to pixels. + // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or + // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. + deltaMode: null + }; + + /** + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {string} dispatchMarker Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @extends {SyntheticMouseEvent} + */ + function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + + SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); + + module.exports = SyntheticWheelEvent; + +/***/ }, +/* 330 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule SVGDOMPropertyConfig + */ + + 'use strict'; + + var DOMProperty = __webpack_require__(212); + + var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE; + + var NS = { + xlink: 'http://www.w3.org/1999/xlink', + xml: 'http://www.w3.org/XML/1998/namespace' + }; + + var SVGDOMPropertyConfig = { + Properties: { + clipPath: MUST_USE_ATTRIBUTE, + cx: MUST_USE_ATTRIBUTE, + cy: MUST_USE_ATTRIBUTE, + d: MUST_USE_ATTRIBUTE, + dx: MUST_USE_ATTRIBUTE, + dy: MUST_USE_ATTRIBUTE, + fill: MUST_USE_ATTRIBUTE, + fillOpacity: MUST_USE_ATTRIBUTE, + fontFamily: MUST_USE_ATTRIBUTE, + fontSize: MUST_USE_ATTRIBUTE, + fx: MUST_USE_ATTRIBUTE, + fy: MUST_USE_ATTRIBUTE, + gradientTransform: MUST_USE_ATTRIBUTE, + gradientUnits: MUST_USE_ATTRIBUTE, + markerEnd: MUST_USE_ATTRIBUTE, + markerMid: MUST_USE_ATTRIBUTE, + markerStart: MUST_USE_ATTRIBUTE, + offset: MUST_USE_ATTRIBUTE, + opacity: MUST_USE_ATTRIBUTE, + patternContentUnits: MUST_USE_ATTRIBUTE, + patternUnits: MUST_USE_ATTRIBUTE, + points: MUST_USE_ATTRIBUTE, + preserveAspectRatio: MUST_USE_ATTRIBUTE, + r: MUST_USE_ATTRIBUTE, + rx: MUST_USE_ATTRIBUTE, + ry: MUST_USE_ATTRIBUTE, + spreadMethod: MUST_USE_ATTRIBUTE, + stopColor: MUST_USE_ATTRIBUTE, + stopOpacity: MUST_USE_ATTRIBUTE, + stroke: MUST_USE_ATTRIBUTE, + strokeDasharray: MUST_USE_ATTRIBUTE, + strokeLinecap: MUST_USE_ATTRIBUTE, + strokeOpacity: MUST_USE_ATTRIBUTE, + strokeWidth: MUST_USE_ATTRIBUTE, + textAnchor: MUST_USE_ATTRIBUTE, + transform: MUST_USE_ATTRIBUTE, + version: MUST_USE_ATTRIBUTE, + viewBox: MUST_USE_ATTRIBUTE, + x1: MUST_USE_ATTRIBUTE, + x2: MUST_USE_ATTRIBUTE, + x: MUST_USE_ATTRIBUTE, + xlinkActuate: MUST_USE_ATTRIBUTE, + xlinkArcrole: MUST_USE_ATTRIBUTE, + xlinkHref: MUST_USE_ATTRIBUTE, + xlinkRole: MUST_USE_ATTRIBUTE, + xlinkShow: MUST_USE_ATTRIBUTE, + xlinkTitle: MUST_USE_ATTRIBUTE, + xlinkType: MUST_USE_ATTRIBUTE, + xmlBase: MUST_USE_ATTRIBUTE, + xmlLang: MUST_USE_ATTRIBUTE, + xmlSpace: MUST_USE_ATTRIBUTE, + y1: MUST_USE_ATTRIBUTE, + y2: MUST_USE_ATTRIBUTE, + y: MUST_USE_ATTRIBUTE + }, + DOMAttributeNamespaces: { + xlinkActuate: NS.xlink, + xlinkArcrole: NS.xlink, + xlinkHref: NS.xlink, + xlinkRole: NS.xlink, + xlinkShow: NS.xlink, + xlinkTitle: NS.xlink, + xlinkType: NS.xlink, + xmlBase: NS.xml, + xmlLang: NS.xml, + xmlSpace: NS.xml + }, + DOMAttributeNames: { + clipPath: 'clip-path', + fillOpacity: 'fill-opacity', + fontFamily: 'font-family', + fontSize: 'font-size', + gradientTransform: 'gradientTransform', + gradientUnits: 'gradientUnits', + markerEnd: 'marker-end', + markerMid: 'marker-mid', + markerStart: 'marker-start', + patternContentUnits: 'patternContentUnits', + patternUnits: 'patternUnits', + preserveAspectRatio: 'preserveAspectRatio', + spreadMethod: 'spreadMethod', + stopColor: 'stop-color', + stopOpacity: 'stop-opacity', + strokeDasharray: 'stroke-dasharray', + strokeLinecap: 'stroke-linecap', + strokeOpacity: 'stroke-opacity', + strokeWidth: 'stroke-width', + textAnchor: 'text-anchor', + viewBox: 'viewBox', + xlinkActuate: 'xlink:actuate', + xlinkArcrole: 'xlink:arcrole', + xlinkHref: 'xlink:href', + xlinkRole: 'xlink:role', + xlinkShow: 'xlink:show', + xlinkTitle: 'xlink:title', + xlinkType: 'xlink:type', + xmlBase: 'xml:base', + xmlLang: 'xml:lang', + xmlSpace: 'xml:space' + } + }; + + module.exports = SVGDOMPropertyConfig; + +/***/ }, +/* 331 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDefaultPerf + * @typechecks static-only + */ + + 'use strict'; + + var DOMProperty = __webpack_require__(212); + var ReactDefaultPerfAnalysis = __webpack_require__(332); + var ReactMount = __webpack_require__(217); + var ReactPerf = __webpack_require__(207); + + var performanceNow = __webpack_require__(333); + + function roundFloat(val) { + return Math.floor(val * 100) / 100; + } + + function addValue(obj, key, val) { + obj[key] = (obj[key] || 0) + val; + } + + var ReactDefaultPerf = { + _allMeasurements: [], // last item in the list is the current one + _mountStack: [0], + _injected: false, + + start: function () { + if (!ReactDefaultPerf._injected) { + ReactPerf.injection.injectMeasure(ReactDefaultPerf.measure); + } + + ReactDefaultPerf._allMeasurements.length = 0; + ReactPerf.enableMeasure = true; + }, + + stop: function () { + ReactPerf.enableMeasure = false; + }, + + getLastMeasurements: function () { + return ReactDefaultPerf._allMeasurements; + }, + + printExclusive: function (measurements) { + measurements = measurements || ReactDefaultPerf._allMeasurements; + var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measurements); + console.table(summary.map(function (item) { + return { + 'Component class name': item.componentName, + 'Total inclusive time (ms)': roundFloat(item.inclusive), + 'Exclusive mount time (ms)': roundFloat(item.exclusive), + 'Exclusive render time (ms)': roundFloat(item.render), + 'Mount time per instance (ms)': roundFloat(item.exclusive / item.count), + 'Render time per instance (ms)': roundFloat(item.render / item.count), + 'Instances': item.count + }; + })); + // TODO: ReactDefaultPerfAnalysis.getTotalTime() does not return the correct + // number. + }, + + printInclusive: function (measurements) { + measurements = measurements || ReactDefaultPerf._allMeasurements; + var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements); + console.table(summary.map(function (item) { + return { + 'Owner > component': item.componentName, + 'Inclusive time (ms)': roundFloat(item.time), + 'Instances': item.count + }; + })); + console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'); + }, + + getMeasurementsSummaryMap: function (measurements) { + var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements, true); + return summary.map(function (item) { + return { + 'Owner > component': item.componentName, + 'Wasted time (ms)': item.time, + 'Instances': item.count + }; + }); + }, + + printWasted: function (measurements) { + measurements = measurements || ReactDefaultPerf._allMeasurements; + console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements)); + console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'); + }, + + printDOM: function (measurements) { + measurements = measurements || ReactDefaultPerf._allMeasurements; + var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements); + console.table(summary.map(function (item) { + var result = {}; + result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id; + result.type = item.type; + result.args = JSON.stringify(item.args); + return result; + })); + console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'); + }, + + _recordWrite: function (id, fnName, totalTime, args) { + // TODO: totalTime isn't that useful since it doesn't count paints/reflows + var writes = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].writes; + writes[id] = writes[id] || []; + writes[id].push({ + type: fnName, + time: totalTime, + args: args + }); + }, + + measure: function (moduleName, fnName, func) { + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var totalTime; + var rv; + var start; + + if (fnName === '_renderNewRootComponent' || fnName === 'flushBatchedUpdates') { + // A "measurement" is a set of metrics recorded for each flush. We want + // to group the metrics for a given flush together so we can look at the + // components that rendered and the DOM operations that actually + // happened to determine the amount of "wasted work" performed. + ReactDefaultPerf._allMeasurements.push({ + exclusive: {}, + inclusive: {}, + render: {}, + counts: {}, + writes: {}, + displayNames: {}, + totalTime: 0, + created: {} + }); + start = performanceNow(); + rv = func.apply(this, args); + ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].totalTime = performanceNow() - start; + return rv; + } else if (fnName === '_mountImageIntoNode' || moduleName === 'ReactBrowserEventEmitter' || moduleName === 'ReactDOMIDOperations' || moduleName === 'CSSPropertyOperations' || moduleName === 'DOMChildrenOperations' || moduleName === 'DOMPropertyOperations') { + start = performanceNow(); + rv = func.apply(this, args); + totalTime = performanceNow() - start; + + if (fnName === '_mountImageIntoNode') { + var mountID = ReactMount.getID(args[1]); + ReactDefaultPerf._recordWrite(mountID, fnName, totalTime, args[0]); + } else if (fnName === 'dangerouslyProcessChildrenUpdates') { + // special format + args[0].forEach(function (update) { + var writeArgs = {}; + if (update.fromIndex !== null) { + writeArgs.fromIndex = update.fromIndex; + } + if (update.toIndex !== null) { + writeArgs.toIndex = update.toIndex; + } + if (update.textContent !== null) { + writeArgs.textContent = update.textContent; + } + if (update.markupIndex !== null) { + writeArgs.markup = args[1][update.markupIndex]; + } + ReactDefaultPerf._recordWrite(update.parentID, update.type, totalTime, writeArgs); + }); + } else { + // basic format + var id = args[0]; + if (typeof id === 'object') { + id = ReactMount.getID(args[0]); + } + ReactDefaultPerf._recordWrite(id, fnName, totalTime, Array.prototype.slice.call(args, 1)); + } + return rv; + } else if (moduleName === 'ReactCompositeComponent' && (fnName === 'mountComponent' || fnName === 'updateComponent' || // TODO: receiveComponent()? + fnName === '_renderValidatedComponent')) { + + if (this._currentElement.type === ReactMount.TopLevelWrapper) { + return func.apply(this, args); + } + + var rootNodeID = fnName === 'mountComponent' ? args[0] : this._rootNodeID; + var isRender = fnName === '_renderValidatedComponent'; + var isMount = fnName === 'mountComponent'; + + var mountStack = ReactDefaultPerf._mountStack; + var entry = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1]; + + if (isRender) { + addValue(entry.counts, rootNodeID, 1); + } else if (isMount) { + entry.created[rootNodeID] = true; + mountStack.push(0); + } + + start = performanceNow(); + rv = func.apply(this, args); + totalTime = performanceNow() - start; + + if (isRender) { + addValue(entry.render, rootNodeID, totalTime); + } else if (isMount) { + var subMountTime = mountStack.pop(); + mountStack[mountStack.length - 1] += totalTime; + addValue(entry.exclusive, rootNodeID, totalTime - subMountTime); + addValue(entry.inclusive, rootNodeID, totalTime); + } else { + addValue(entry.inclusive, rootNodeID, totalTime); + } + + entry.displayNames[rootNodeID] = { + current: this.getName(), + owner: this._currentElement._owner ? this._currentElement._owner.getName() : '<root>' + }; + + return rv; + } else { + return func.apply(this, args); + } + }; + } + }; + + module.exports = ReactDefaultPerf; + +/***/ }, +/* 332 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDefaultPerfAnalysis + */ + + 'use strict'; + + var assign = __webpack_require__(228); + + // Don't try to save users less than 1.2ms (a number I made up) + var DONT_CARE_THRESHOLD = 1.2; + var DOM_OPERATION_TYPES = { + '_mountImageIntoNode': 'set innerHTML', + INSERT_MARKUP: 'set innerHTML', + MOVE_EXISTING: 'move', + REMOVE_NODE: 'remove', + SET_MARKUP: 'set innerHTML', + TEXT_CONTENT: 'set textContent', + 'setValueForProperty': 'update attribute', + 'setValueForAttribute': 'update attribute', + 'deleteValueForProperty': 'remove attribute', + 'setValueForStyles': 'update styles', + 'replaceNodeWithMarkup': 'replace', + 'updateTextContent': 'set textContent' + }; + + function getTotalTime(measurements) { + // TODO: return number of DOM ops? could be misleading. + // TODO: measure dropped frames after reconcile? + // TODO: log total time of each reconcile and the top-level component + // class that triggered it. + var totalTime = 0; + for (var i = 0; i < measurements.length; i++) { + var measurement = measurements[i]; + totalTime += measurement.totalTime; + } + return totalTime; + } + + function getDOMSummary(measurements) { + var items = []; + measurements.forEach(function (measurement) { + Object.keys(measurement.writes).forEach(function (id) { + measurement.writes[id].forEach(function (write) { + items.push({ + id: id, + type: DOM_OPERATION_TYPES[write.type] || write.type, + args: write.args + }); + }); + }); + }); + return items; + } + + function getExclusiveSummary(measurements) { + var candidates = {}; + var displayName; + + for (var i = 0; i < measurements.length; i++) { + var measurement = measurements[i]; + var allIDs = assign({}, measurement.exclusive, measurement.inclusive); + + for (var id in allIDs) { + displayName = measurement.displayNames[id].current; + + candidates[displayName] = candidates[displayName] || { + componentName: displayName, + inclusive: 0, + exclusive: 0, + render: 0, + count: 0 + }; + if (measurement.render[id]) { + candidates[displayName].render += measurement.render[id]; + } + if (measurement.exclusive[id]) { + candidates[displayName].exclusive += measurement.exclusive[id]; + } + if (measurement.inclusive[id]) { + candidates[displayName].inclusive += measurement.inclusive[id]; + } + if (measurement.counts[id]) { + candidates[displayName].count += measurement.counts[id]; + } + } + } + + // Now make a sorted array with the results. + var arr = []; + for (displayName in candidates) { + if (candidates[displayName].exclusive >= DONT_CARE_THRESHOLD) { + arr.push(candidates[displayName]); + } + } + + arr.sort(function (a, b) { + return b.exclusive - a.exclusive; + }); + + return arr; + } + + function getInclusiveSummary(measurements, onlyClean) { + var candidates = {}; + var inclusiveKey; + + for (var i = 0; i < measurements.length; i++) { + var measurement = measurements[i]; + var allIDs = assign({}, measurement.exclusive, measurement.inclusive); + var cleanComponents; + + if (onlyClean) { + cleanComponents = getUnchangedComponents(measurement); + } + + for (var id in allIDs) { + if (onlyClean && !cleanComponents[id]) { + continue; + } + + var displayName = measurement.displayNames[id]; + + // Inclusive time is not useful for many components without knowing where + // they are instantiated. So we aggregate inclusive time with both the + // owner and current displayName as the key. + inclusiveKey = displayName.owner + ' > ' + displayName.current; + + candidates[inclusiveKey] = candidates[inclusiveKey] || { + componentName: inclusiveKey, + time: 0, + count: 0 + }; + + if (measurement.inclusive[id]) { + candidates[inclusiveKey].time += measurement.inclusive[id]; + } + if (measurement.counts[id]) { + candidates[inclusiveKey].count += measurement.counts[id]; + } + } + } + + // Now make a sorted array with the results. + var arr = []; + for (inclusiveKey in candidates) { + if (candidates[inclusiveKey].time >= DONT_CARE_THRESHOLD) { + arr.push(candidates[inclusiveKey]); + } + } + + arr.sort(function (a, b) { + return b.time - a.time; + }); + + return arr; + } + + function getUnchangedComponents(measurement) { + // For a given reconcile, look at which components did not actually + // render anything to the DOM and return a mapping of their ID to + // the amount of time it took to render the entire subtree. + var cleanComponents = {}; + var dirtyLeafIDs = Object.keys(measurement.writes); + var allIDs = assign({}, measurement.exclusive, measurement.inclusive); + + for (var id in allIDs) { + var isDirty = false; + // For each component that rendered, see if a component that triggered + // a DOM op is in its subtree. + for (var i = 0; i < dirtyLeafIDs.length; i++) { + if (dirtyLeafIDs[i].indexOf(id) === 0) { + isDirty = true; + break; + } + } + // check if component newly created + if (measurement.created[id]) { + isDirty = true; + } + if (!isDirty && measurement.counts[id] > 0) { + cleanComponents[id] = true; + } + } + return cleanComponents; + } + + var ReactDefaultPerfAnalysis = { + getExclusiveSummary: getExclusiveSummary, + getInclusiveSummary: getInclusiveSummary, + getDOMSummary: getDOMSummary, + getTotalTime: getTotalTime + }; + + module.exports = ReactDefaultPerfAnalysis; + +/***/ }, +/* 333 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule performanceNow + * @typechecks + */ + + 'use strict'; + + var performance = __webpack_require__(334); + + var performanceNow; + + /** + * Detect if we can use `window.performance.now()` and gracefully fallback to + * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now + * because of Facebook's testing infrastructure. + */ + if (performance.now) { + performanceNow = function () { + return performance.now(); + }; + } else { + performanceNow = function () { + return Date.now(); + }; + } + + module.exports = performanceNow; + +/***/ }, +/* 334 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule performance + * @typechecks + */ + + 'use strict'; + + var ExecutionEnvironment = __webpack_require__(198); + + var performance; + + if (ExecutionEnvironment.canUseDOM) { + performance = window.performance || window.msPerformance || window.webkitPerformance; + } + + module.exports = performance || {}; + +/***/ }, +/* 335 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactVersion + */ + + 'use strict'; + + module.exports = '0.14.5'; + +/***/ }, +/* 336 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule renderSubtreeIntoContainer + */ + + 'use strict'; + + var ReactMount = __webpack_require__(217); + + module.exports = ReactMount.renderSubtreeIntoContainer; + +/***/ }, +/* 337 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMServer + */ + + 'use strict'; + + var ReactDefaultInjection = __webpack_require__(260); + var ReactServerRendering = __webpack_require__(338); + var ReactVersion = __webpack_require__(335); + + ReactDefaultInjection.inject(); + + var ReactDOMServer = { + renderToString: ReactServerRendering.renderToString, + renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup, + version: ReactVersion + }; + + module.exports = ReactDOMServer; + +/***/ }, +/* 338 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @typechecks static-only + * @providesModule ReactServerRendering + */ + 'use strict'; + + var ReactDefaultBatchingStrategy = __webpack_require__(281); + var ReactElement = __webpack_require__(231); + var ReactInstanceHandles = __webpack_require__(234); + var ReactMarkupChecksum = __webpack_require__(237); + var ReactServerBatchingStrategy = __webpack_require__(339); + var ReactServerRenderingTransaction = __webpack_require__(340); + var ReactUpdates = __webpack_require__(243); + + var emptyObject = __webpack_require__(247); + var instantiateReactComponent = __webpack_require__(251); + var invariant = __webpack_require__(202); + + /** + * @param {ReactElement} element + * @return {string} the HTML markup + */ + function renderToString(element) { + !ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : undefined; + + var transaction; + try { + ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy); + + var id = ReactInstanceHandles.createReactRootID(); + transaction = ReactServerRenderingTransaction.getPooled(false); + + return transaction.perform(function () { + var componentInstance = instantiateReactComponent(element, null); + var markup = componentInstance.mountComponent(id, transaction, emptyObject); + return ReactMarkupChecksum.addChecksumToMarkup(markup); + }, null); + } finally { + ReactServerRenderingTransaction.release(transaction); + // Revert to the DOM batching strategy since these two renderers + // currently share these stateful modules. + ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy); + } + } + + /** + * @param {ReactElement} element + * @return {string} the HTML markup, without the extra React ID and checksum + * (for generating static pages) + */ + function renderToStaticMarkup(element) { + !ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : undefined; + + var transaction; + try { + ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy); + + var id = ReactInstanceHandles.createReactRootID(); + transaction = ReactServerRenderingTransaction.getPooled(true); + + return transaction.perform(function () { + var componentInstance = instantiateReactComponent(element, null); + return componentInstance.mountComponent(id, transaction, emptyObject); + }, null); + } finally { + ReactServerRenderingTransaction.release(transaction); + // Revert to the DOM batching strategy since these two renderers + // currently share these stateful modules. + ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy); + } + } + + module.exports = { + renderToString: renderToString, + renderToStaticMarkup: renderToStaticMarkup + }; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 339 */ +/***/ function(module, exports) { + + /** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactServerBatchingStrategy + * @typechecks + */ + + 'use strict'; + + var ReactServerBatchingStrategy = { + isBatchingUpdates: false, + batchedUpdates: function (callback) { + // Don't do anything here. During the server rendering we don't want to + // schedule any updates. We will simply ignore them. + } + }; + + module.exports = ReactServerBatchingStrategy; + +/***/ }, +/* 340 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactServerRenderingTransaction + * @typechecks + */ + + 'use strict'; + + var PooledClass = __webpack_require__(245); + var CallbackQueue = __webpack_require__(244); + var Transaction = __webpack_require__(246); + + var assign = __webpack_require__(228); + var emptyFunction = __webpack_require__(204); + + /** + * Provides a `CallbackQueue` queue for collecting `onDOMReady` callbacks + * during the performing of the transaction. + */ + var ON_DOM_READY_QUEUEING = { + /** + * Initializes the internal `onDOMReady` queue. + */ + initialize: function () { + this.reactMountReady.reset(); + }, + + close: emptyFunction + }; + + /** + * Executed within the scope of the `Transaction` instance. Consider these as + * being member methods, but with an implied ordering while being isolated from + * each other. + */ + var TRANSACTION_WRAPPERS = [ON_DOM_READY_QUEUEING]; + + /** + * @class ReactServerRenderingTransaction + * @param {boolean} renderToStaticMarkup + */ + function ReactServerRenderingTransaction(renderToStaticMarkup) { + this.reinitializeTransaction(); + this.renderToStaticMarkup = renderToStaticMarkup; + this.reactMountReady = CallbackQueue.getPooled(null); + this.useCreateElement = false; + } + + var Mixin = { + /** + * @see Transaction + * @abstract + * @final + * @return {array} Empty list of operation wrap procedures. + */ + getTransactionWrappers: function () { + return TRANSACTION_WRAPPERS; + }, + + /** + * @return {object} The queue to collect `onDOMReady` callbacks with. + */ + getReactMountReady: function () { + return this.reactMountReady; + }, + + /** + * `PooledClass` looks for this, and will invoke this before allowing this + * instance to be reused. + */ + destructor: function () { + CallbackQueue.release(this.reactMountReady); + this.reactMountReady = null; + } + }; + + assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin); + + PooledClass.addPoolingTo(ReactServerRenderingTransaction); + + module.exports = ReactServerRenderingTransaction; + +/***/ }, +/* 341 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactIsomorphic + */ + + 'use strict'; + + var ReactChildren = __webpack_require__(299); + var ReactComponent = __webpack_require__(312); + var ReactClass = __webpack_require__(311); + var ReactDOMFactories = __webpack_require__(342); + var ReactElement = __webpack_require__(231); + var ReactElementValidator = __webpack_require__(343); + var ReactPropTypes = __webpack_require__(296); + var ReactVersion = __webpack_require__(335); + + var assign = __webpack_require__(228); + var onlyChild = __webpack_require__(345); + + var createElement = ReactElement.createElement; + var createFactory = ReactElement.createFactory; + var cloneElement = ReactElement.cloneElement; + + if (process.env.NODE_ENV !== 'production') { + createElement = ReactElementValidator.createElement; + createFactory = ReactElementValidator.createFactory; + cloneElement = ReactElementValidator.cloneElement; + } + + var React = { + + // Modern + + Children: { + map: ReactChildren.map, + forEach: ReactChildren.forEach, + count: ReactChildren.count, + toArray: ReactChildren.toArray, + only: onlyChild + }, + + Component: ReactComponent, + + createElement: createElement, + cloneElement: cloneElement, + isValidElement: ReactElement.isValidElement, + + // Classic + + PropTypes: ReactPropTypes, + createClass: ReactClass.createClass, + createFactory: createFactory, + createMixin: function (mixin) { + // Currently a noop. Will be used to validate and trace mixins. + return mixin; + }, + + // This looks DOM specific but these are actually isomorphic helpers + // since they are just generating DOM strings. + DOM: ReactDOMFactories, + + version: ReactVersion, + + // Hook for JSX spread, don't use this for anything else. + __spread: assign + }; + + module.exports = React; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 342 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMFactories + * @typechecks static-only + */ + + 'use strict'; + + var ReactElement = __webpack_require__(231); + var ReactElementValidator = __webpack_require__(343); + + var mapObject = __webpack_require__(344); + + /** + * Create a factory that creates HTML tag elements. + * + * @param {string} tag Tag name (e.g. `div`). + * @private + */ + function createDOMFactory(tag) { + if (process.env.NODE_ENV !== 'production') { + return ReactElementValidator.createFactory(tag); + } + return ReactElement.createFactory(tag); + } + + /** + * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. + * This is also accessible via `React.DOM`. + * + * @public + */ + var ReactDOMFactories = mapObject({ + a: 'a', + abbr: 'abbr', + address: 'address', + area: 'area', + article: 'article', + aside: 'aside', + audio: 'audio', + b: 'b', + base: 'base', + bdi: 'bdi', + bdo: 'bdo', + big: 'big', + blockquote: 'blockquote', + body: 'body', + br: 'br', + button: 'button', + canvas: 'canvas', + caption: 'caption', + cite: 'cite', + code: 'code', + col: 'col', + colgroup: 'colgroup', + data: 'data', + datalist: 'datalist', + dd: 'dd', + del: 'del', + details: 'details', + dfn: 'dfn', + dialog: 'dialog', + div: 'div', + dl: 'dl', + dt: 'dt', + em: 'em', + embed: 'embed', + fieldset: 'fieldset', + figcaption: 'figcaption', + figure: 'figure', + footer: 'footer', + form: 'form', + h1: 'h1', + h2: 'h2', + h3: 'h3', + h4: 'h4', + h5: 'h5', + h6: 'h6', + head: 'head', + header: 'header', + hgroup: 'hgroup', + hr: 'hr', + html: 'html', + i: 'i', + iframe: 'iframe', + img: 'img', + input: 'input', + ins: 'ins', + kbd: 'kbd', + keygen: 'keygen', + label: 'label', + legend: 'legend', + li: 'li', + link: 'link', + main: 'main', + map: 'map', + mark: 'mark', + menu: 'menu', + menuitem: 'menuitem', + meta: 'meta', + meter: 'meter', + nav: 'nav', + noscript: 'noscript', + object: 'object', + ol: 'ol', + optgroup: 'optgroup', + option: 'option', + output: 'output', + p: 'p', + param: 'param', + picture: 'picture', + pre: 'pre', + progress: 'progress', + q: 'q', + rp: 'rp', + rt: 'rt', + ruby: 'ruby', + s: 's', + samp: 'samp', + script: 'script', + section: 'section', + select: 'select', + small: 'small', + source: 'source', + span: 'span', + strong: 'strong', + style: 'style', + sub: 'sub', + summary: 'summary', + sup: 'sup', + table: 'table', + tbody: 'tbody', + td: 'td', + textarea: 'textarea', + tfoot: 'tfoot', + th: 'th', + thead: 'thead', + time: 'time', + title: 'title', + tr: 'tr', + track: 'track', + u: 'u', + ul: 'ul', + 'var': 'var', + video: 'video', + wbr: 'wbr', + + // SVG + circle: 'circle', + clipPath: 'clipPath', + defs: 'defs', + ellipse: 'ellipse', + g: 'g', + image: 'image', + line: 'line', + linearGradient: 'linearGradient', + mask: 'mask', + path: 'path', + pattern: 'pattern', + polygon: 'polygon', + polyline: 'polyline', + radialGradient: 'radialGradient', + rect: 'rect', + stop: 'stop', + svg: 'svg', + text: 'text', + tspan: 'tspan' + + }, createDOMFactory); + + module.exports = ReactDOMFactories; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 343 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactElementValidator + */ + + /** + * ReactElementValidator provides a wrapper around a element factory + * which validates the props passed to the element. This is intended to be + * used only in DEV and could be replaced by a static type checker for languages + * that support it. + */ + + 'use strict'; + + var ReactElement = __webpack_require__(231); + var ReactPropTypeLocations = __webpack_require__(254); + var ReactPropTypeLocationNames = __webpack_require__(255); + var ReactCurrentOwner = __webpack_require__(194); + + var canDefineProperty = __webpack_require__(232); + var getIteratorFn = __webpack_require__(297); + var invariant = __webpack_require__(202); + var warning = __webpack_require__(214); + + function getDeclarationErrorAddendum() { + if (ReactCurrentOwner.current) { + var name = ReactCurrentOwner.current.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; + } + + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + var ownerHasKeyUseWarning = {}; + + var loggedTypeFailures = {}; + + /** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + function validateExplicitKey(element, parentType) { + if (!element._store || element._store.validated || element.key != null) { + return; + } + element._store.validated = true; + + var addenda = getAddendaForKeyUse('uniqueKey', element, parentType); + if (addenda === null) { + // we already showed the warning + return; + } + process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : undefined; + } + + /** + * Shared warning and monitoring code for the key warnings. + * + * @internal + * @param {string} messageType A key used for de-duping warnings. + * @param {ReactElement} element Component that requires a key. + * @param {*} parentType element's parent's type. + * @returns {?object} A set of addenda to use in the warning message, or null + * if the warning has already been shown before (and shouldn't be shown again). + */ + function getAddendaForKeyUse(messageType, element, parentType) { + var addendum = getDeclarationErrorAddendum(); + if (!addendum) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + if (parentName) { + addendum = ' Check the top-level render call using <' + parentName + '>.'; + } + } + + var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {}); + if (memoizer[addendum]) { + return null; + } + memoizer[addendum] = true; + + var addenda = { + parentOrOwner: addendum, + url: ' See https://fb.me/react-warning-keys for more information.', + childOwner: null + }; + + // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { + // Give the component that originally created this child. + addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.'; + } + + return addenda; + } + + /** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + function validateChildKeys(node, parentType) { + if (typeof node !== 'object') { + return; + } + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + if (ReactElement.isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (ReactElement.isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + // Entry iterators provide implicit keys. + if (iteratorFn) { + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + while (!(step = iterator.next()).done) { + if (ReactElement.isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } + + /** + * Assert that the props are valid + * + * @param {string} componentName Name of the component for error messages. + * @param {object} propTypes Map of prop name to a ReactPropType + * @param {object} props + * @param {string} location e.g. "prop", "context", "child context" + * @private + */ + function checkPropTypes(componentName, propTypes, props, location) { + for (var propName in propTypes) { + if (propTypes.hasOwnProperty(propName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + !(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined; + error = propTypes[propName](props, propName, componentName, location); + } catch (ex) { + error = ex; + } + process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : undefined; + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var addendum = getDeclarationErrorAddendum(); + process.env.NODE_ENV !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : undefined; + } + } + } + } + + /** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + function validatePropTypes(element) { + var componentClass = element.type; + if (typeof componentClass !== 'function') { + return; + } + var name = componentClass.displayName || componentClass.name; + if (componentClass.propTypes) { + checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop); + } + if (typeof componentClass.getDefaultProps === 'function') { + process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : undefined; + } + } + + var ReactElementValidator = { + + createElement: function (type, props, children) { + var validType = typeof type === 'string' || typeof type === 'function'; + // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + process.env.NODE_ENV !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : undefined; + + var element = ReactElement.createElement.apply(this, arguments); + + // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + if (element == null) { + return element; + } + + // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + if (validType) { + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } + } + + validatePropTypes(element); + + return element; + }, + + createFactory: function (type) { + var validatedFactory = ReactElementValidator.createElement.bind(null, type); + // Legacy hook TODO: Warn if this is accessed + validatedFactory.type = type; + + if (process.env.NODE_ENV !== 'production') { + if (canDefineProperty) { + Object.defineProperty(validatedFactory, 'type', { + enumerable: false, + get: function () { + process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : undefined; + Object.defineProperty(this, 'type', { + value: type + }); + return type; + } + }); + } + } + + return validatedFactory; + }, + + cloneElement: function (element, props, children) { + var newElement = ReactElement.cloneElement.apply(this, arguments); + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], newElement.type); + } + validatePropTypes(newElement); + return newElement; + } + + }; + + module.exports = ReactElementValidator; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 344 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule mapObject + */ + + 'use strict'; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + /** + * Executes the provided `callback` once for each enumerable own property in the + * object and constructs a new object from the results. The `callback` is + * invoked with three arguments: + * + * - the property value + * - the property name + * - the object being traversed + * + * Properties that are added after the call to `mapObject` will not be visited + * by `callback`. If the values of existing properties are changed, the value + * passed to `callback` will be the value at the time `mapObject` visits them. + * Properties that are deleted before being visited are not visited. + * + * @grep function objectMap() + * @grep function objMap() + * + * @param {?object} object + * @param {function} callback + * @param {*} context + * @return {?object} + */ + function mapObject(object, callback, context) { + if (!object) { + return null; + } + var result = {}; + for (var name in object) { + if (hasOwnProperty.call(object, name)) { + result[name] = callback.call(context, object[name], name, object); + } + } + return result; + } + + module.exports = mapObject; + +/***/ }, +/* 345 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule onlyChild + */ + 'use strict'; + + var ReactElement = __webpack_require__(231); + + var invariant = __webpack_require__(202); + + /** + * Returns the first child in a collection of children and verifies that there + * is only one child in the collection. The current implementation of this + * function assumes that a single child gets passed without a wrapper, but the + * purpose of this helper function is to abstract away the particular structure + * of children. + * + * @param {?object} children Child collection structure. + * @return {ReactComponent} The first and only `ReactComponent` contained in the + * structure. + */ + function onlyChild(children) { + !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : undefined; + return children; + } + + module.exports = onlyChild; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 346 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule deprecated + */ + + 'use strict'; + + var assign = __webpack_require__(228); + var warning = __webpack_require__(214); + + /** + * This will log a single deprecation notice per function and forward the call + * on to the new API. + * + * @param {string} fnName The name of the function + * @param {string} newModule The module that fn will exist in + * @param {string} newPackage The module that fn will exist in + * @param {*} ctx The context this forwarded call should run in + * @param {function} fn The function to forward on to + * @return {function} The function that will warn once and then call fn + */ + function deprecated(fnName, newModule, newPackage, ctx, fn) { + var warned = false; + if (process.env.NODE_ENV !== 'production') { + var newFn = function () { + process.env.NODE_ENV !== 'production' ? warning(warned, + // Require examples in this string must be split to prevent React's + // build tools from mistaking them for real requires. + // Otherwise the build tools will attempt to build a '%s' module. + 'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : undefined; + warned = true; + return fn.apply(ctx, arguments); + }; + // We need to make sure all properties of the original fn are copied over. + // In particular, this is needed to support PropTypes + return assign(newFn, fn); + } + + return fn; + } + + module.exports = deprecated; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(190))) + +/***/ }, +/* 347 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(193); + + +/***/ }, +/* 348 */ +/***/ function(module, exports, __webpack_require__) { + + // style-loader: Adds some css to the DOM by adding a <style> tag + + // load the styles + var content = __webpack_require__(349); + if(typeof content === 'string') content = [[module.id, content, '']]; + // add the styles to the DOM + var update = __webpack_require__(351)(content, {}); + if(content.locals) module.exports = content.locals; + // Hot Module Replacement + if(false) { + // When the styles change, update the <style> tags + if(!content.locals) { + module.hot.accept("!!./../../css-loader/index.js!./index.css", function() { + var newContent = require("!!./../../css-loader/index.js!./index.css"); + if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; + update(newContent); + }); + } + // When the module is disposed, remove the <style> tags + module.hot.dispose(function() { update(); }); + } + +/***/ }, +/* 349 */ +/***/ function(module, exports, __webpack_require__) { + + exports = module.exports = __webpack_require__(350)(); + // imports + + + // module + exports.push([module.id, ".rc-slider {\n position: relative;\n height: 4px;\n width: 100%;\n border-radius: 6px;\n background-color: #e9e9e9;\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.rc-slider * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.rc-slider-track {\n position: absolute;\n left: 0;\n height: 4px;\n border-radius: 6px;\n background-color: #abe2fb;\n z-index: 1;\n}\n.rc-slider-handle {\n position: absolute;\n margin-left: -7px;\n margin-top: -5px;\n width: 14px;\n height: 14px;\n cursor: pointer;\n border-radius: 50%;\n border: solid 2px #96dbfa;\n background-color: #fff;\n z-index: 2;\n}\n.rc-slider-handle:hover {\n border-color: #57c5f7;\n}\n.rc-slider-handle-active:active {\n border-color: #57c5f7;\n box-shadow: 0 0 5px #57c5f7;\n}\n.rc-slider-mark {\n position: absolute;\n top: 10px;\n left: 0;\n width: 100%;\n font-size: 12px;\n z-index: 3;\n}\n.rc-slider-mark-text {\n position: absolute;\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n cursor: pointer;\n color: #999;\n}\n.rc-slider-mark-text-active {\n color: #666;\n}\n.rc-slider-step {\n position: absolute;\n width: 100%;\n height: 4px;\n background: transparent;\n z-index: 1;\n}\n.rc-slider-dot {\n position: absolute;\n top: -2px;\n margin-left: -4px;\n width: 8px;\n height: 8px;\n border: 2px solid #e9e9e9;\n background-color: #fff;\n cursor: pointer;\n border-radius: 50%;\n vertical-align: middle;\n}\n.rc-slider-dot:first-child {\n margin-left: -4px;\n}\n.rc-slider-dot:last-child {\n margin-left: -4px;\n}\n.rc-slider-dot-active {\n border-color: #96dbfa;\n}\n.rc-slider-disabled {\n background-color: #e9e9e9;\n}\n.rc-slider-disabled .rc-slider-track {\n background-color: #ccc;\n}\n.rc-slider-disabled .rc-slider-handle,\n.rc-slider-disabled .rc-slider-dot {\n border-color: #ccc;\n background-color: #fff;\n cursor: not-allowed;\n}\n.rc-slider-disabled .rc-slider-mark-text,\n.rc-slider-disabled .rc-slider-dot {\n cursor: not-allowed !important;\n}\n.rc-slider-tooltip-zoom-down-enter,\n.rc-slider-tooltip-zoom-down-appear {\n -webkit-animation-duration: .3s;\n animation-duration: .3s;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: block !important;\n -webkit-animation-play-state: paused;\n animation-play-state: paused;\n}\n.rc-slider-tooltip-zoom-down-leave {\n -webkit-animation-duration: .3s;\n animation-duration: .3s;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: block !important;\n -webkit-animation-play-state: paused;\n animation-play-state: paused;\n}\n.rc-slider-tooltip-zoom-down-enter.rc-slider-tooltip-zoom-down-enter-active,\n.rc-slider-tooltip-zoom-down-appear.rc-slider-tooltip-zoom-down-appear-active {\n -webkit-animation-name: rcSliderTooltipZoomDownIn;\n animation-name: rcSliderTooltipZoomDownIn;\n -webkit-animation-play-state: running;\n animation-play-state: running;\n}\n.rc-slider-tooltip-zoom-down-leave.rc-slider-tooltip-zoom-down-leave-active {\n -webkit-animation-name: rcSliderTooltipZoomDownOut;\n animation-name: rcSliderTooltipZoomDownOut;\n -webkit-animation-play-state: running;\n animation-play-state: running;\n}\n.rc-slider-tooltip-zoom-down-enter,\n.rc-slider-tooltip-zoom-down-appear {\n -webkit-transform: scale(0, 0);\n transform: scale(0, 0);\n -webkit-animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);\n animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);\n}\n.rc-slider-tooltip-zoom-down-leave {\n -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);\n animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);\n}\n@-webkit-keyframes rcSliderTooltipZoomDownIn {\n 0% {\n opacity: 0;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: scale(0, 0);\n transform: scale(0, 0);\n }\n 100% {\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: scale(1, 1);\n transform: scale(1, 1);\n }\n}\n@keyframes rcSliderTooltipZoomDownIn {\n 0% {\n opacity: 0;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: scale(0, 0);\n transform: scale(0, 0);\n }\n 100% {\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: scale(1, 1);\n transform: scale(1, 1);\n }\n}\n@-webkit-keyframes rcSliderTooltipZoomDownOut {\n 0% {\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: scale(1, 1);\n transform: scale(1, 1);\n }\n 100% {\n opacity: 0;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: scale(0, 0);\n transform: scale(0, 0);\n }\n}\n@keyframes rcSliderTooltipZoomDownOut {\n 0% {\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: scale(1, 1);\n transform: scale(1, 1);\n }\n 100% {\n opacity: 0;\n -webkit-transform-origin: 50% 100%;\n transform-origin: 50% 100%;\n -webkit-transform: scale(0, 0);\n transform: scale(0, 0);\n }\n}\n.rc-tooltip {\n position: absolute;\n left: -9999px;\n top: -9999px;\n z-index: 4;\n visibility: visible;\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.rc-tooltip * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.rc-tooltip-hidden {\n display: none;\n}\n.rc-tooltip-placement-top {\n padding: 4px 0 8px 0;\n}\n.rc-tooltip-inner {\n padding: 6px 2px;\n min-width: 24px;\n height: 24px;\n font-size: 12px;\n line-height: 1;\n color: #fff;\n text-align: center;\n text-decoration: none;\n background-color: #6c6c6c;\n border-radius: 6px;\n box-shadow: 0 0 4px #d9d9d9;\n}\n.rc-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n}\n.rc-tooltip-placement-top .rc-tooltip-arrow {\n bottom: 4px;\n left: 50%;\n margin-left: -4px;\n border-width: 4px 4px 0;\n border-top-color: #6c6c6c;\n}\n", ""]); + + // exports + + +/***/ }, +/* 350 */ +/***/ function(module, exports) { + + /*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+ */
+ // css base code, injected by the css-loader
+ module.exports = function() {
+ var list = [];
+
+ // return the list of modules as css string
+ list.toString = function toString() {
+ var result = [];
+ for(var i = 0; i < this.length; i++) {
+ var item = this[i];
+ if(item[2]) {
+ result.push("@media " + item[2] + "{" + item[1] + "}");
+ } else {
+ result.push(item[1]);
+ }
+ }
+ return result.join("");
+ };
+
+ // import a list of modules into the list
+ list.i = function(modules, mediaQuery) {
+ if(typeof modules === "string")
+ modules = [[null, modules, ""]];
+ var alreadyImportedModules = {};
+ for(var i = 0; i < this.length; i++) {
+ var id = this[i][0];
+ if(typeof id === "number")
+ alreadyImportedModules[id] = true;
+ }
+ for(i = 0; i < modules.length; i++) {
+ var item = modules[i];
+ // skip already imported module
+ // this implementation is not 100% perfect for weird media query combinations
+ // when a module is imported multiple times with different media queries.
+ // I hope this will never occur (Hey this way we have smaller bundles)
+ if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
+ if(mediaQuery && !item[2]) {
+ item[2] = mediaQuery;
+ } else if(mediaQuery) {
+ item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
+ }
+ list.push(item);
+ }
+ }
+ };
+ return list;
+ };
+ + +/***/ }, +/* 351 */ +/***/ function(module, exports, __webpack_require__) { + + /*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+ */
+ var stylesInDom = {},
+ memoize = function(fn) {
+ var memo;
+ return function () {
+ if (typeof memo === "undefined") memo = fn.apply(this, arguments);
+ return memo;
+ };
+ },
+ isOldIE = memoize(function() {
+ return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
+ }),
+ getHeadElement = memoize(function () {
+ return document.head || document.getElementsByTagName("head")[0];
+ }),
+ singletonElement = null,
+ singletonCounter = 0,
+ styleElementsInsertedAtTop = [];
+
+ module.exports = function(list, options) {
+ if(false) {
+ if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
+ }
+
+ options = options || {};
+ // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
+ // tags it will allow on a page
+ if (typeof options.singleton === "undefined") options.singleton = isOldIE();
+
+ // By default, add <style> tags to the bottom of <head>.
+ if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
+
+ var styles = listToStyles(list);
+ addStylesToDom(styles, options);
+
+ return function update(newList) {
+ var mayRemove = [];
+ for(var i = 0; i < styles.length; i++) {
+ var item = styles[i];
+ var domStyle = stylesInDom[item.id];
+ domStyle.refs--;
+ mayRemove.push(domStyle);
+ }
+ if(newList) {
+ var newStyles = listToStyles(newList);
+ addStylesToDom(newStyles, options);
+ }
+ for(var i = 0; i < mayRemove.length; i++) {
+ var domStyle = mayRemove[i];
+ if(domStyle.refs === 0) {
+ for(var j = 0; j < domStyle.parts.length; j++)
+ domStyle.parts[j]();
+ delete stylesInDom[domStyle.id];
+ }
+ }
+ };
+ }
+
+ function addStylesToDom(styles, options) {
+ for(var i = 0; i < styles.length; i++) {
+ var item = styles[i];
+ var domStyle = stylesInDom[item.id];
+ if(domStyle) {
+ domStyle.refs++;
+ for(var j = 0; j < domStyle.parts.length; j++) {
+ domStyle.parts[j](item.parts[j]);
+ }
+ for(; j < item.parts.length; j++) {
+ domStyle.parts.push(addStyle(item.parts[j], options));
+ }
+ } else {
+ var parts = [];
+ for(var j = 0; j < item.parts.length; j++) {
+ parts.push(addStyle(item.parts[j], options));
+ }
+ stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
+ }
+ }
+ }
+
+ function listToStyles(list) {
+ var styles = [];
+ var newStyles = {};
+ for(var i = 0; i < list.length; i++) {
+ var item = list[i];
+ var id = item[0];
+ var css = item[1];
+ var media = item[2];
+ var sourceMap = item[3];
+ var part = {css: css, media: media, sourceMap: sourceMap};
+ if(!newStyles[id])
+ styles.push(newStyles[id] = {id: id, parts: [part]});
+ else
+ newStyles[id].parts.push(part);
+ }
+ return styles;
+ }
+
+ function insertStyleElement(options, styleElement) {
+ var head = getHeadElement();
+ var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
+ if (options.insertAt === "top") {
+ if(!lastStyleElementInsertedAtTop) {
+ head.insertBefore(styleElement, head.firstChild);
+ } else if(lastStyleElementInsertedAtTop.nextSibling) {
+ head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
+ } else {
+ head.appendChild(styleElement);
+ }
+ styleElementsInsertedAtTop.push(styleElement);
+ } else if (options.insertAt === "bottom") {
+ head.appendChild(styleElement);
+ } else {
+ throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
+ }
+ }
+
+ function removeStyleElement(styleElement) {
+ styleElement.parentNode.removeChild(styleElement);
+ var idx = styleElementsInsertedAtTop.indexOf(styleElement);
+ if(idx >= 0) {
+ styleElementsInsertedAtTop.splice(idx, 1);
+ }
+ }
+
+ function createStyleElement(options) {
+ var styleElement = document.createElement("style");
+ styleElement.type = "text/css";
+ insertStyleElement(options, styleElement);
+ return styleElement;
+ }
+
+ function createLinkElement(options) {
+ var linkElement = document.createElement("link");
+ linkElement.rel = "stylesheet";
+ insertStyleElement(options, linkElement);
+ return linkElement;
+ }
+
+ function addStyle(obj, options) {
+ var styleElement, update, remove;
+
+ if (options.singleton) {
+ var styleIndex = singletonCounter++;
+ styleElement = singletonElement || (singletonElement = createStyleElement(options));
+ update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
+ remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
+ } else if(obj.sourceMap &&
+ typeof URL === "function" &&
+ typeof URL.createObjectURL === "function" &&
+ typeof URL.revokeObjectURL === "function" &&
+ typeof Blob === "function" &&
+ typeof btoa === "function") {
+ styleElement = createLinkElement(options);
+ update = updateLink.bind(null, styleElement);
+ remove = function() {
+ removeStyleElement(styleElement);
+ if(styleElement.href)
+ URL.revokeObjectURL(styleElement.href);
+ };
+ } else {
+ styleElement = createStyleElement(options);
+ update = applyToTag.bind(null, styleElement);
+ remove = function() {
+ removeStyleElement(styleElement);
+ };
+ }
+
+ update(obj);
+
+ return function updateStyle(newObj) {
+ if(newObj) {
+ if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
+ return;
+ update(obj = newObj);
+ } else {
+ remove();
+ }
+ };
+ }
+
+ var replaceText = (function () {
+ var textStore = [];
+
+ return function (index, replacement) {
+ textStore[index] = replacement;
+ return textStore.filter(Boolean).join('\n');
+ };
+ })();
+
+ function applyToSingletonTag(styleElement, index, remove, obj) {
+ var css = remove ? "" : obj.css;
+
+ if (styleElement.styleSheet) {
+ styleElement.styleSheet.cssText = replaceText(index, css);
+ } else {
+ var cssNode = document.createTextNode(css);
+ var childNodes = styleElement.childNodes;
+ if (childNodes[index]) styleElement.removeChild(childNodes[index]);
+ if (childNodes.length) {
+ styleElement.insertBefore(cssNode, childNodes[index]);
+ } else {
+ styleElement.appendChild(cssNode);
+ }
+ }
+ }
+
+ function applyToTag(styleElement, obj) {
+ var css = obj.css;
+ var media = obj.media;
+ var sourceMap = obj.sourceMap;
+
+ if(media) {
+ styleElement.setAttribute("media", media)
+ }
+
+ if(styleElement.styleSheet) {
+ styleElement.styleSheet.cssText = css;
+ } else {
+ while(styleElement.firstChild) {
+ styleElement.removeChild(styleElement.firstChild);
+ }
+ styleElement.appendChild(document.createTextNode(css));
+ }
+ }
+
+ function updateLink(linkElement, obj) {
+ var css = obj.css;
+ var media = obj.media;
+ var sourceMap = obj.sourceMap;
+
+ if(sourceMap) {
+ // http://stackoverflow.com/a/26603875
+ css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
+ }
+
+ var blob = new Blob([css], { type: "text/css" });
+
+ var oldSrc = linkElement.href;
+
+ linkElement.href = URL.createObjectURL(blob);
+
+ if(oldSrc)
+ URL.revokeObjectURL(oldSrc);
+ }
+ + +/***/ }, +/* 352 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(353); + +/***/ }, +/* 353 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + 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; }; })(); + + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + 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; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _rcUtil = __webpack_require__(354); + + var _classnames = __webpack_require__(358); + + var _classnames2 = _interopRequireDefault(_classnames); + + var _objectAssign2 = __webpack_require__(373); + + var _objectAssign3 = _interopRequireDefault(_objectAssign2); + + var _Track = __webpack_require__(377); + + var _Track2 = _interopRequireDefault(_Track); + + var _Handle = __webpack_require__(378); + + var _Handle2 = _interopRequireDefault(_Handle); + + var _Dots = __webpack_require__(406); + + var _Dots2 = _interopRequireDefault(_Dots); + + var _Marks = __webpack_require__(407); + + var _Marks2 = _interopRequireDefault(_Marks); + + function noop() {} + + function isNotTouchEvent(e) { + return e.touches.length > 1 || e.type.toLowerCase() === 'touchend' && e.touches.length > 0; + } + + function getTouchPosition(e) { + return e.touches[0].pageX; + } + + function getMousePosition(e) { + return e.pageX; + } + + function pauseEvent(e) { + e.stopPropagation(); + e.preventDefault(); + } + + var Slider = (function (_React$Component) { + _inherits(Slider, _React$Component); + + function Slider(props) { + _classCallCheck(this, Slider); + + _get(Object.getPrototypeOf(Slider.prototype), 'constructor', this).call(this, props); + + var range = props.range; + var min = props.min; + var max = props.max; + + var initialValue = range ? [min, min] : min; + var defaultValue = 'defaultValue' in props ? props.defaultValue : initialValue; + var value = 'value' in props ? props.value : defaultValue; + + var upperBound = undefined; + var lowerBound = undefined; + if (props.range) { + lowerBound = this.trimAlignValue(value[0]); + upperBound = this.trimAlignValue(value[1]); + } else { + upperBound = this.trimAlignValue(value); + } + + var recent = undefined; + if (props.range && upperBound === lowerBound) { + if (lowerBound === max) { + recent = 'lowerBound'; + } + if (upperBound === min) { + recent = 'upperBound'; + } + } else { + recent = 'upperBound'; + } + + this.state = { + handle: null, + recent: recent, + upperBound: upperBound, + // If Slider is not range, set `lowerBound` equal to `min`. + lowerBound: lowerBound || min + }; + } + + _createClass(Slider, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if (!('value' in nextProps || 'min' in nextProps || 'max' in nextProps)) return; + + var _state = this.state; + var lowerBound = _state.lowerBound; + var upperBound = _state.upperBound; + + if (nextProps.range) { + var value = nextProps.value || [lowerBound, upperBound]; + var nextUpperBound = this.trimAlignValue(value[1], nextProps); + var nextLowerBound = this.trimAlignValue(value[0], nextProps); + if (nextLowerBound === lowerBound && nextUpperBound === upperBound) return; + + this.setState({ + upperBound: nextUpperBound, + lowerBound: nextLowerBound + }); + if (this.isValueOutOfBounds(upperBound, nextProps) || this.isValueOutOfBounds(lowerBound, nextProps)) { + this.props.onChange([nextLowerBound, nextUpperBound]); + } + } else { + var value = 'value' in nextProps ? nextProps.value : upperBound; + var nextValue = this.trimAlignValue(value, nextProps); + if (nextValue === upperBound && lowerBound === nextProps.min) return; + + this.setState({ + upperBound: nextValue, + lowerBound: nextProps.min + }); + if (this.isValueOutOfBounds(upperBound, nextProps)) { + this.props.onChange(nextValue); + } + } + } + }, { + key: 'onChange', + value: function onChange(state) { + var props = this.props; + var isNotControlled = !('value' in props); + if (isNotControlled) { + this.setState(state); + } else if (state.handle) { + this.setState({ handle: state.handle }); + } + + var data = (0, _objectAssign3['default'])({}, this.state, state); + var changedValue = props.range ? [data.lowerBound, data.upperBound] : data.upperBound; + props.onChange(changedValue); + } + }, { + key: 'onMouseMove', + value: function onMouseMove(e) { + var position = getMousePosition(e); + this.onMove(e, position); + } + }, { + key: 'onTouchMove', + value: function onTouchMove(e) { + if (isNotTouchEvent(e)) { + this.end('touch'); + return; + } + + var position = getTouchPosition(e); + this.onMove(e, position); + } + }, { + key: 'onMove', + value: function onMove(e, position) { + pauseEvent(e); + var props = this.props; + var state = this.state; + + var diffPosition = position - this.startPosition; + var diffValue = diffPosition / this.getSliderLength() * (props.max - props.min); + + var value = this.trimAlignValue(this.startValue + diffValue); + var oldValue = state[state.handle]; + if (value === oldValue) return; + + if (props.allowCross && value < state.lowerBound && state.handle === 'upperBound') { + this.onChange({ + handle: 'lowerBound', + lowerBound: value, + upperBound: this.state.lowerBound + }); + return; + } + if (props.allowCross && value > state.upperBound && state.handle === 'lowerBound') { + this.onChange({ + handle: 'upperBound', + upperBound: value, + lowerBound: this.state.upperBound + }); + return; + } + + this.onChange(_defineProperty({}, state.handle, value)); + } + }, { + key: 'onTouchStart', + value: function onTouchStart(e) { + if (isNotTouchEvent(e)) return; + + var position = getTouchPosition(e); + this.onStart(position); + this.addDocumentEvents('touch'); + pauseEvent(e); + } + }, { + key: 'onMouseDown', + value: function onMouseDown(e) { + var position = getMousePosition(e); + this.onStart(position); + this.addDocumentEvents('mouse'); + pauseEvent(e); + } + }, { + key: 'onStart', + value: function onStart(position) { + var props = this.props; + props.onBeforeChange(this.getValue()); + + var value = this.calcValueByPos(position); + this.startValue = value; + this.startPosition = position; + + var state = this.state; + var upperBound = state.upperBound; + var lowerBound = state.lowerBound; + + var valueNeedChanging = 'upperBound'; + if (this.props.range) { + var isLowerBoundCloser = Math.abs(upperBound - value) > Math.abs(lowerBound - value); + if (isLowerBoundCloser) { + valueNeedChanging = 'lowerBound'; + } + + var isAtTheSamePoint = upperBound === lowerBound; + if (isAtTheSamePoint) { + valueNeedChanging = state.recent; + } + + if (isAtTheSamePoint && value !== upperBound) { + valueNeedChanging = value < upperBound ? 'lowerBound' : 'upperBound'; + } + } + + this.setState({ + handle: valueNeedChanging, + recent: valueNeedChanging + }); + + var oldValue = state[valueNeedChanging]; + if (value === oldValue) return; + + this.onChange(_defineProperty({}, valueNeedChanging, value)); + } + }, { + key: 'getValue', + value: function getValue() { + var _state2 = this.state; + var lowerBound = _state2.lowerBound; + var upperBound = _state2.upperBound; + + return this.props.range ? [lowerBound, upperBound] : upperBound; + } + }, { + key: 'getSliderLength', + value: function getSliderLength() { + var slider = this.refs.slider; + if (!slider) { + return 0; + } + + return slider.clientWidth; + } + }, { + key: 'getSliderStart', + value: function getSliderStart() { + var slider = this.refs.slider; + var rect = slider.getBoundingClientRect(); + + return rect.left; + } + }, { + key: 'getPrecision', + value: function getPrecision() { + var props = this.props; + var stepString = props.step.toString(); + var precision = 0; + if (stepString.indexOf('.') >= 0) { + precision = stepString.length - stepString.indexOf('.') - 1; + } + return precision; + } + }, { + key: 'isValueOutOfBounds', + value: function isValueOutOfBounds(value, props) { + return value < props.min || value > props.max; + } + }, { + key: 'trimAlignValue', + value: function trimAlignValue(v, nextProps) { + var state = this.state || {}; + var handle = state.handle; + var lowerBound = state.lowerBound; + var upperBound = state.upperBound; + + var _objectAssign = (0, _objectAssign3['default'])({}, this.props, nextProps || {}); + + var marks = _objectAssign.marks; + var step = _objectAssign.step; + var min = _objectAssign.min; + var max = _objectAssign.max; + var allowCross = _objectAssign.allowCross; + + var val = v; + if (val <= min) { + val = min; + } + if (val >= max) { + val = max; + } + if (!allowCross && handle === 'upperBound' && val <= lowerBound) { + val = lowerBound; + } + if (!allowCross && handle === 'lowerBound' && val >= upperBound) { + val = upperBound; + } + + var points = Object.keys(marks).map(parseFloat); + if (step !== null) { + var closestStep = Math.round(val / step) * step; + points.push(closestStep); + } + + var diffs = points.map(function (point) { + return Math.abs(val - point); + }); + var closestPoint = points[diffs.indexOf(Math.min.apply(Math, diffs))]; + + return step !== null ? parseFloat(closestPoint.toFixed(this.getPrecision())) : closestPoint; + } + }, { + key: 'calcOffset', + value: function calcOffset(value) { + var _props = this.props; + var min = _props.min; + var max = _props.max; + + var ratio = (value - min) / (max - min); + return ratio * 100; + } + }, { + key: 'calcValue', + value: function calcValue(offset) { + var _props2 = this.props; + var min = _props2.min; + var max = _props2.max; + + var ratio = offset / this.getSliderLength(); + return ratio * (max - min) + min; + } + }, { + key: 'calcValueByPos', + value: function calcValueByPos(position) { + var pixelOffset = position - this.getSliderStart(); + var nextValue = this.trimAlignValue(this.calcValue(pixelOffset)); + return nextValue; + } + }, { + key: 'addDocumentEvents', + value: function addDocumentEvents(type) { + if (type === 'touch') { + // just work for chrome iOS Safari and Android Browser + this.onTouchMoveListener = _rcUtil.Dom.addEventListener(document, 'touchmove', this.onTouchMove.bind(this)); + this.onTouchUpListener = _rcUtil.Dom.addEventListener(document, 'touchend', this.end.bind(this, 'touch')); + } else if (type === 'mouse') { + this.onMouseMoveListener = _rcUtil.Dom.addEventListener(document, 'mousemove', this.onMouseMove.bind(this)); + this.onMouseUpListener = _rcUtil.Dom.addEventListener(document, 'mouseup', this.end.bind(this, 'mouse')); + } + } + }, { + key: 'removeEvents', + value: function removeEvents(type) { + if (type === 'touch') { + this.onTouchMoveListener.remove(); + this.onTouchUpListener.remove(); + } else if (type === 'mouse') { + this.onMouseMoveListener.remove(); + this.onMouseUpListener.remove(); + } + } + }, { + key: 'end', + value: function end(type) { + this.removeEvents(type); + this.props.onAfterChange(this.getValue()); + this.setState({ handle: null }); + } + }, { + key: 'render', + value: function render() { + var _classNames; + + var _state3 = this.state; + var handle = _state3.handle; + var upperBound = _state3.upperBound; + var lowerBound = _state3.lowerBound; + var _props3 = this.props; + var className = _props3.className; + var prefixCls = _props3.prefixCls; + var disabled = _props3.disabled; + var dots = _props3.dots; + var included = _props3.included; + var range = _props3.range; + var step = _props3.step; + var marks = _props3.marks; + var max = _props3.max; + var min = _props3.min; + var tipTransitionName = _props3.tipTransitionName; + var tipFormatter = _props3.tipFormatter; + var children = _props3.children; + + var upperOffset = this.calcOffset(upperBound); + var lowerOffset = this.calcOffset(lowerBound); + + var handleClassName = prefixCls + '-handle'; + var isNoTip = step === null || tipFormatter === null; + + var upper = _react2['default'].createElement(_Handle2['default'], { className: handleClassName, + noTip: isNoTip, tipTransitionName: tipTransitionName, tipFormatter: tipFormatter, + offset: upperOffset, value: upperBound, dragging: handle === 'upperBound' }); + + var lower = null; + if (range) { + lower = _react2['default'].createElement(_Handle2['default'], { className: handleClassName, + noTip: isNoTip, tipTransitionName: tipTransitionName, tipFormatter: tipFormatter, + offset: lowerOffset, value: lowerBound, dragging: handle === 'lowerBound' }); + } + + var sliderClassName = (0, _classnames2['default'])((_classNames = {}, _defineProperty(_classNames, prefixCls, true), _defineProperty(_classNames, prefixCls + '-disabled', disabled), _defineProperty(_classNames, className, !!className), _classNames)); + var isIncluded = included || range; + return _react2['default'].createElement( + 'div', + { ref: 'slider', className: sliderClassName, + onTouchStart: disabled ? noop : this.onTouchStart.bind(this), + onMouseDown: disabled ? noop : this.onMouseDown.bind(this) }, + upper, + lower, + _react2['default'].createElement(_Track2['default'], { className: prefixCls + '-track', included: isIncluded, + offset: lowerOffset, length: upperOffset - lowerOffset }), + _react2['default'].createElement(_Dots2['default'], { prefixCls: prefixCls, marks: marks, dots: dots, step: step, + included: isIncluded, lowerBound: lowerBound, + upperBound: upperBound, max: max, min: min }), + _react2['default'].createElement(_Marks2['default'], { className: prefixCls + '-mark', marks: marks, + included: isIncluded, lowerBound: lowerBound, + upperBound: upperBound, max: max, min: min }), + children + ); + } + }]); + + return Slider; + })(_react2['default'].Component); + + Slider.propTypes = { + min: _react2['default'].PropTypes.number, + max: _react2['default'].PropTypes.number, + step: _react2['default'].PropTypes.number, + defaultValue: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, _react2['default'].PropTypes.arrayOf(_react2['default'].PropTypes.number)]), + value: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, _react2['default'].PropTypes.arrayOf(_react2['default'].PropTypes.number)]), + marks: _react2['default'].PropTypes.object, + included: _react2['default'].PropTypes.bool, + className: _react2['default'].PropTypes.string, + prefixCls: _react2['default'].PropTypes.string, + disabled: _react2['default'].PropTypes.bool, + children: _react2['default'].PropTypes.any, + onBeforeChange: _react2['default'].PropTypes.func, + onChange: _react2['default'].PropTypes.func, + onAfterChange: _react2['default'].PropTypes.func, + tipTransitionName: _react2['default'].PropTypes.string, + tipFormatter: _react2['default'].PropTypes.func, + dots: _react2['default'].PropTypes.bool, + range: _react2['default'].PropTypes.bool, + allowCross: _react2['default'].PropTypes.bool + }; + + Slider.defaultProps = { + prefixCls: 'rc-slider', + className: '', + tipTransitionName: '', + min: 0, + max: 100, + step: 1, + marks: {}, + onBeforeChange: noop, + onChange: noop, + onAfterChange: noop, + tipFormatter: function tipFormatter(value) { + return value; + }, + included: true, + disabled: false, + dots: false, + range: false, + allowCross: true + }; + + exports['default'] = Slider; + module.exports = exports['default']; + +/***/ }, +/* 354 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = { + guid: __webpack_require__(355), + classSet: __webpack_require__(356), + joinClasses: __webpack_require__(359), + KeyCode: __webpack_require__(360), + PureRenderMixin: __webpack_require__(361), + shallowEqual: __webpack_require__(362), + createChainedFunction: __webpack_require__(368), + Dom: { + addEventListener: __webpack_require__(369), + contains: __webpack_require__(374) + }, + Children: { + toArray: __webpack_require__(375), + mapSelf: __webpack_require__(376) + } + }; + +/***/ }, +/* 355 */ +/***/ function(module, exports) { + + 'use strict'; + + var seed = 0; + module.exports = function guid() { + return Date.now() + '_' + seed++; + }; + +/***/ }, +/* 356 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var deprecate = __webpack_require__(357); + var classNames = __webpack_require__(358); + + module.exports = deprecate(classNames, '`rcUtil.classSet()` is deprecated, use `classNames()` by `require(\'classnames\')` instead'); + +/***/ }, +/* 357 */ +/***/ function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) { + /** + * Module exports. + */ + + module.exports = deprecate; + + /** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + + function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; + } + + /** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + + function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; + } + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 358 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2015 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames + */ + /* global define */ + + (function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + + function classNames () { + var classes = ''; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes += ' ' + arg; + } else if (Array.isArray(arg)) { + classes += ' ' + classNames.apply(null, arg); + } else if (argType === 'object') { + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes += ' ' + key; + } + } + } + } + + return classes.substr(1); + } + + if (typeof module !== 'undefined' && module.exports) { + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { + return classNames; + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { + window.classNames = classNames; + } + }()); + + +/***/ }, +/* 359 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var deprecate = __webpack_require__(357); + var classNames = __webpack_require__(358); + + module.exports = deprecate(classNames, '`rcUtil.joinClasses()` is deprecated, use `classNames()` by `require(\'classnames\')` instead'); + +/***/ }, +/* 360 */ +/***/ function(module, exports) { + + /** + * @ignore + * some key-codes definition and utils from closure-library + * @author yiminghe@gmail.com + */ + + 'use strict'; + + var KeyCode = { + /** + * MAC_ENTER + */ + MAC_ENTER: 3, + /** + * BACKSPACE + */ + BACKSPACE: 8, + /** + * TAB + */ + TAB: 9, + /** + * NUMLOCK on FF/Safari Mac + */ + NUM_CENTER: 12, // NUMLOCK on FF/Safari Mac + /** + * ENTER + */ + ENTER: 13, + /** + * SHIFT + */ + SHIFT: 16, + /** + * CTRL + */ + CTRL: 17, + /** + * ALT + */ + ALT: 18, + /** + * PAUSE + */ + PAUSE: 19, + /** + * CAPS_LOCK + */ + CAPS_LOCK: 20, + /** + * ESC + */ + ESC: 27, + /** + * SPACE + */ + SPACE: 32, + /** + * PAGE_UP + */ + PAGE_UP: 33, // also NUM_NORTH_EAST + /** + * PAGE_DOWN + */ + PAGE_DOWN: 34, // also NUM_SOUTH_EAST + /** + * END + */ + END: 35, // also NUM_SOUTH_WEST + /** + * HOME + */ + HOME: 36, // also NUM_NORTH_WEST + /** + * LEFT + */ + LEFT: 37, // also NUM_WEST + /** + * UP + */ + UP: 38, // also NUM_NORTH + /** + * RIGHT + */ + RIGHT: 39, // also NUM_EAST + /** + * DOWN + */ + DOWN: 40, // also NUM_SOUTH + /** + * PRINT_SCREEN + */ + PRINT_SCREEN: 44, + /** + * INSERT + */ + INSERT: 45, // also NUM_INSERT + /** + * DELETE + */ + DELETE: 46, // also NUM_DELETE + /** + * ZERO + */ + ZERO: 48, + /** + * ONE + */ + ONE: 49, + /** + * TWO + */ + TWO: 50, + /** + * THREE + */ + THREE: 51, + /** + * FOUR + */ + FOUR: 52, + /** + * FIVE + */ + FIVE: 53, + /** + * SIX + */ + SIX: 54, + /** + * SEVEN + */ + SEVEN: 55, + /** + * EIGHT + */ + EIGHT: 56, + /** + * NINE + */ + NINE: 57, + /** + * QUESTION_MARK + */ + QUESTION_MARK: 63, // needs localization + /** + * A + */ + A: 65, + /** + * B + */ + B: 66, + /** + * C + */ + C: 67, + /** + * D + */ + D: 68, + /** + * E + */ + E: 69, + /** + * F + */ + F: 70, + /** + * G + */ + G: 71, + /** + * H + */ + H: 72, + /** + * I + */ + I: 73, + /** + * J + */ + J: 74, + /** + * K + */ + K: 75, + /** + * L + */ + L: 76, + /** + * M + */ + M: 77, + /** + * N + */ + N: 78, + /** + * O + */ + O: 79, + /** + * P + */ + P: 80, + /** + * Q + */ + Q: 81, + /** + * R + */ + R: 82, + /** + * S + */ + S: 83, + /** + * T + */ + T: 84, + /** + * U + */ + U: 85, + /** + * V + */ + V: 86, + /** + * W + */ + W: 87, + /** + * X + */ + X: 88, + /** + * Y + */ + Y: 89, + /** + * Z + */ + Z: 90, + /** + * META + */ + META: 91, // WIN_KEY_LEFT + /** + * WIN_KEY_RIGHT + */ + WIN_KEY_RIGHT: 92, + /** + * CONTEXT_MENU + */ + CONTEXT_MENU: 93, + /** + * NUM_ZERO + */ + NUM_ZERO: 96, + /** + * NUM_ONE + */ + NUM_ONE: 97, + /** + * NUM_TWO + */ + NUM_TWO: 98, + /** + * NUM_THREE + */ + NUM_THREE: 99, + /** + * NUM_FOUR + */ + NUM_FOUR: 100, + /** + * NUM_FIVE + */ + NUM_FIVE: 101, + /** + * NUM_SIX + */ + NUM_SIX: 102, + /** + * NUM_SEVEN + */ + NUM_SEVEN: 103, + /** + * NUM_EIGHT + */ + NUM_EIGHT: 104, + /** + * NUM_NINE + */ + NUM_NINE: 105, + /** + * NUM_MULTIPLY + */ + NUM_MULTIPLY: 106, + /** + * NUM_PLUS + */ + NUM_PLUS: 107, + /** + * NUM_MINUS + */ + NUM_MINUS: 109, + /** + * NUM_PERIOD + */ + NUM_PERIOD: 110, + /** + * NUM_DIVISION + */ + NUM_DIVISION: 111, + /** + * F1 + */ + F1: 112, + /** + * F2 + */ + F2: 113, + /** + * F3 + */ + F3: 114, + /** + * F4 + */ + F4: 115, + /** + * F5 + */ + F5: 116, + /** + * F6 + */ + F6: 117, + /** + * F7 + */ + F7: 118, + /** + * F8 + */ + F8: 119, + /** + * F9 + */ + F9: 120, + /** + * F10 + */ + F10: 121, + /** + * F11 + */ + F11: 122, + /** + * F12 + */ + F12: 123, + /** + * NUMLOCK + */ + NUMLOCK: 144, + /** + * SEMICOLON + */ + SEMICOLON: 186, // needs localization + /** + * DASH + */ + DASH: 189, // needs localization + /** + * EQUALS + */ + EQUALS: 187, // needs localization + /** + * COMMA + */ + COMMA: 188, // needs localization + /** + * PERIOD + */ + PERIOD: 190, // needs localization + /** + * SLASH + */ + SLASH: 191, // needs localization + /** + * APOSTROPHE + */ + APOSTROPHE: 192, // needs localization + /** + * SINGLE_QUOTE + */ + SINGLE_QUOTE: 222, // needs localization + /** + * OPEN_SQUARE_BRACKET + */ + OPEN_SQUARE_BRACKET: 219, // needs localization + /** + * BACKSLASH + */ + BACKSLASH: 220, // needs localization + /** + * CLOSE_SQUARE_BRACKET + */ + CLOSE_SQUARE_BRACKET: 221, // needs localization + /** + * WIN_KEY + */ + WIN_KEY: 224, + /** + * MAC_FF_META + */ + MAC_FF_META: 224, // Firefox (Gecko) fires this for the meta key instead of 91 + /** + * WIN_IME + */ + WIN_IME: 229 + }; + + /* + whether text and modified key is entered at the same time. + */ + KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) { + var keyCode = e.keyCode; + if (e.altKey && !e.ctrlKey || e.metaKey || + // Function keys don't generate text + keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) { + return false; + } + + // The following keys are quite harmless, even in combination with + // CTRL, ALT or SHIFT. + switch (keyCode) { + case KeyCode.ALT: + case KeyCode.CAPS_LOCK: + case KeyCode.CONTEXT_MENU: + case KeyCode.CTRL: + case KeyCode.DOWN: + case KeyCode.END: + case KeyCode.ESC: + case KeyCode.HOME: + case KeyCode.INSERT: + case KeyCode.LEFT: + case KeyCode.MAC_FF_META: + case KeyCode.META: + case KeyCode.NUMLOCK: + case KeyCode.NUM_CENTER: + case KeyCode.PAGE_DOWN: + case KeyCode.PAGE_UP: + case KeyCode.PAUSE: + case KeyCode.PRINT_SCREEN: + case KeyCode.RIGHT: + case KeyCode.SHIFT: + case KeyCode.UP: + case KeyCode.WIN_KEY: + case KeyCode.WIN_KEY_RIGHT: + return false; + default: + return true; + } + }; + + /* + whether character is entered. + */ + KeyCode.isCharacterKey = function isCharacterKey(keyCode) { + if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) { + return true; + } + + if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) { + return true; + } + + if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) { + return true; + } + + // Safari sends zero key code for non-latin characters. + if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) { + return true; + } + + switch (keyCode) { + case KeyCode.SPACE: + case KeyCode.QUESTION_MARK: + case KeyCode.NUM_PLUS: + case KeyCode.NUM_MINUS: + case KeyCode.NUM_PERIOD: + case KeyCode.NUM_DIVISION: + case KeyCode.SEMICOLON: + case KeyCode.DASH: + case KeyCode.EQUALS: + case KeyCode.COMMA: + case KeyCode.PERIOD: + case KeyCode.SLASH: + case KeyCode.APOSTROPHE: + case KeyCode.SINGLE_QUOTE: + case KeyCode.OPEN_SQUARE_BRACKET: + case KeyCode.BACKSLASH: + case KeyCode.CLOSE_SQUARE_BRACKET: + return true; + default: + return false; + } + }; + + module.exports = KeyCode; + +/***/ }, +/* 361 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var shallowEqual = __webpack_require__(362); + + /** + * If your React component's render function is "pure", e.g. it will render the + * same result given the same props and state, provide this Mixin for a + * considerable performance boost. + * + * Most React components have pure render functions. + * + * Example: + * + * const ReactComponentWithPureRenderMixin = + * require('ReactComponentWithPureRenderMixin'); + * React.createClass({ + * mixins: [ReactComponentWithPureRenderMixin], + * + * render: function() { + * return <div className={this.props.className}>foo</div>; + * } + * }); + * + * Note: This only checks shallow equality for props and state. If these contain + * complex data structures this mixin may have false-negatives for deeper + * differences. Only mixin to components which have simple props and state, or + * use `forceUpdate()` when you know deep data structures have changed. + */ + var ReactComponentWithPureRenderMixin = { + shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) { + return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState); + } + }; + + module.exports = ReactComponentWithPureRenderMixin; + +/***/ }, +/* 362 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var shallowEqual = __webpack_require__(363); + + module.exports = shallowEqual; + +/***/ }, +/* 363 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var fetchKeys = __webpack_require__(364); + + module.exports = function shallowEqual(objA, objB, compare, compareContext) { + + var ret = compare ? compare.call(compareContext, objA, objB) : void 0; + + if (ret !== void 0) { + return !!ret; + } + + if (objA === objB) { + return true; + } + + if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { + return false; + } + + var keysA = fetchKeys(objA); + var keysB = fetchKeys(objB); + + var len = keysA.length; + if (len !== keysB.length) { + return false; + } + + compareContext = compareContext || null; + + // Test for A's keys different from B. + var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB); + for (var i = 0; i < len; i++) { + var key = keysA[i]; + if (!bHasOwnProperty(key)) { + return false; + } + var valueA = objA[key]; + var valueB = objB[key]; + + var _ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0; + if (_ret === false || _ret === void 0 && valueA !== valueB) { + return false; + } + } + + return true; + }; + +/***/ }, +/* 364 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 3.1.2 (Custom Build) <https://lodash.com/> + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> + * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license <https://lodash.com/license> + */ + var getNative = __webpack_require__(365), + isArguments = __webpack_require__(366), + isArray = __webpack_require__(367); + + /** Used to detect unsigned integer values. */ + var reIsUint = /^\d+$/; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeKeys = getNative(Object, 'keys'); + + /** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * A fallback implementation of `Object.keys` which creates an array of the + * own enumerable property names of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function shimKeys(object) { + var props = keysIn(object), + propsLength = props.length, + length = propsLength && object.length; + + var allowIndexes = !!length && isLength(length) && + (isArray(object) || isArguments(object)); + + var index = -1, + result = []; + + while (++index < propsLength) { + var key = props[index]; + if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { + result.push(key); + } + } + return result; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + var keys = !nativeKeys ? shimKeys : function(object) { + var Ctor = object == null ? undefined : object.constructor; + if ((typeof Ctor == 'function' && Ctor.prototype === object) || + (typeof object != 'function' && isArrayLike(object))) { + return shimKeys(object); + } + return isObject(object) ? nativeKeys(object) : []; + }; + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + if (object == null) { + return []; + } + if (!isObject(object)) { + object = Object(object); + } + var length = object.length; + length = (length && isLength(length) && + (isArray(object) || isArguments(object)) && length) || 0; + + var Ctor = object.constructor, + index = -1, + isProto = typeof Ctor == 'function' && Ctor.prototype === object, + result = Array(length), + skipIndexes = length > 0; + + while (++index < length) { + result[index] = (index + ''); + } + for (var key in object) { + if (!(skipIndexes && isIndex(key, length)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + module.exports = keys; + + +/***/ }, +/* 365 */ +/***/ function(module, exports) { + + /** + * lodash 3.9.1 (Custom Build) <https://lodash.com/> + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> + * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license <https://lodash.com/license> + */ + + /** `Object#toString` result references. */ + var funcTag = '[object Function]'; + + /** Used to detect host constructors (Safari > 5). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var fnToString = Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); + } + + module.exports = getNative; + + +/***/ }, +/* 366 */ +/***/ function(module, exports) { + + /** + * lodash 3.0.4 (Custom Build) <https://lodash.com/> + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> + * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license <https://lodash.com/license> + */ + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Native method references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return isObjectLike(value) && isArrayLike(value) && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); + } + + module.exports = isArguments; + + +/***/ }, +/* 367 */ +/***/ function(module, exports) { + + /** + * lodash 3.0.4 (Custom Build) <https://lodash.com/> + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> + * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license <https://lodash.com/license> + */ + + /** `Object#toString` result references. */ + var arrayTag = '[object Array]', + funcTag = '[object Function]'; + + /** Used to detect host constructors (Safari > 5). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var fnToString = Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeIsArray = getNative(Array, 'isArray'); + + /** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */ + var isArray = nativeIsArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; + }; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); + } + + module.exports = isArray; + + +/***/ }, +/* 368 */ +/***/ function(module, exports) { + + /** + * Safe chained function + * + * Will only create a new function if needed, + * otherwise will pass back existing functions or null. + * + * @returns {function|null} + */ + "use strict"; + + function createChainedFunction() { + var args = arguments; + return function chainedFunction() { + for (var i = 0; i < args.length; i++) { + if (args[i] && args[i].apply) { + args[i].apply(this, arguments); + } + } + }; + } + + module.exports = createChainedFunction; + +/***/ }, +/* 369 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports['default'] = addEventListenerWrap; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _addDomEventListener = __webpack_require__(370); + + var _addDomEventListener2 = _interopRequireDefault(_addDomEventListener); + + var _reactDom = __webpack_require__(347); + + var _reactDom2 = _interopRequireDefault(_reactDom); + + function addEventListenerWrap(target, eventType, cb) { + /* eslint camelcase: 2 */ + var callback = _reactDom2['default'].unstable_batchedUpdates ? function run(e) { + _reactDom2['default'].unstable_batchedUpdates(cb, e); + } : cb; + return (0, _addDomEventListener2['default'])(target, eventType, callback); + } + + module.exports = exports['default']; + +/***/ }, +/* 370 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports['default'] = addEventListener; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _EventObject = __webpack_require__(371); + + var _EventObject2 = _interopRequireDefault(_EventObject); + + function addEventListener(target, eventType, callback) { + function wrapCallback(e) { + var ne = new _EventObject2['default'](e); + callback.call(target, ne); + } + + if (target.addEventListener) { + target.addEventListener(eventType, wrapCallback, false); + return { + remove: function remove() { + target.removeEventListener(eventType, wrapCallback, false); + } + }; + } else if (target.attachEvent) { + target.attachEvent('on' + eventType, wrapCallback); + return { + remove: function remove() { + target.detachEvent('on' + eventType, wrapCallback); + } + }; + } + } + + module.exports = exports['default']; + +/***/ }, +/* 371 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * @ignore + * event object for dom + * @author yiminghe@gmail.com + */ + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _EventBaseObject = __webpack_require__(372); + + var _EventBaseObject2 = _interopRequireDefault(_EventBaseObject); + + var _objectAssign = __webpack_require__(373); + + var _objectAssign2 = _interopRequireDefault(_objectAssign); + + var TRUE = true; + var FALSE = false; + var commonProps = ['altKey', 'bubbles', 'cancelable', 'ctrlKey', 'currentTarget', 'eventPhase', 'metaKey', 'shiftKey', 'target', 'timeStamp', 'view', 'type']; + + function isNullOrUndefined(w) { + return w === null || w === undefined; + } + + var eventNormalizers = [{ + reg: /^key/, + props: ['char', 'charCode', 'key', 'keyCode', 'which'], + fix: function fix(event, nativeEvent) { + if (isNullOrUndefined(event.which)) { + event.which = !isNullOrUndefined(nativeEvent.charCode) ? nativeEvent.charCode : nativeEvent.keyCode; + } + + // add metaKey to non-Mac browsers (use ctrl for PC 's and Meta for Macs) + if (event.metaKey === undefined) { + event.metaKey = event.ctrlKey; + } + } + }, { + reg: /^touch/, + props: ['touches', 'changedTouches', 'targetTouches'] + }, { + reg: /^hashchange$/, + props: ['newURL', 'oldURL'] + }, { + reg: /^gesturechange$/i, + props: ['rotation', 'scale'] + }, { + reg: /^(mousewheel|DOMMouseScroll)$/, + props: [], + fix: function fix(event, nativeEvent) { + var deltaX = undefined; + var deltaY = undefined; + var delta = undefined; + var wheelDelta = nativeEvent.wheelDelta; + var axis = nativeEvent.axis; + var wheelDeltaY = nativeEvent.wheelDeltaY; + var wheelDeltaX = nativeEvent.wheelDeltaX; + var detail = nativeEvent.detail; + + // ie/webkit + if (wheelDelta) { + delta = wheelDelta / 120; + } + + // gecko + if (detail) { + // press control e.detail == 1 else e.detail == 3 + delta = 0 - (detail % 3 === 0 ? detail / 3 : detail); + } + + // Gecko + if (axis !== undefined) { + if (axis === event.HORIZONTAL_AXIS) { + deltaY = 0; + deltaX = 0 - delta; + } else if (axis === event.VERTICAL_AXIS) { + deltaX = 0; + deltaY = delta; + } + } + + // Webkit + if (wheelDeltaY !== undefined) { + deltaY = wheelDeltaY / 120; + } + if (wheelDeltaX !== undefined) { + deltaX = -1 * wheelDeltaX / 120; + } + + // 默认 deltaY (ie) + if (!deltaX && !deltaY) { + deltaY = delta; + } + + if (deltaX !== undefined) { + /** + * deltaX of mousewheel event + * @property deltaX + * @member Event.DomEvent.Object + */ + event.deltaX = deltaX; + } + + if (deltaY !== undefined) { + /** + * deltaY of mousewheel event + * @property deltaY + * @member Event.DomEvent.Object + */ + event.deltaY = deltaY; + } + + if (delta !== undefined) { + /** + * delta of mousewheel event + * @property delta + * @member Event.DomEvent.Object + */ + event.delta = delta; + } + } + }, { + reg: /^mouse|contextmenu|click|mspointer|(^DOMMouseScroll$)/i, + props: ['buttons', 'clientX', 'clientY', 'button', 'offsetX', 'relatedTarget', 'which', 'fromElement', 'toElement', 'offsetY', 'pageX', 'pageY', 'screenX', 'screenY'], + fix: function fix(event, nativeEvent) { + var eventDoc = undefined; + var doc = undefined; + var body = undefined; + var target = event.target; + var button = nativeEvent.button; + + // Calculate pageX/Y if missing and clientX/Y available + if (target && isNullOrUndefined(event.pageX) && !isNullOrUndefined(nativeEvent.clientX)) { + eventDoc = target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + event.pageX = nativeEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = nativeEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // which for click: 1 === left; 2 === middle; 3 === right + // do not use button + if (!event.which && button !== undefined) { + if (button & 1) { + event.which = 1; + } else if (button & 2) { + event.which = 3; + } else if (button & 4) { + event.which = 2; + } else { + event.which = 0; + } + } + + // add relatedTarget, if necessary + if (!event.relatedTarget && event.fromElement) { + event.relatedTarget = event.fromElement === target ? event.toElement : event.fromElement; + } + + return event; + } + }]; + + function retTrue() { + return TRUE; + } + + function retFalse() { + return FALSE; + } + + function DomEventObject(nativeEvent) { + var type = nativeEvent.type; + + var isNative = typeof nativeEvent.stopPropagation === 'function' || typeof nativeEvent.cancelBubble === 'boolean'; + + _EventBaseObject2['default'].call(this); + + this.nativeEvent = nativeEvent; + + // in case dom event has been mark as default prevented by lower dom node + var isDefaultPrevented = retFalse; + if ('defaultPrevented' in nativeEvent) { + isDefaultPrevented = nativeEvent.defaultPrevented ? retTrue : retFalse; + } else if ('getPreventDefault' in nativeEvent) { + // https://bugzilla.mozilla.org/show_bug.cgi?id=691151 + isDefaultPrevented = nativeEvent.getPreventDefault() ? retTrue : retFalse; + } else if ('returnValue' in nativeEvent) { + isDefaultPrevented = nativeEvent.returnValue === FALSE ? retTrue : retFalse; + } + + this.isDefaultPrevented = isDefaultPrevented; + + var fixFns = []; + var fixFn = undefined; + var l = undefined; + var prop = undefined; + var props = commonProps.concat(); + + eventNormalizers.forEach(function (normalizer) { + if (type.match(normalizer.reg)) { + props = props.concat(normalizer.props); + if (normalizer.fix) { + fixFns.push(normalizer.fix); + } + } + }); + + l = props.length; + + // clone properties of the original event object + while (l) { + prop = props[--l]; + this[prop] = nativeEvent[prop]; + } + + // fix target property, if necessary + if (!this.target && isNative) { + this.target = nativeEvent.srcElement || document; // srcElement might not be defined either + } + + // check if target is a text node (safari) + if (this.target && this.target.nodeType === 3) { + this.target = this.target.parentNode; + } + + l = fixFns.length; + + while (l) { + fixFn = fixFns[--l]; + fixFn(this, nativeEvent); + } + + this.timeStamp = nativeEvent.timeStamp || Date.now(); + } + + var EventBaseObjectProto = _EventBaseObject2['default'].prototype; + + (0, _objectAssign2['default'])(DomEventObject.prototype, EventBaseObjectProto, { + constructor: DomEventObject, + + preventDefault: function preventDefault() { + var e = this.nativeEvent; + + // if preventDefault exists run it on the original event + if (e.preventDefault) { + e.preventDefault(); + } else { + // otherwise set the returnValue property of the original event to FALSE (IE) + e.returnValue = FALSE; + } + + EventBaseObjectProto.preventDefault.call(this); + }, + + stopPropagation: function stopPropagation() { + var e = this.nativeEvent; + + // if stopPropagation exists run it on the original event + if (e.stopPropagation) { + e.stopPropagation(); + } else { + // otherwise set the cancelBubble property of the original event to TRUE (IE) + e.cancelBubble = TRUE; + } + + EventBaseObjectProto.stopPropagation.call(this); + } + }); + + exports['default'] = DomEventObject; + module.exports = exports['default']; + +/***/ }, +/* 372 */ +/***/ function(module, exports) { + + /** + * @ignore + * base event object for custom and dom event. + * @author yiminghe@gmail.com + */ + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + function returnFalse() { + return false; + } + + function returnTrue() { + return true; + } + + function EventBaseObject() { + this.timeStamp = Date.now(); + this.target = undefined; + this.currentTarget = undefined; + } + + EventBaseObject.prototype = { + isEventObject: 1, + + constructor: EventBaseObject, + + isDefaultPrevented: returnFalse, + + isPropagationStopped: returnFalse, + + isImmediatePropagationStopped: returnFalse, + + preventDefault: function preventDefault() { + this.isDefaultPrevented = returnTrue; + }, + + stopPropagation: function stopPropagation() { + this.isPropagationStopped = returnTrue; + }, + + stopImmediatePropagation: function stopImmediatePropagation() { + this.isImmediatePropagationStopped = returnTrue; + // fixed 1.2 + // call stopPropagation implicitly + this.stopPropagation(); + }, + + halt: function halt(immediate) { + if (immediate) { + this.stopImmediatePropagation(); + } else { + this.stopPropagation(); + } + this.preventDefault(); + } + }; + + exports["default"] = EventBaseObject; + module.exports = exports["default"]; + +/***/ }, +/* 373 */ +/***/ function(module, exports) { + + /* eslint-disable no-unused-vars */ + 'use strict'; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + module.exports = Object.assign || function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (Object.getOwnPropertySymbols) { + symbols = Object.getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; + }; + + +/***/ }, +/* 374 */ +/***/ function(module, exports) { + + "use strict"; + + module.exports = function contains(root, n) { + var node = n; + while (node) { + if (node === root) { + return true; + } + node = node.parentNode; + } + + return false; + }; + +/***/ }, +/* 375 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var React = __webpack_require__(191); + + module.exports = function toArray(children) { + var ret = []; + React.Children.forEach(children, function each(c) { + ret.push(c); + }); + return ret; + }; + +/***/ }, +/* 376 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var React = __webpack_require__(191); + + function mirror(o) { + return o; + } + + module.exports = function mapSelf(children) { + // return ReactFragment + return React.Children.map(children, mirror); + }; + +/***/ }, +/* 377 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var Track = function Track(_ref) { + var className = _ref.className; + var included = _ref.included; + var offset = _ref.offset; + var length = _ref.length; + + var style = { + left: offset + '%', + width: length + '%', + visibility: included ? 'visible' : 'hidden' + }; + return _react2['default'].createElement('div', { className: className, style: style }); + }; + + exports['default'] = Track; + module.exports = exports['default']; + +/***/ }, +/* 378 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + 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; }; })(); + + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + 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; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _rcTooltip = __webpack_require__(379); + + var _rcTooltip2 = _interopRequireDefault(_rcTooltip); + + var Handle = (function (_React$Component) { + _inherits(Handle, _React$Component); + + function Handle(props) { + _classCallCheck(this, Handle); + + _get(Object.getPrototypeOf(Handle.prototype), 'constructor', this).call(this, props); + + this.state = { + isTooltipVisible: false + }; + } + + _createClass(Handle, [{ + key: 'showTooltip', + value: function showTooltip() { + this.setState({ + isTooltipVisible: true + }); + } + }, { + key: 'hideTooltip', + value: function hideTooltip() { + this.setState({ + isTooltipVisible: false + }); + } + }, { + key: 'render', + value: function render() { + var props = this.props; + var className = props.className; + var tipTransitionName = props.tipTransitionName; + var tipFormatter = props.tipFormatter; + var offset = props.offset; + var value = props.value; + var dragging = props.dragging; + var noTip = props.noTip; + + var style = { left: offset + '%' }; + var handle = _react2['default'].createElement('div', { className: className, style: style, + onMouseUp: this.showTooltip.bind(this), + onMouseEnter: this.showTooltip.bind(this), + onMouseLeave: this.hideTooltip.bind(this) }); + + if (noTip) { + return handle; + } + + var isTooltipVisible = dragging || this.state.isTooltipVisible; + return _react2['default'].createElement( + _rcTooltip2['default'], + { + prefixCls: className.replace('slider-handle', 'tooltip'), + placement: 'top', + visible: isTooltipVisible, + overlay: _react2['default'].createElement( + 'span', + null, + tipFormatter(value) + ), + delay: 0, + transitionName: tipTransitionName }, + handle + ); + } + }]); + + return Handle; + })(_react2['default'].Component); + + exports['default'] = Handle; + + Handle.propTypes = { + className: _react2['default'].PropTypes.string, + offset: _react2['default'].PropTypes.number, + tipTransitionName: _react2['default'].PropTypes.string, + tipFormatter: _react2['default'].PropTypes.func, + value: _react2['default'].PropTypes.number, + dragging: _react2['default'].PropTypes.bool, + noTip: _react2['default'].PropTypes.bool + }; + module.exports = exports['default']; + +/***/ }, +/* 379 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(380); + +/***/ }, +/* 380 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + 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; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _placements = __webpack_require__(381); + + var _rcTrigger = __webpack_require__(382); + + var _rcTrigger2 = _interopRequireDefault(_rcTrigger); + + var Tooltip = _react2['default'].createClass({ + displayName: 'Tooltip', + + propTypes: { + trigger: _react.PropTypes.any, + children: _react.PropTypes.any, + defaultVisible: _react.PropTypes.bool, + visible: _react.PropTypes.bool, + placement: _react.PropTypes.string, + transitionName: _react.PropTypes.string, + animation: _react.PropTypes.any, + onVisibleChange: _react.PropTypes.func, + afterVisibleChange: _react.PropTypes.func, + overlay: _react.PropTypes.node.isRequired, + overlayStyle: _react.PropTypes.object, + overlayClassName: _react.PropTypes.string, + prefixCls: _react.PropTypes.string, + mouseEnterDelay: _react.PropTypes.number, + mouseLeaveDelay: _react.PropTypes.number, + getTooltipContainer: _react.PropTypes.func, + destroyTooltipOnHide: _react.PropTypes.bool, + align: _react.PropTypes.shape({ + offset: _react.PropTypes.array, + targetOffset: _react.PropTypes.array + }), + arrowContent: _react.PropTypes.any + }, + + getDefaultProps: function getDefaultProps() { + return { + prefixCls: 'rc-tooltip', + mouseEnterDelay: 0, + destroyTooltipOnHide: false, + mouseLeaveDelay: 0.1, + align: {}, + placement: 'right', + trigger: ['hover'], + arrowContent: null + }; + }, + + getPopupElement: function getPopupElement() { + var _props = this.props; + var arrowContent = _props.arrowContent; + var overlay = _props.overlay; + var prefixCls = _props.prefixCls; + + return [_react2['default'].createElement( + 'div', + { className: prefixCls + '-arrow', key: 'arrow' }, + arrowContent + ), _react2['default'].createElement( + 'div', + { className: prefixCls + '-inner', key: 'content' }, + overlay + )]; + }, + + getPopupDomNode: function getPopupDomNode() { + return this.refs.trigger.popupDomNode; + }, + + render: function render() { + var _props2 = this.props; + var overlayClassName = _props2.overlayClassName; + var trigger = _props2.trigger; + var mouseEnterDelay = _props2.mouseEnterDelay; + var mouseLeaveDelay = _props2.mouseLeaveDelay; + var overlayStyle = _props2.overlayStyle; + var prefixCls = _props2.prefixCls; + var children = _props2.children; + var onVisibleChange = _props2.onVisibleChange; + var transitionName = _props2.transitionName; + var animation = _props2.animation; + var placement = _props2.placement; + var align = _props2.align; + var destroyTooltipOnHide = _props2.destroyTooltipOnHide; + var defaultVisible = _props2.defaultVisible; + var getTooltipContainer = _props2.getTooltipContainer; + + var extraProps = {}; + if ('visible' in this.props) { + extraProps.popupVisible = this.props.visible; + } + return _react2['default'].createElement( + _rcTrigger2['default'], + _extends({ popupClassName: overlayClassName, + ref: 'trigger', + prefixCls: prefixCls, + popup: this.getPopupElement(), + action: trigger, + builtinPlacements: _placements.placements, + popupPlacement: placement, + popupAlign: align, + getPopupContainer: getTooltipContainer, + onPopupVisibleChange: onVisibleChange, + popupTransitionName: transitionName, + popupAnimation: animation, + defaultPopupVisible: defaultVisible, + destroyPopupOnHide: destroyTooltipOnHide, + mouseLeaveDelay: mouseLeaveDelay, + popupStyle: overlayStyle, + mouseEnterDelay: mouseEnterDelay + }, extraProps), + children + ); + } + }); + + exports['default'] = Tooltip; + module.exports = exports['default']; + +/***/ }, +/* 381 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + var autoAdjustOverflow = { + adjustX: 1, + adjustY: 1 + }; + + var targetOffset = [0, 0]; + + var placements = { + left: { + points: ['cr', 'cl'], + overflow: autoAdjustOverflow, + offset: [-3, 0], + targetOffset: targetOffset + }, + right: { + points: ['cl', 'cr'], + overflow: autoAdjustOverflow, + offset: [3, 0], + targetOffset: targetOffset + }, + top: { + points: ['bc', 'tc'], + overflow: autoAdjustOverflow, + offset: [0, -3], + targetOffset: targetOffset + }, + bottom: { + points: ['tc', 'bc'], + overflow: autoAdjustOverflow, + offset: [0, 3], + targetOffset: targetOffset + }, + topLeft: { + points: ['bl', 'tl'], + overflow: autoAdjustOverflow, + offset: [0, -3], + targetOffset: targetOffset + }, + leftTop: { + points: ['tr', 'tl'], + overflow: autoAdjustOverflow, + offset: [-3, 0], + targetOffset: targetOffset + }, + topRight: { + points: ['br', 'tr'], + overflow: autoAdjustOverflow, + offset: [0, -3], + targetOffset: targetOffset + }, + rightTop: { + points: ['tl', 'tr'], + overflow: autoAdjustOverflow, + offset: [3, 0], + targetOffset: targetOffset + }, + bottomRight: { + points: ['tr', 'br'], + overflow: autoAdjustOverflow, + offset: [0, 3], + targetOffset: targetOffset + }, + rightBottom: { + points: ['bl', 'br'], + overflow: autoAdjustOverflow, + offset: [3, 0], + targetOffset: targetOffset + }, + bottomLeft: { + points: ['tl', 'bl'], + overflow: autoAdjustOverflow, + offset: [0, 3], + targetOffset: targetOffset + }, + leftBottom: { + points: ['br', 'bl'], + overflow: autoAdjustOverflow, + offset: [-3, 0], + targetOffset: targetOffset + } + }; + + exports.placements = placements; + exports['default'] = placements; + +/***/ }, +/* 382 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(383); + +/***/ }, +/* 383 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + 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; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _reactDom = __webpack_require__(347); + + var _reactDom2 = _interopRequireDefault(_reactDom); + + var _rcUtil = __webpack_require__(354); + + var _Popup = __webpack_require__(384); + + var _Popup2 = _interopRequireDefault(_Popup); + + var _utils = __webpack_require__(405); + + function noop() {} + + function returnEmptyString() { + return ''; + } + + var Trigger = _react2['default'].createClass({ + displayName: 'Trigger', + + propTypes: { + action: _react.PropTypes.any, + getPopupClassNameFromAlign: _react.PropTypes.any, + onPopupVisibleChange: _react.PropTypes.func, + afterPopupVisibleChange: _react.PropTypes.func, + popup: _react.PropTypes.node.isRequired, + popupStyle: _react.PropTypes.object, + popupClassName: _react.PropTypes.string, + popupPlacement: _react.PropTypes.string, + builtinPlacements: _react.PropTypes.object, + popupTransitionName: _react.PropTypes.string, + popupAnimation: _react.PropTypes.any, + mouseEnterDelay: _react.PropTypes.number, + mouseLeaveDelay: _react.PropTypes.number, + getPopupContainer: _react.PropTypes.func, + destroyPopupOnHide: _react.PropTypes.bool, + popupAlign: _react.PropTypes.object, + popupVisible: _react.PropTypes.bool + }, + + getDefaultProps: function getDefaultProps() { + return { + prefixCls: 'rc-trigger-popup', + getPopupClassNameFromAlign: returnEmptyString, + onPopupVisibleChange: noop, + afterPopupVisibleChange: noop, + popupClassName: '', + mouseEnterDelay: 0, + mouseLeaveDelay: 0.1, + popupStyle: {}, + destroyPopupOnHide: false, + popupAlign: {}, + defaultPopupVisible: false, + action: [] + }; + }, + + getInitialState: function getInitialState() { + var props = this.props; + var popupVisible = undefined; + if ('popupVisible' in props) { + popupVisible = !!props.popupVisible; + } else { + popupVisible = !!props.defaultPopupVisible; + } + return { popupVisible: popupVisible }; + }, + + componentDidMount: function componentDidMount() { + this.componentDidUpdate({}, { + popupVisible: this.state.popupVisible + }); + }, + + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + if ('popupVisible' in nextProps) { + this.setState({ + popupVisible: !!nextProps.popupVisible + }); + } + }, + + componentDidUpdate: function componentDidUpdate(prevProps, prevState) { + var _this = this; + + var props = this.props; + var state = this.state; + if (this.popupRendered) { + var _ret = (function () { + var self = _this; + _reactDom2['default'].unstable_renderSubtreeIntoContainer(_this, _this.getPopupElement(), _this.getPopupContainer(), function renderPopup() { + if (this.isMounted()) { + self.popupDomNode = _reactDom2['default'].findDOMNode(this); + } else { + self.popupDomNode = null; + } + if (prevState.popupVisible !== state.popupVisible) { + props.afterPopupVisibleChange(state.popupVisible); + } + }); + if (props.action.indexOf('click') !== -1) { + if (state.popupVisible) { + if (!_this.clickOutsideHandler) { + _this.clickOutsideHandler = _rcUtil.Dom.addEventListener(document, 'mousedown', _this.onDocumentClick); + _this.touchOutsideHandler = _rcUtil.Dom.addEventListener(document, 'touchstart', _this.onDocumentClick); + } + return { + v: undefined + }; + } + } + if (_this.clickOutsideHandler) { + _this.clickOutsideHandler.remove(); + _this.touchOutsideHandler.remove(); + _this.clickOutsideHandler = null; + _this.touchOutsideHandler = null; + } + })(); + + if (typeof _ret === 'object') return _ret.v; + } + }, + + componentWillUnmount: function componentWillUnmount() { + var popupContainer = this.popupContainer; + if (popupContainer) { + _reactDom2['default'].unmountComponentAtNode(popupContainer); + if (this.props.getPopupContainer) { + var mountNode = this.props.getPopupContainer(); + mountNode.removeChild(popupContainer); + } else { + document.body.removeChild(popupContainer); + } + this.popupContainer = null; + } + if (this.delayTimer) { + clearTimeout(this.delayTimer); + this.delayTimer = null; + } + if (this.clickOutsideHandler) { + this.clickOutsideHandler.remove(); + this.touchOutsideHandler.remove(); + this.clickOutsideHandler = null; + this.touchOutsideHandler = null; + } + }, + + onMouseEnter: function onMouseEnter() { + this.delaySetPopupVisible(true, this.props.mouseEnterDelay); + }, + + onMouseLeave: function onMouseLeave() { + this.delaySetPopupVisible(false, this.props.mouseLeaveDelay); + }, + + onFocus: function onFocus() { + this.focusTime = Date.now(); + this.setPopupVisible(true); + }, + + onMouseDown: function onMouseDown() { + this.preClickTime = Date.now(); + }, + + onTouchStart: function onTouchStart() { + this.preTouchTime = Date.now(); + }, + + onBlur: function onBlur() { + this.setPopupVisible(false); + }, + + onClick: function onClick(event) { + // focus will trigger click + if (this.focusTime) { + var preTime = undefined; + if (this.preClickTime && this.preTouchTime) { + preTime = Math.min(this.preClickTime, this.preTouchTime); + } else if (this.preClickTime) { + preTime = this.preClickTime; + } else if (this.preTouchTime) { + preTime = this.preTouchTime; + } + if (Math.abs(preTime - this.focusTime) < 20) { + return; + } + this.focusTime = 0; + } + this.preClickTime = 0; + this.preTouchTime = 0; + event.preventDefault(); + this.setPopupVisible(!this.state.popupVisible); + }, + + onDocumentClick: function onDocumentClick(event) { + var target = event.target; + var root = _reactDom2['default'].findDOMNode(this); + var popupNode = this.getPopupDomNode(); + if (!_rcUtil.Dom.contains(root, target) && !_rcUtil.Dom.contains(popupNode, target)) { + this.setPopupVisible(false); + } + }, + + getPopupDomNode: function getPopupDomNode() { + // for test + return this.popupDomNode; + }, + + getPopupContainer: function getPopupContainer() { + if (!this.popupContainer) { + this.popupContainer = document.createElement('div'); + if (this.props.getPopupContainer) { + var mountNode = this.props.getPopupContainer(); + mountNode.appendChild(this.popupContainer); + } else { + document.body.appendChild(this.popupContainer); + } + } + return this.popupContainer; + }, + + getPopupClassNameFromAlign: function getPopupClassNameFromAlign(align) { + var className = []; + var props = this.props; + var popupPlacement = props.popupPlacement; + var builtinPlacements = props.builtinPlacements; + var prefixCls = props.prefixCls; + + if (popupPlacement && builtinPlacements) { + className.push((0, _utils.getPopupClassNameFromAlign)(builtinPlacements, prefixCls, align)); + } + if (props.getPopupClassNameFromAlign) { + className.push(props.getPopupClassNameFromAlign(align)); + } + return className.join(' '); + }, + + getPopupAlign: function getPopupAlign() { + var props = this.props; + var popupPlacement = props.popupPlacement; + var popupAlign = props.popupAlign; + var builtinPlacements = props.builtinPlacements; + + if (popupPlacement && builtinPlacements) { + return (0, _utils.getAlignFromPlacement)(builtinPlacements, popupPlacement, popupAlign); + } + return popupAlign; + }, + + getPopupElement: function getPopupElement() { + var props = this.props; + var state = this.state; + var mouseProps = {}; + if (props.action.indexOf('hover') !== -1) { + mouseProps.onMouseEnter = this.onMouseEnter; + mouseProps.onMouseLeave = this.onMouseLeave; + } + return _react2['default'].createElement( + _Popup2['default'], + _extends({ prefixCls: props.prefixCls, + destroyPopupOnHide: props.destroyPopupOnHide, + visible: state.popupVisible, + className: props.popupClassName, + action: props.action, + align: this.getPopupAlign(), + animation: props.popupAnimation, + getClassNameFromAlign: this.getPopupClassNameFromAlign + }, mouseProps, { + wrap: this, + style: props.popupStyle, + transitionName: props.popupTransitionName }), + props.popup + ); + }, + + setPopupVisible: function setPopupVisible(popupVisible) { + if (this.state.popupVisible !== popupVisible) { + if (!('popupVisible' in this.props)) { + this.setState({ + popupVisible: popupVisible + }); + } + this.props.onPopupVisibleChange(popupVisible); + } + }, + + delaySetPopupVisible: function delaySetPopupVisible(visible, delayS) { + var _this2 = this; + + var delay = delayS * 1000; + if (this.delayTimer) { + clearTimeout(this.delayTimer); + this.delayTimer = null; + } + if (delay) { + this.delayTimer = setTimeout(function () { + _this2.setPopupVisible(visible); + _this2.delayTimer = null; + }, delay); + } else { + this.setPopupVisible(visible); + } + }, + + render: function render() { + this.popupRendered = this.popupRendered || this.state.popupVisible; + var props = this.props; + var children = props.children; + var child = _react2['default'].Children.only(children); + var childProps = child.props || {}; + var newChildProps = {}; + var trigger = props.action; + if (trigger.indexOf('click') !== -1) { + newChildProps.onClick = (0, _rcUtil.createChainedFunction)(this.onClick, childProps.onClick); + newChildProps.onMouseDown = (0, _rcUtil.createChainedFunction)(this.onMouseDown, childProps.onMouseDown); + newChildProps.onTouchStart = (0, _rcUtil.createChainedFunction)(this.onTouchStart, childProps.onTouchStart); + } + if (trigger.indexOf('hover') !== -1) { + newChildProps.onMouseEnter = (0, _rcUtil.createChainedFunction)(this.onMouseEnter, childProps.onMouseEnter); + newChildProps.onMouseLeave = (0, _rcUtil.createChainedFunction)(this.onMouseLeave, childProps.onMouseLeave); + } + if (trigger.indexOf('focus') !== -1) { + newChildProps.onFocus = (0, _rcUtil.createChainedFunction)(this.onFocus, childProps.onFocus); + newChildProps.onBlur = (0, _rcUtil.createChainedFunction)(this.onBlur, childProps.onBlur); + } + + return _react2['default'].cloneElement(child, newChildProps); + } + }); + + exports['default'] = Trigger; + module.exports = exports['default']; + +/***/ }, +/* 384 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _reactDom = __webpack_require__(347); + + var _reactDom2 = _interopRequireDefault(_reactDom); + + var _rcAlign = __webpack_require__(385); + + var _rcAlign2 = _interopRequireDefault(_rcAlign); + + var _rcAnimate = __webpack_require__(396); + + var _rcAnimate2 = _interopRequireDefault(_rcAnimate); + + var _PopupInner = __webpack_require__(404); + + var _PopupInner2 = _interopRequireDefault(_PopupInner); + + var Popup = _react2['default'].createClass({ + displayName: 'Popup', + + propTypes: { + visible: _react.PropTypes.bool, + wrap: _react.PropTypes.object, + style: _react.PropTypes.object, + getClassNameFromAlign: _react.PropTypes.func, + onMouseEnter: _react.PropTypes.func, + className: _react.PropTypes.string, + onMouseLeave: _react.PropTypes.func + }, + + componentDidMount: function componentDidMount() { + this.rootNode = this.getPopupDomNode(); + }, + + onAlign: function onAlign(popupDomNode, align) { + var props = this.props; + var alignClassName = props.getClassNameFromAlign(props.align); + var currentAlignClassName = props.getClassNameFromAlign(align); + if (alignClassName !== currentAlignClassName) { + this.currentAlignClassName = currentAlignClassName; + popupDomNode.className = this.getClassName(currentAlignClassName); + } + }, + + getPopupDomNode: function getPopupDomNode() { + return _reactDom2['default'].findDOMNode(this); + }, + + getTarget: function getTarget() { + return _reactDom2['default'].findDOMNode(this.props.wrap); + }, + + getTransitionName: function getTransitionName() { + var props = this.props; + var transitionName = props.transitionName; + if (!transitionName && props.animation) { + transitionName = props.prefixCls + '-' + props.animation; + } + return transitionName; + }, + + getClassName: function getClassName(currentAlignClassName) { + var props = this.props; + var prefixCls = props.prefixCls; + + var className = prefixCls + ' ' + props.className + ' '; + className += currentAlignClassName; + return className; + }, + + render: function render() { + var props = this.props; + var align = props.align; + var style = props.style; + var visible = props.visible; + var prefixCls = props.prefixCls; + var destroyPopupOnHide = props.destroyPopupOnHide; + + var className = this.getClassName(this.currentAlignClassName || props.getClassNameFromAlign(align)); + var hiddenClassName = prefixCls + '-hidden'; + if (!visible) { + this.currentAlignClassName = null; + } + if (destroyPopupOnHide) { + return _react2['default'].createElement( + _rcAnimate2['default'], + { component: '', + exclusive: true, + transitionAppear: true, + transitionName: this.getTransitionName() }, + visible ? _react2['default'].createElement( + _rcAlign2['default'], + { target: this.getTarget, + key: 'popup', + monitorWindowResize: true, + align: align, + onAlign: this.onAlign }, + _react2['default'].createElement( + _PopupInner2['default'], + { className: className, + visible: true, + onMouseEnter: props.onMouseEnter, + onMouseLeave: props.onMouseLeave, + style: style }, + props.children + ) + ) : null + ); + } + return _react2['default'].createElement( + _rcAnimate2['default'], + { component: '', + exclusive: true, + transitionAppear: true, + transitionName: this.getTransitionName(), + showProp: 'xVisible' }, + _react2['default'].createElement( + _rcAlign2['default'], + { target: this.getTarget, + key: 'popup', + monitorWindowResize: true, + xVisible: visible, + childrenProps: { + visible: 'xVisible' + }, + disabled: !visible, + align: align, + onAlign: this.onAlign }, + _react2['default'].createElement( + _PopupInner2['default'], + { className: className, + hiddenClassName: hiddenClassName, + onMouseEnter: props.onMouseEnter, + onMouseLeave: props.onMouseLeave, + style: style }, + props.children + ) + ) + ); + } + }); + + exports['default'] = Popup; + module.exports = exports['default']; + +/***/ }, +/* 385 */ +/***/ function(module, exports, __webpack_require__) { + + // export this package's api + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _Align = __webpack_require__(386); + + var _Align2 = _interopRequireDefault(_Align); + + exports['default'] = _Align2['default']; + module.exports = exports['default']; + +/***/ }, +/* 386 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _reactDom = __webpack_require__(347); + + var _reactDom2 = _interopRequireDefault(_reactDom); + + var _domAlign = __webpack_require__(387); + + var _domAlign2 = _interopRequireDefault(_domAlign); + + var _rcUtil = __webpack_require__(354); + + var _isWindow = __webpack_require__(395); + + var _isWindow2 = _interopRequireDefault(_isWindow); + + function buffer(fn, ms) { + var timer = undefined; + return function bufferFn() { + if (timer) { + clearTimeout(timer); + } + timer = setTimeout(fn, ms); + }; + } + + var Align = _react2['default'].createClass({ + displayName: 'Align', + + propTypes: { + childrenProps: _react.PropTypes.object, + align: _react.PropTypes.object.isRequired, + target: _react.PropTypes.func, + onAlign: _react.PropTypes.func, + monitorBufferTime: _react.PropTypes.number, + monitorWindowResize: _react.PropTypes.bool, + disabled: _react.PropTypes.bool, + children: _react.PropTypes.any + }, + + getDefaultProps: function getDefaultProps() { + return { + target: function target() { + return window; + }, + onAlign: function onAlign() {}, + monitorBufferTime: 50, + monitorWindowResize: false, + disabled: false + }; + }, + + componentDidMount: function componentDidMount() { + var props = this.props; + // if parent ref not attached .... use document.getElementById + if (!props.disabled) { + var source = _reactDom2['default'].findDOMNode(this); + props.onAlign(source, (0, _domAlign2['default'])(source, props.target(), props.align)); + if (props.monitorWindowResize) { + this.startMonitorWindowResize(); + } + } + }, + + componentDidUpdate: function componentDidUpdate(prevProps) { + var reAlign = false; + var props = this.props; + var currentTarget = undefined; + + if (!props.disabled) { + if (prevProps.disabled || prevProps.align !== props.align) { + reAlign = true; + currentTarget = props.target(); + } else { + var lastTarget = prevProps.target(); + currentTarget = props.target(); + if ((0, _isWindow2['default'])(lastTarget) && (0, _isWindow2['default'])(currentTarget)) { + reAlign = false; + } else if (lastTarget !== currentTarget) { + reAlign = true; + } + } + } + + if (reAlign) { + var source = _reactDom2['default'].findDOMNode(this); + props.onAlign(source, (0, _domAlign2['default'])(source, currentTarget, props.align)); + } + + if (props.monitorWindowResize && !props.disabled) { + this.startMonitorWindowResize(); + } else { + this.stopMonitorWindowResize(); + } + }, + + componentWillUnmount: function componentWillUnmount() { + this.stopMonitorWindowResize(); + }, + + onWindowResize: function onWindowResize() { + var props = this.props; + if (!props.disabled) { + var source = _reactDom2['default'].findDOMNode(this); + props.onAlign(source, (0, _domAlign2['default'])(source, props.target(), props.align)); + } + }, + + startMonitorWindowResize: function startMonitorWindowResize() { + if (!this.resizeHandler) { + this.resizeHandler = _rcUtil.Dom.addEventListener(window, 'resize', buffer(this.onWindowResize, this.props.monitorBufferTime)); + } + }, + + stopMonitorWindowResize: function stopMonitorWindowResize() { + if (this.resizeHandler) { + this.resizeHandler.remove(); + this.resizeHandler = null; + } + }, + + render: function render() { + var _props = this.props; + var childrenProps = _props.childrenProps; + var children = _props.children; + + var child = _react2['default'].Children.only(children); + if (childrenProps) { + var newProps = {}; + for (var prop in childrenProps) { + if (childrenProps.hasOwnProperty(prop)) { + newProps[prop] = this.props[childrenProps[prop]]; + } + } + return _react2['default'].cloneElement(child, newProps); + } + return child; + } + }); + + exports['default'] = Align; + module.exports = exports['default']; + +/***/ }, +/* 387 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * align dom node flexibly + * @author yiminghe@gmail.com + */ + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _utils = __webpack_require__(388); + + var _utils2 = _interopRequireDefault(_utils); + + var _getOffsetParent = __webpack_require__(389); + + var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent); + + var _getVisibleRectForElement = __webpack_require__(390); + + var _getVisibleRectForElement2 = _interopRequireDefault(_getVisibleRectForElement); + + var _adjustForViewport = __webpack_require__(391); + + var _adjustForViewport2 = _interopRequireDefault(_adjustForViewport); + + var _getRegion = __webpack_require__(392); + + var _getRegion2 = _interopRequireDefault(_getRegion); + + var _getElFuturePos = __webpack_require__(393); + + var _getElFuturePos2 = _interopRequireDefault(_getElFuturePos); + + // http://yiminghe.iteye.com/blog/1124720 + + function isFailX(elFuturePos, elRegion, visibleRect) { + return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right; + } + + function isFailY(elFuturePos, elRegion, visibleRect) { + return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom; + } + + function flip(points, reg, map) { + var ret = []; + _utils2['default'].each(points, function (p) { + ret.push(p.replace(reg, function (m) { + return map[m]; + })); + }); + return ret; + } + + function flipOffset(offset, index) { + offset[index] = -offset[index]; + return offset; + } + + function convertOffset(str, offsetLen) { + var n = undefined; + if (/%$/.test(str)) { + n = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen; + } else { + n = parseInt(str, 10); + } + return n || 0; + } + + function normalizeOffset(offset, el) { + offset[0] = convertOffset(offset[0], el.width); + offset[1] = convertOffset(offset[1], el.height); + } + + function domAlign(el, refNode, align) { + var points = align.points; + var offset = align.offset || [0, 0]; + var targetOffset = align.targetOffset || [0, 0]; + var overflow = align.overflow; + var target = align.target || refNode; + var source = align.source || el; + offset = [].concat(offset); + targetOffset = [].concat(targetOffset); + overflow = overflow || {}; + var newOverflowCfg = {}; + + var fail = 0; + // 当前节点可以被放置的显示区域 + var visibleRect = (0, _getVisibleRectForElement2['default'])(source); + // 当前节点所占的区域, left/top/width/height + var elRegion = (0, _getRegion2['default'])(source); + // 参照节点所占的区域, left/top/width/height + var refNodeRegion = (0, _getRegion2['default'])(target); + // 将 offset 转换成数值,支持百分比 + normalizeOffset(offset, elRegion); + normalizeOffset(targetOffset, refNodeRegion); + // 当前节点将要被放置的位置 + var elFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, points, offset, targetOffset); + // 当前节点将要所处的区域 + var newElRegion = _utils2['default'].merge(elRegion, elFuturePos); + + // 如果可视区域不能完全放置当前节点时允许调整 + if (visibleRect && (overflow.adjustX || overflow.adjustY)) { + if (overflow.adjustX) { + // 如果横向不能放下 + if (isFailX(elFuturePos, elRegion, visibleRect)) { + fail = 1; + // 对齐位置反下 + points = flip(points, /[lr]/ig, { + l: 'r', + r: 'l' + }); + // 偏移量也反下 + offset = flipOffset(offset, 0); + targetOffset = flipOffset(targetOffset, 0); + } + } + + if (overflow.adjustY) { + // 如果纵向不能放下 + if (isFailY(elFuturePos, elRegion, visibleRect)) { + fail = 1; + // 对齐位置反下 + points = flip(points, /[tb]/ig, { + t: 'b', + b: 't' + }); + // 偏移量也反下 + offset = flipOffset(offset, 1); + targetOffset = flipOffset(targetOffset, 1); + } + } + + // 如果失败,重新计算当前节点将要被放置的位置 + if (fail) { + elFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, points, offset, targetOffset); + _utils2['default'].mix(newElRegion, elFuturePos); + } + + // 检查反下后的位置是否可以放下了 + // 如果仍然放不下只有指定了可以调整当前方向才调整 + newOverflowCfg.adjustX = overflow.adjustX && isFailX(elFuturePos, elRegion, visibleRect); + + newOverflowCfg.adjustY = overflow.adjustY && isFailY(elFuturePos, elRegion, visibleRect); + + // 确实要调整,甚至可能会调整高度宽度 + if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) { + newElRegion = (0, _adjustForViewport2['default'])(elFuturePos, elRegion, visibleRect, newOverflowCfg); + } + } + + // need judge to in case set fixed with in css on height auto element + if (newElRegion.width !== elRegion.width) { + _utils2['default'].css(source, 'width', source.width() + newElRegion.width - elRegion.width); + } + + if (newElRegion.height !== elRegion.height) { + _utils2['default'].css(source, 'height', source.height() + newElRegion.height - elRegion.height); + } + + // https://github.com/kissyteam/kissy/issues/190 + // http://localhost:8888/kissy/src/overlay/demo/other/relative_align/align.html + // 相对于屏幕位置没变,而 left/top 变了 + // 例如 <div 'relative'><el absolute></div> + _utils2['default'].offset(source, { + left: newElRegion.left, + top: newElRegion.top + }, { + useCssRight: align.useCssRight, + useCssBottom: align.useCssBottom + }); + + return { + points: points, + offset: offset, + targetOffset: targetOffset, + overflow: newOverflowCfg + }; + } + + domAlign.__getOffsetParent = _getOffsetParent2['default']; + + domAlign.__getVisibleRectForElement = _getVisibleRectForElement2['default']; + + exports['default'] = domAlign; + + /** + * 2012-04-26 yiminghe@gmail.com + * - 优化智能对齐算法 + * - 慎用 resizeXX + * + * 2011-07-13 yiminghe@gmail.com note: + * - 增加智能对齐,以及大小调整选项 + **/ + module.exports = exports['default']; + +/***/ }, +/* 388 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source; + + var getComputedStyleX = undefined; + + function css(el, name, v) { + var value = v; + if (typeof name === 'object') { + for (var i in name) { + if (name.hasOwnProperty(i)) { + css(el, i, name[i]); + } + } + return undefined; + } + if (typeof value !== 'undefined') { + if (typeof value === 'number') { + value = value + 'px'; + } + el.style[name] = value; + return undefined; + } + return getComputedStyleX(el, name); + } + + function getClientPosition(elem) { + var box = undefined; + var x = undefined; + var y = undefined; + var doc = elem.ownerDocument; + var body = doc.body; + var docElem = doc && doc.documentElement; + // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式 + box = elem.getBoundingClientRect(); + + // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop + // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确 + // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin + + x = box.left; + y = box.top; + + // In IE, most of the time, 2 extra pixels are added to the top and left + // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and + // IE6 standards mode, this border can be overridden by setting the + // document element's border to zero -- thus, we cannot rely on the + // offset always being 2 pixels. + + // In quirks mode, the offset can be determined by querying the body's + // clientLeft/clientTop, but in standards mode, it is found by querying + // the document element's clientLeft/clientTop. Since we already called + // getClientBoundingRect we have already forced a reflow, so it is not + // too expensive just to query them all. + + // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的 + // 窗口边框标准是设 documentElement ,quirks 时设置 body + // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去 + // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置 + // 标准 ie 下 docElem.clientTop 就是 border-top + // ie7 html 即窗口边框改变不了。永远为 2 + // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0 + + x -= docElem.clientLeft || body.clientLeft || 0; + y -= docElem.clientTop || body.clientTop || 0; + + return { left: x, top: y }; + } + + function getScroll(w, top) { + var ret = w['page' + (top ? 'Y' : 'X') + 'Offset']; + var method = 'scroll' + (top ? 'Top' : 'Left'); + if (typeof ret !== 'number') { + var d = w.document; + // ie6,7,8 standard mode + ret = d.documentElement[method]; + if (typeof ret !== 'number') { + // quirks mode + ret = d.body[method]; + } + } + return ret; + } + + function getScrollLeft(w) { + return getScroll(w); + } + + function getScrollTop(w) { + return getScroll(w, true); + } + + function getOffset(el) { + var pos = getClientPosition(el); + var doc = el.ownerDocument; + var w = doc.defaultView || doc.parentWindow; + pos.left += getScrollLeft(w); + pos.top += getScrollTop(w); + return pos; + } + function _getComputedStyle(elem, name, cs) { + var computedStyle = cs; + var val = ''; + var d = elem.ownerDocument; + computedStyle = computedStyle || d.defaultView.getComputedStyle(elem, null); + + // https://github.com/kissyteam/kissy/issues/61 + if (computedStyle) { + val = computedStyle.getPropertyValue(name) || computedStyle[name]; + } + + return val; + } + + var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i'); + var RE_POS = /^(top|right|bottom|left)$/; + var CURRENT_STYLE = 'currentStyle'; + var RUNTIME_STYLE = 'runtimeStyle'; + var LEFT = 'left'; + var PX = 'px'; + + function _getComputedStyleIE(elem, name) { + // currentStyle maybe null + // http://msdn.microsoft.com/en-us/library/ms535231.aspx + var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; + + // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值 + // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19 + // 在 ie 下不对,需要直接用 offset 方式 + // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了 + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + // exclude left right for relativity + if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) { + // Remember the original values + var style = elem.style; + var left = style[LEFT]; + var rsLeft = elem[RUNTIME_STYLE][LEFT]; + + // prevent flashing of content + elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; + + // Put in the new values to get a computed value out + style[LEFT] = name === 'fontSize' ? '1em' : ret || 0; + ret = style.pixelLeft + PX; + + // Revert the changed values + style[LEFT] = left; + + elem[RUNTIME_STYLE][LEFT] = rsLeft; + } + return ret === '' ? 'auto' : ret; + } + + if (typeof window !== 'undefined') { + getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE; + } + + function getOffsetDirection(dir, option) { + if (dir === 'left') { + return option.useCssRight ? 'right' : dir; + } + return option.useCssBottom ? 'bottom' : dir; + } + + function oppositeOffsetDirection(dir) { + if (dir === 'left') { + return 'right'; + } else if (dir === 'right') { + return 'left'; + } else if (dir === 'top') { + return 'bottom'; + } else if (dir === 'bottom') { + return 'top'; + } + } + + // 设置 elem 相对 elem.ownerDocument 的坐标 + function setOffset(elem, offset, option) { + // set position first, in-case top/left are set even on static elem + if (css(elem, 'position') === 'static') { + elem.style.position = 'relative'; + } + var presetH = -999; + var presetV = -999; + var horizontalProperty = getOffsetDirection('left', option); + var verticalProperty = getOffsetDirection('top', option); + var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty); + var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty); + + if (horizontalProperty !== 'left') { + presetH = 999; + } + + if (verticalProperty !== 'top') { + presetV = 999; + } + + if ('left' in offset) { + elem.style[oppositeHorizontalProperty] = ''; + elem.style[horizontalProperty] = presetH + 'px'; + } + if ('top' in offset) { + elem.style[oppositeVerticalProperty] = ''; + elem.style[verticalProperty] = presetV + 'px'; + } + var old = getOffset(elem); + var ret = {}; + var key = undefined; + for (key in offset) { + if (offset.hasOwnProperty(key)) { + var dir = getOffsetDirection(key, option); + var preset = key === 'left' ? presetH : presetV; + if (dir === key) { + ret[dir] = preset + offset[key] - old[key]; + } else { + ret[dir] = preset + old[key] - offset[key]; + } + } + } + css(elem, ret); + } + + function each(arr, fn) { + for (var i = 0; i < arr.length; i++) { + fn(arr[i]); + } + } + + function isBorderBoxFn(elem) { + return getComputedStyleX(elem, 'boxSizing') === 'border-box'; + } + + var BOX_MODELS = ['margin', 'border', 'padding']; + var CONTENT_INDEX = -1; + var PADDING_INDEX = 2; + var BORDER_INDEX = 1; + var MARGIN_INDEX = 0; + + function swap(elem, options, callback) { + var old = {}; + var style = elem.style; + var name = undefined; + + // Remember the old values, and insert the new ones + for (name in options) { + if (options.hasOwnProperty(name)) { + old[name] = style[name]; + style[name] = options[name]; + } + } + + callback.call(elem); + + // Revert the old values + for (name in options) { + if (options.hasOwnProperty(name)) { + style[name] = old[name]; + } + } + } + + function getPBMWidth(elem, props, which) { + var value = 0; + var prop = undefined; + var j = undefined; + var i = undefined; + for (j = 0; j < props.length; j++) { + prop = props[j]; + if (prop) { + for (i = 0; i < which.length; i++) { + var cssProp = undefined; + if (prop === 'border') { + cssProp = prop + which[i] + 'Width'; + } else { + cssProp = prop + which[i]; + } + value += parseFloat(getComputedStyleX(elem, cssProp)) || 0; + } + } + } + return value; + } + + /** + * A crude way of determining if an object is a window + * @member util + */ + function isWindow(obj) { + // must use == for ie8 + /* eslint eqeqeq:0 */ + return obj !== null && obj !== undefined && obj == obj.window; + } + + var domUtils = {}; + + each(['Width', 'Height'], function (name) { + domUtils['doc' + name] = function (refWin) { + var d = refWin.document; + return Math.max( + // firefox chrome documentElement.scrollHeight< body.scrollHeight + // ie standard mode : documentElement.scrollHeight> body.scrollHeight + d.documentElement['scroll' + name], + // quirks : documentElement.scrollHeight 最大等于可视窗口多一点? + d.body['scroll' + name], domUtils['viewport' + name](d)); + }; + + domUtils['viewport' + name] = function (win) { + // pc browser includes scrollbar in window.innerWidth + var prop = 'client' + name; + var doc = win.document; + var body = doc.body; + var documentElement = doc.documentElement; + var documentElementProp = documentElement[prop]; + // 标准模式取 documentElement + // backcompat 取 body + return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp; + }; + }); + + /* + 得到元素的大小信息 + @param elem + @param name + @param {String} [extra] 'padding' : (css width) + padding + 'border' : (css width) + padding + border + 'margin' : (css width) + padding + border + margin + */ + function getWH(elem, name, ex) { + var extra = ex; + if (isWindow(elem)) { + return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem); + } else if (elem.nodeType === 9) { + return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem); + } + var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; + var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight; + var computedStyle = getComputedStyleX(elem); + var isBorderBox = isBorderBoxFn(elem, computedStyle); + var cssBoxValue = 0; + if (borderBoxValue === null || borderBoxValue === undefined || borderBoxValue <= 0) { + borderBoxValue = undefined; + // Fall back to computed then un computed css if necessary + cssBoxValue = getComputedStyleX(elem, name); + if (cssBoxValue === null || cssBoxValue === undefined || Number(cssBoxValue) < 0) { + cssBoxValue = elem.style[name] || 0; + } + // Normalize '', auto, and prepare for extra + cssBoxValue = parseFloat(cssBoxValue) || 0; + } + if (extra === undefined) { + extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX; + } + var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox; + var val = borderBoxValue || cssBoxValue; + if (extra === CONTENT_INDEX) { + if (borderBoxValueOrIsBorderBox) { + return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle); + } + return cssBoxValue; + } else if (borderBoxValueOrIsBorderBox) { + if (extra === BORDER_INDEX) { + return val; + } + return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle)); + } + return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle); + } + + var cssShow = { position: 'absolute', visibility: 'hidden', display: 'block' }; + + // fix #119 : https://github.com/kissyteam/kissy/issues/119 + function getWHIgnoreDisplay() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var val = undefined; + var elem = args[0]; + // in case elem is window + // elem.offsetWidth === undefined + if (elem.offsetWidth !== 0) { + val = getWH.apply(undefined, args); + } else { + swap(elem, cssShow, function () { + val = getWH.apply(undefined, args); + }); + } + return val; + } + + each(['width', 'height'], function (name) { + var first = name.charAt(0).toUpperCase() + name.slice(1); + domUtils['outer' + first] = function (el, includeMargin) { + return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX); + }; + var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; + + domUtils[name] = function (elem, v) { + var val = v; + if (val !== undefined) { + if (elem) { + var computedStyle = getComputedStyleX(elem); + var isBorderBox = isBorderBoxFn(elem); + if (isBorderBox) { + val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle); + } + return css(elem, name, val); + } + return undefined; + } + return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX); + }; + }); + + function mix(to, from) { + for (var i in from) { + if (from.hasOwnProperty(i)) { + to[i] = from[i]; + } + } + return to; + } + + var utils = { + getWindow: function getWindow(node) { + if (node && node.document && node.setTimeout) { + return node; + } + var doc = node.ownerDocument || node; + return doc.defaultView || doc.parentWindow; + }, + offset: function offset(el, value, option) { + if (typeof value !== 'undefined') { + setOffset(el, value, option || {}); + } else { + return getOffset(el); + } + }, + isWindow: isWindow, + each: each, + css: css, + clone: function clone(obj) { + var i = undefined; + var ret = {}; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + ret[i] = obj[i]; + } + } + var overflow = obj.overflow; + if (overflow) { + for (i in obj) { + if (obj.hasOwnProperty(i)) { + ret.overflow[i] = obj.overflow[i]; + } + } + } + return ret; + }, + mix: mix, + getWindowScrollLeft: function getWindowScrollLeft(w) { + return getScrollLeft(w); + }, + getWindowScrollTop: function getWindowScrollTop(w) { + return getScrollTop(w); + }, + merge: function merge() { + var ret = {}; + + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + for (var i = 0; i < args.length; i++) { + utils.mix(ret, args[i]); + } + return ret; + }, + viewportWidth: 0, + viewportHeight: 0 + }; + + mix(utils, domUtils); + + exports['default'] = utils; + module.exports = exports['default']; + +/***/ }, +/* 389 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _utils = __webpack_require__(388); + + var _utils2 = _interopRequireDefault(_utils); + + /** + * 得到会导致元素显示不全的祖先元素 + */ + + function getOffsetParent(element) { + // ie 这个也不是完全可行 + /* + <div style="width: 50px;height: 100px;overflow: hidden"> + <div style="width: 50px;height: 100px;position: relative;" id="d6"> + 元素 6 高 100px 宽 50px<br/> + </div> + </div> + */ + // element.offsetParent does the right thing in ie7 and below. Return parent with layout! + // In other browsers it only includes elements with position absolute, relative or + // fixed, not elements with overflow set to auto or scroll. + // if (UA.ie && ieMode < 8) { + // return element.offsetParent; + // } + // 统一的 offsetParent 方法 + var doc = element.ownerDocument; + var body = doc.body; + var parent = undefined; + var positionStyle = _utils2['default'].css(element, 'position'); + var skipStatic = positionStyle === 'fixed' || positionStyle === 'absolute'; + + if (!skipStatic) { + return element.nodeName.toLowerCase() === 'html' ? null : element.parentNode; + } + + for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) { + positionStyle = _utils2['default'].css(parent, 'position'); + if (positionStyle !== 'static') { + return parent; + } + } + return null; + } + + exports['default'] = getOffsetParent; + module.exports = exports['default']; + +/***/ }, +/* 390 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _utils = __webpack_require__(388); + + var _utils2 = _interopRequireDefault(_utils); + + var _getOffsetParent = __webpack_require__(389); + + var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent); + + /** + * 获得元素的显示部分的区域 + */ + function getVisibleRectForElement(element) { + var visibleRect = { + left: 0, + right: Infinity, + top: 0, + bottom: Infinity + }; + var el = (0, _getOffsetParent2['default'])(element); + var scrollX = undefined; + var scrollY = undefined; + var winSize = undefined; + var doc = element.ownerDocument; + var win = doc.defaultView || doc.parentWindow; + var body = doc.body; + var documentElement = doc.documentElement; + + // Determine the size of the visible rect by climbing the dom accounting for + // all scrollable containers. + while (el) { + // clientWidth is zero for inline block elements in ie. + if ((navigator.userAgent.indexOf('MSIE') === -1 || el.clientWidth !== 0) && + // body may have overflow set on it, yet we still get the entire + // viewport. In some browsers, el.offsetParent may be + // document.documentElement, so check for that too. + el !== body && el !== documentElement && _utils2['default'].css(el, 'overflow') !== 'visible') { + var pos = _utils2['default'].offset(el); + // add border + pos.left += el.clientLeft; + pos.top += el.clientTop; + visibleRect.top = Math.max(visibleRect.top, pos.top); + visibleRect.right = Math.min(visibleRect.right, + // consider area without scrollBar + pos.left + el.clientWidth); + visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight); + visibleRect.left = Math.max(visibleRect.left, pos.left); + } else if (el === body || el === documentElement) { + break; + } + el = (0, _getOffsetParent2['default'])(el); + } + + // Clip by window's viewport. + scrollX = _utils2['default'].getWindowScrollLeft(win); + scrollY = _utils2['default'].getWindowScrollTop(win); + visibleRect.left = Math.max(visibleRect.left, scrollX); + visibleRect.top = Math.max(visibleRect.top, scrollY); + winSize = { + width: _utils2['default'].viewportWidth(win), + height: _utils2['default'].viewportHeight(win) + }; + visibleRect.right = Math.min(visibleRect.right, scrollX + winSize.width); + visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + winSize.height); + return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null; + } + + exports['default'] = getVisibleRectForElement; + module.exports = exports['default']; + +/***/ }, +/* 391 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _utils = __webpack_require__(388); + + var _utils2 = _interopRequireDefault(_utils); + + function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) { + var pos = _utils2['default'].clone(elFuturePos); + var size = { + width: elRegion.width, + height: elRegion.height + }; + + if (overflow.adjustX && pos.left < visibleRect.left) { + pos.left = visibleRect.left; + } + + // Left edge inside and right edge outside viewport, try to resize it. + if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) { + size.width -= pos.left + size.width - visibleRect.right; + } + + // Right edge outside viewport, try to move it. + if (overflow.adjustX && pos.left + size.width > visibleRect.right) { + // 保证左边界和可视区域左边界对齐 + pos.left = Math.max(visibleRect.right - size.width, visibleRect.left); + } + + // Top edge outside viewport, try to move it. + if (overflow.adjustY && pos.top < visibleRect.top) { + pos.top = visibleRect.top; + } + + // Top edge inside and bottom edge outside viewport, try to resize it. + if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) { + size.height -= pos.top + size.height - visibleRect.bottom; + } + + // Bottom edge outside viewport, try to move it. + if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) { + // 保证上边界和可视区域上边界对齐 + pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top); + } + + return _utils2['default'].mix(pos, size); + } + + exports['default'] = adjustForViewport; + module.exports = exports['default']; + +/***/ }, +/* 392 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _utils = __webpack_require__(388); + + var _utils2 = _interopRequireDefault(_utils); + + function getRegion(node) { + var offset = undefined; + var w = undefined; + var h = undefined; + if (!_utils2['default'].isWindow(node) && node.nodeType !== 9) { + offset = _utils2['default'].offset(node); + w = _utils2['default'].outerWidth(node); + h = _utils2['default'].outerHeight(node); + } else { + var win = _utils2['default'].getWindow(node); + offset = { + left: _utils2['default'].getWindowScrollLeft(win), + top: _utils2['default'].getWindowScrollTop(win) + }; + w = _utils2['default'].viewportWidth(win); + h = _utils2['default'].viewportHeight(win); + } + offset.width = w; + offset.height = h; + return offset; + } + + exports['default'] = getRegion; + module.exports = exports['default']; + +/***/ }, +/* 393 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _getAlignOffset = __webpack_require__(394); + + var _getAlignOffset2 = _interopRequireDefault(_getAlignOffset); + + function getElFuturePos(elRegion, refNodeRegion, points, offset, targetOffset) { + var xy = undefined; + var diff = undefined; + var p1 = undefined; + var p2 = undefined; + + xy = { + left: elRegion.left, + top: elRegion.top + }; + + p1 = (0, _getAlignOffset2['default'])(refNodeRegion, points[1]); + p2 = (0, _getAlignOffset2['default'])(elRegion, points[0]); + + diff = [p2.left - p1.left, p2.top - p1.top]; + + return { + left: xy.left - diff[0] + offset[0] - targetOffset[0], + top: xy.top - diff[1] + offset[1] - targetOffset[1] + }; + } + + exports['default'] = getElFuturePos; + module.exports = exports['default']; + +/***/ }, +/* 394 */ +/***/ function(module, exports) { + + /** + * 获取 node 上的 align 对齐点 相对于页面的坐标 + */ + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + function getAlignOffset(region, align) { + var V = align.charAt(0); + var H = align.charAt(1); + var w = region.width; + var h = region.height; + var x = undefined; + var y = undefined; + + x = region.left; + y = region.top; + + if (V === 'c') { + y += h / 2; + } else if (V === 'b') { + y += h; + } + + if (H === 'c') { + x += w / 2; + } else if (H === 'r') { + x += w; + } + + return { + left: x, + top: y + }; + } + + exports['default'] = getAlignOffset; + module.exports = exports['default']; + +/***/ }, +/* 395 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports["default"] = isWindow; + + function isWindow(obj) { + /* eslint no-eq-null: 0 */ + /* eslint eqeqeq: 0 */ + return obj != null && obj == obj.window; + } + + module.exports = exports["default"]; + +/***/ }, +/* 396 */ +/***/ function(module, exports, __webpack_require__) { + + // export this package's api + 'use strict'; + + module.exports = __webpack_require__(397); + +/***/ }, +/* 397 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _ChildrenUtils = __webpack_require__(398); + + var _AnimateChild = __webpack_require__(399); + + var _AnimateChild2 = _interopRequireDefault(_AnimateChild); + + var _util = __webpack_require__(403); + + var _util2 = _interopRequireDefault(_util); + + var defaultKey = 'rc_animate_' + Date.now(); + + function getChildrenFromProps(props) { + var children = props.children; + if (_react2['default'].isValidElement(children)) { + if (!children.key) { + return _react2['default'].cloneElement(children, { + key: defaultKey + }); + } + } + return children; + } + + function noop() {} + + var Animate = _react2['default'].createClass({ + displayName: 'Animate', + + propTypes: { + component: _react2['default'].PropTypes.any, + animation: _react2['default'].PropTypes.object, + transitionName: _react2['default'].PropTypes.string, + transitionEnter: _react2['default'].PropTypes.bool, + transitionAppear: _react2['default'].PropTypes.bool, + exclusive: _react2['default'].PropTypes.bool, + transitionLeave: _react2['default'].PropTypes.bool, + onEnd: _react2['default'].PropTypes.func, + onEnter: _react2['default'].PropTypes.func, + onLeave: _react2['default'].PropTypes.func, + onAppear: _react2['default'].PropTypes.func, + showProp: _react2['default'].PropTypes.string + }, + + getDefaultProps: function getDefaultProps() { + return { + animation: {}, + component: 'span', + transitionEnter: true, + transitionLeave: true, + transitionAppear: false, + onEnd: noop, + onEnter: noop, + onLeave: noop, + onAppear: noop + }; + }, + + getInitialState: function getInitialState() { + this.currentlyAnimatingKeys = {}; + this.keysToEnter = []; + this.keysToLeave = []; + return { + children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(this.props)) + }; + }, + + componentDidMount: function componentDidMount() { + var _this = this; + + var showProp = this.props.showProp; + var children = this.state.children; + if (showProp) { + children = children.filter(function (child) { + return !!child.props[showProp]; + }); + } + children.forEach(function (child) { + _this.performAppear(child.key); + }); + }, + + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + var _this2 = this; + + var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps)); + var props = this.props; + var showProp = props.showProp; + var currentlyAnimatingKeys = this.currentlyAnimatingKeys; + // last props children if exclusive + // exclusive needs immediate response + var currentChildren = this.state.children; + // in case destroy in showProp mode + var newChildren = []; + if (showProp) { + currentChildren.forEach(function (currentChild) { + var nextChild = (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, currentChild.key); + var newChild = undefined; + if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) { + newChild = _react2['default'].cloneElement(nextChild || currentChild, _defineProperty({}, showProp, true)); + } else { + newChild = nextChild; + } + if (newChild) { + newChildren.push(newChild); + } + }); + nextChildren.forEach(function (nextChild) { + if (!(0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, nextChild.key)) { + newChildren.push(nextChild); + } + }); + } else { + newChildren = (0, _ChildrenUtils.mergeChildren)(currentChildren, nextChildren); + } + + // need render to avoid update + this.setState({ + children: newChildren + }); + + nextChildren.forEach(function (child) { + var key = child.key; + if (currentlyAnimatingKeys[key]) { + return; + } + var hasPrev = (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key); + if (showProp) { + var showInNext = child.props[showProp]; + if (hasPrev) { + var showInNow = (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp); + if (!showInNow && showInNext) { + _this2.keysToEnter.push(key); + } + } else if (showInNext) { + _this2.keysToEnter.push(key); + } + } else if (!hasPrev) { + _this2.keysToEnter.push(key); + } + }); + + currentChildren.forEach(function (child) { + var key = child.key; + if (currentlyAnimatingKeys[key]) { + return; + } + var hasNext = (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, key); + if (showProp) { + var showInNow = child.props[showProp]; + if (hasNext) { + var showInNext = (0, _ChildrenUtils.findShownChildInChildrenByKey)(nextChildren, key, showProp); + if (!showInNext && showInNow) { + _this2.keysToLeave.push(key); + } + } else if (showInNow) { + _this2.keysToLeave.push(key); + } + } else if (!hasNext) { + _this2.keysToLeave.push(key); + } + }); + }, + + componentDidUpdate: function componentDidUpdate(prevProps) { + var _this3 = this; + + // exclusive needs immediate response + if (this.props.exclusive && this.props !== prevProps) { + Object.keys(this.currentlyAnimatingKeys).forEach(function (key) { + _this3.stop(key); + }); + } + if (this.isMounted()) { + var keysToEnter = this.keysToEnter; + this.keysToEnter = []; + keysToEnter.forEach(this.performEnter); + var keysToLeave = this.keysToLeave; + this.keysToLeave = []; + keysToLeave.forEach(this.performLeave); + } + }, + + performEnter: function performEnter(key) { + // may already remove by exclusive + if (this.refs[key]) { + this.currentlyAnimatingKeys[key] = true; + this.refs[key].componentWillEnter(this.handleDoneAdding.bind(this, key, 'enter')); + } + }, + + performAppear: function performAppear(key) { + if (this.refs[key]) { + this.currentlyAnimatingKeys[key] = true; + this.refs[key].componentWillAppear(this.handleDoneAdding.bind(this, key, 'appear')); + } + }, + + handleDoneAdding: function handleDoneAdding(key, type) { + var props = this.props; + delete this.currentlyAnimatingKeys[key]; + var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)); + if (!this.isValidChildByKey(currentChildren, key)) { + // exclusive will not need this + this.performLeave(key); + } else { + if (type === 'appear') { + if (_util2['default'].allowAppearCallback(props)) { + props.onAppear(key); + props.onEnd(key, true); + } + } else { + if (_util2['default'].allowEnterCallback(props)) { + props.onEnter(key); + props.onEnd(key, true); + } + } + } + }, + + performLeave: function performLeave(key) { + // may already remove by exclusive + if (this.refs[key]) { + this.currentlyAnimatingKeys[key] = true; + this.refs[key].componentWillLeave(this.handleDoneLeaving.bind(this, key)); + } + }, + + handleDoneLeaving: function handleDoneLeaving(key) { + var props = this.props; + delete this.currentlyAnimatingKeys[key]; + var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)); + // in case state change is too fast + if (this.isValidChildByKey(currentChildren, key)) { + this.performEnter(key); + } else { + if (_util2['default'].allowLeaveCallback(props)) { + props.onLeave(key); + props.onEnd(key, false); + } + if (this.isMounted() && !(0, _ChildrenUtils.isSameChildren)(this.state.children, currentChildren, props.showProp)) { + this.setState({ + children: currentChildren + }); + } + } + }, + + isValidChildByKey: function isValidChildByKey(currentChildren, key) { + var showProp = this.props.showProp; + if (showProp) { + return (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp); + } + return (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key); + }, + + stop: function stop(key) { + delete this.currentlyAnimatingKeys[key]; + var component = this.refs[key]; + if (component) { + component.stop(); + } + }, + + render: function render() { + var props = this.props; + var stateChildren = this.state.children; + var children = null; + if (stateChildren) { + children = stateChildren.map(function (child) { + if (!child.key) { + throw new Error('must set key for <rc-animate> children'); + } + return _react2['default'].createElement( + _AnimateChild2['default'], + { + key: child.key, + ref: child.key, + animation: props.animation, + transitionName: props.transitionName, + transitionEnter: props.transitionEnter, + transitionAppear: props.transitionAppear, + transitionLeave: props.transitionLeave }, + child + ); + }); + } + var Component = props.component; + if (Component) { + return _react2['default'].createElement( + Component, + this.props, + children + ); + } + return children[0] || null; + } + }); + + exports['default'] = Animate; + module.exports = exports['default']; + +/***/ }, +/* 398 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.toArrayChildren = toArrayChildren; + exports.findChildInChildrenByKey = findChildInChildrenByKey; + exports.findShownChildInChildrenByKey = findShownChildInChildrenByKey; + exports.findHiddenChildInChildrenByKey = findHiddenChildInChildrenByKey; + exports.isSameChildren = isSameChildren; + exports.mergeChildren = mergeChildren; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + function toArrayChildren(children) { + var ret = []; + _react2['default'].Children.forEach(children, function (child) { + ret.push(child); + }); + return ret; + } + + function findChildInChildrenByKey(children, key) { + var ret = null; + if (children) { + children.forEach(function (child) { + if (ret) { + return; + } + if (child.key === key) { + ret = child; + } + }); + } + return ret; + } + + function findShownChildInChildrenByKey(children, key, showProp) { + var ret = null; + if (children) { + children.forEach(function (child) { + if (child.key === key && child.props[showProp]) { + if (ret) { + throw new Error('two child with same key for <rc-animate> children'); + } + ret = child; + } + }); + } + return ret; + } + + function findHiddenChildInChildrenByKey(children, key, showProp) { + var found = 0; + if (children) { + children.forEach(function (child) { + if (found) { + return; + } + found = child.key === key && !child.props[showProp]; + }); + } + return found; + } + + function isSameChildren(c1, c2, showProp) { + var same = c1.length === c2.length; + if (same) { + c1.forEach(function (child, index) { + var child2 = c2[index]; + if (child.key !== child2.key) { + same = false; + } else if (showProp && child.props[showProp] !== child2.props[showProp]) { + same = false; + } + }); + } + return same; + } + + function mergeChildren(prev, next) { + var ret = []; + + // For each key of `next`, the list of keys to insert before that key in + // the combined list + var nextChildrenPending = {}; + var pendingChildren = []; + prev.forEach(function (child) { + if (findChildInChildrenByKey(next, child.key)) { + if (pendingChildren.length) { + nextChildrenPending[child.key] = pendingChildren; + pendingChildren = []; + } + } else { + pendingChildren.push(child); + } + }); + + next.forEach(function (child) { + if (nextChildrenPending.hasOwnProperty(child.key)) { + ret = ret.concat(nextChildrenPending[child.key]); + } + ret.push(child); + }); + + ret = ret.concat(pendingChildren); + + return ret; + } + +/***/ }, +/* 399 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _reactDom = __webpack_require__(347); + + var _reactDom2 = _interopRequireDefault(_reactDom); + + var _cssAnimation = __webpack_require__(400); + + var _cssAnimation2 = _interopRequireDefault(_cssAnimation); + + var _util = __webpack_require__(403); + + var _util2 = _interopRequireDefault(_util); + + var transitionMap = { + enter: 'transitionEnter', + appear: 'transitionAppear', + leave: 'transitionLeave' + }; + + var AnimateChild = _react2['default'].createClass({ + displayName: 'AnimateChild', + + propTypes: { + children: _react2['default'].PropTypes.any + }, + + componentWillUnmount: function componentWillUnmount() { + this.stop(); + }, + + componentWillEnter: function componentWillEnter(done) { + if (_util2['default'].isEnterSupported(this.props)) { + this.transition('enter', done); + } else { + done(); + } + }, + + componentWillAppear: function componentWillAppear(done) { + if (_util2['default'].isAppearSupported(this.props)) { + this.transition('appear', done); + } else { + done(); + } + }, + + componentWillLeave: function componentWillLeave(done) { + if (_util2['default'].isLeaveSupported(this.props)) { + this.transition('leave', done); + } else { + done(); + } + }, + + transition: function transition(animationType, finishCallback) { + var _this = this; + + var node = _reactDom2['default'].findDOMNode(this); + var props = this.props; + var transitionName = props.transitionName; + this.stop(); + var end = function end() { + _this.stopper = null; + finishCallback(); + }; + if ((_cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) { + this.stopper = (0, _cssAnimation2['default'])(node, transitionName + '-' + animationType, end); + } else { + this.stopper = props.animation[animationType](node, end); + } + }, + + stop: function stop() { + var stopper = this.stopper; + if (stopper) { + this.stopper = null; + stopper.stop(); + } + }, + + render: function render() { + return this.props.children; + } + }); + + exports['default'] = AnimateChild; + module.exports = exports['default']; + +/***/ }, +/* 400 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Event = __webpack_require__(401); + var Css = __webpack_require__(402); + var isCssAnimationSupported = Event.endEvents.length !== 0; + + function getDuration(node, name) { + var style = window.getComputedStyle(node); + var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', '']; + var ret = ''; + for (var i = 0; i < prefixes.length; i++) { + ret = style.getPropertyValue(prefixes[i] + name); + if (ret) { + break; + } + } + return ret; + } + + function fixBrowserByTimeout(node) { + if (isCssAnimationSupported) { + var transitionDuration = parseFloat(getDuration(node, 'transition-duration')) || 0; + var animationDuration = parseFloat(getDuration(node, 'animation-duration')) || 0; + var time = Math.max(transitionDuration, animationDuration); + // sometimes, browser bug + node.rcEndAnimTimeout = setTimeout(function () { + node.rcEndAnimTimeout = null; + if (node.rcEndListener) { + node.rcEndListener(); + } + }, time * 1000 + 200); + } + } + + function clearBrowserBugTimeout(node) { + if (node.rcEndAnimTimeout) { + clearTimeout(node.rcEndAnimTimeout); + node.rcEndAnimTimeout = null; + } + } + + var cssAnimation = function cssAnimation(node, transitionName, callback) { + var className = transitionName; + var activeClassName = className + '-active'; + + if (node.rcEndListener) { + node.rcEndListener(); + } + + node.rcEndListener = function (e) { + if (e && e.target !== node) { + return; + } + + if (node.rcAnimTimeout) { + clearTimeout(node.rcAnimTimeout); + node.rcAnimTimeout = null; + } + + clearBrowserBugTimeout(node); + + Css.removeClass(node, className); + Css.removeClass(node, activeClassName); + + Event.removeEndEventListener(node, node.rcEndListener); + node.rcEndListener = null; + + // Usually this optional callback is used for informing an owner of + // a leave animation and telling it to remove the child. + if (callback) { + callback(); + } + }; + + Event.addEndEventListener(node, node.rcEndListener); + + Css.addClass(node, className); + + node.rcAnimTimeout = setTimeout(function () { + node.rcAnimTimeout = null; + Css.addClass(node, activeClassName); + fixBrowserByTimeout(node); + }, 0); + + return { + stop: function stop() { + if (node.rcEndListener) { + node.rcEndListener(); + } + } + }; + }; + + cssAnimation.style = function (node, style, callback) { + if (node.rcEndListener) { + node.rcEndListener(); + } + + node.rcEndListener = function (e) { + if (e && e.target !== node) { + return; + } + + if (node.rcAnimTimeout) { + clearTimeout(node.rcAnimTimeout); + node.rcAnimTimeout = null; + } + + clearBrowserBugTimeout(node); + + Event.removeEndEventListener(node, node.rcEndListener); + node.rcEndListener = null; + + // Usually this optional callback is used for informing an owner of + // a leave animation and telling it to remove the child. + if (callback) { + callback(); + } + }; + + Event.addEndEventListener(node, node.rcEndListener); + + node.rcAnimTimeout = setTimeout(function () { + for (var s in style) { + if (style.hasOwnProperty(s)) { + node.style[s] = style[s]; + } + } + node.rcAnimTimeout = null; + fixBrowserByTimeout(node); + }, 0); + }; + + cssAnimation.setTransition = function (node, p, value) { + var property = p; + var v = value; + if (value === undefined) { + v = property; + property = ''; + } + property = property || ''; + ['Webkit', 'Moz', 'O', + // ms is special .... ! + 'ms'].forEach(function (prefix) { + node.style[prefix + 'Transition' + property] = v; + }); + }; + + cssAnimation.addClass = Css.addClass; + cssAnimation.removeClass = Css.removeClass; + cssAnimation.isCssAnimationSupported = isCssAnimationSupported; + + module.exports = cssAnimation; + +/***/ }, +/* 401 */ +/***/ function(module, exports) { + + 'use strict'; + + var EVENT_NAME_MAP = { + transitionend: { + transition: 'transitionend', + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'mozTransitionEnd', + OTransition: 'oTransitionEnd', + msTransition: 'MSTransitionEnd' + }, + + animationend: { + animation: 'animationend', + WebkitAnimation: 'webkitAnimationEnd', + MozAnimation: 'mozAnimationEnd', + OAnimation: 'oAnimationEnd', + msAnimation: 'MSAnimationEnd' + } + }; + + var endEvents = []; + + function detectEvents() { + var testEl = document.createElement('div'); + var style = testEl.style; + + if (!('AnimationEvent' in window)) { + delete EVENT_NAME_MAP.animationend.animation; + } + + if (!('TransitionEvent' in window)) { + delete EVENT_NAME_MAP.transitionend.transition; + } + + for (var baseEventName in EVENT_NAME_MAP) { + if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) { + var baseEvents = EVENT_NAME_MAP[baseEventName]; + for (var styleName in baseEvents) { + if (styleName in style) { + endEvents.push(baseEvents[styleName]); + break; + } + } + } + } + } + + if (typeof window !== 'undefined') { + detectEvents(); + } + + function addEventListener(node, eventName, eventListener) { + node.addEventListener(eventName, eventListener, false); + } + + function removeEventListener(node, eventName, eventListener) { + node.removeEventListener(eventName, eventListener, false); + } + + var TransitionEvents = { + addEndEventListener: function addEndEventListener(node, eventListener) { + if (endEvents.length === 0) { + window.setTimeout(eventListener, 0); + return; + } + endEvents.forEach(function (endEvent) { + addEventListener(node, endEvent, eventListener); + }); + }, + + endEvents: endEvents, + + removeEndEventListener: function removeEndEventListener(node, eventListener) { + if (endEvents.length === 0) { + return; + } + endEvents.forEach(function (endEvent) { + removeEventListener(node, endEvent, eventListener); + }); + } + }; + + module.exports = TransitionEvents; + +/***/ }, +/* 402 */ +/***/ function(module, exports) { + + 'use strict'; + + var SPACE = ' '; + var RE_CLASS = /[\n\t\r]/g; + + function norm(elemClass) { + return (SPACE + elemClass + SPACE).replace(RE_CLASS, SPACE); + } + + module.exports = { + addClass: function addClass(elem, className) { + elem.className += ' ' + className; + }, + + removeClass: function removeClass(elem, n) { + var elemClass = elem.className.trim(); + var className = norm(elemClass); + var needle = n.trim(); + needle = SPACE + needle + SPACE; + // 一个 cls 有可能多次出现:'link link2 link link3 link' + while (className.indexOf(needle) >= 0) { + className = className.replace(needle, SPACE); + } + elem.className = className.trim(); + } + }; + +/***/ }, +/* 403 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + var util = { + isAppearSupported: function isAppearSupported(props) { + return props.transitionName && props.transitionAppear || props.animation.appear; + }, + isEnterSupported: function isEnterSupported(props) { + return props.transitionName && props.transitionEnter || props.animation.enter; + }, + isLeaveSupported: function isLeaveSupported(props) { + return props.transitionName && props.transitionLeave || props.animation.leave; + }, + + allowAppearCallback: function allowAppearCallback(props) { + return props.transitionAppear || props.animation.appear; + }, + allowEnterCallback: function allowEnterCallback(props) { + return props.transitionEnter || props.animation.enter; + }, + allowLeaveCallback: function allowLeaveCallback(props) { + return props.transitionLeave || props.animation.leave; + } + }; + exports["default"] = util; + module.exports = exports["default"]; + +/***/ }, +/* 404 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var PopupInner = _react2['default'].createClass({ + displayName: 'PopupInner', + + propTypes: { + hiddenClassName: _react.PropTypes.string, + className: _react.PropTypes.string, + onMouseEnter: _react.PropTypes.func, + onMouseLeave: _react.PropTypes.func, + children: _react.PropTypes.any + }, + render: function render() { + var props = this.props; + var className = props.className; + if (!props.visible) { + className += ' ' + props.hiddenClassName; + } + return _react2['default'].createElement( + 'div', + { className: className, + onMouseEnter: props.onMouseEnter, + onMouseLeave: props.onMouseLeave, + style: props.style }, + props.children + ); + } + }); + + exports['default'] = PopupInner; + module.exports = exports['default']; + +/***/ }, +/* 405 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.getAlignFromPlacement = getAlignFromPlacement; + exports.getPopupClassNameFromAlign = getPopupClassNameFromAlign; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _objectAssign = __webpack_require__(373); + + var _objectAssign2 = _interopRequireDefault(_objectAssign); + + function isPointsEq(a1, a2) { + return a1[0] === a2[0] && a1[1] === a2[1]; + } + + function getAlignFromPlacement(builtinPlacements, placementStr, align) { + var baseAlign = builtinPlacements[placementStr] || {}; + return (0, _objectAssign2['default'])({}, baseAlign, align); + } + + function getPopupClassNameFromAlign(builtinPlacements, prefixCls, align) { + var points = align.points; + for (var placement in builtinPlacements) { + if (builtinPlacements.hasOwnProperty(placement)) { + if (isPointsEq(builtinPlacements[placement].points, points)) { + return prefixCls + '-placement-' + placement; + } + } + } + return ''; + } + +/***/ }, +/* 406 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _classnames = __webpack_require__(358); + + var _classnames2 = _interopRequireDefault(_classnames); + + function calcPoints(marks, dots, step, min, max) { + var points = Object.keys(marks).map(parseFloat); + if (dots) { + for (var i = min; i <= max; i = i + step) { + if (points.indexOf(i) >= 0) continue; + points.push(i); + } + } + return points; + } + + var Dots = function Dots(_ref) { + var prefixCls = _ref.prefixCls; + var marks = _ref.marks; + var dots = _ref.dots; + var step = _ref.step; + var included = _ref.included; + var lowerBound = _ref.lowerBound; + var upperBound = _ref.upperBound; + var max = _ref.max; + var min = _ref.min; + + var range = max - min; + var elements = calcPoints(marks, dots, step, min, max).map(function (point) { + var _classNames; + + var offset = (point - min) / range * 100 + '%'; + var style = { left: offset }; + + var isActived = !included && point === upperBound || included && point <= upperBound && point >= lowerBound; + var pointClassName = (0, _classnames2['default'])((_classNames = {}, _defineProperty(_classNames, prefixCls + '-dot', true), _defineProperty(_classNames, prefixCls + '-dot-active', isActived), _classNames)); + + return _react2['default'].createElement('span', { className: pointClassName, style: style, key: point }); + }); + + return _react2['default'].createElement( + 'div', + { className: prefixCls + '-step' }, + elements + ); + }; + + exports['default'] = Dots; + module.exports = exports['default']; + +/***/ }, +/* 407 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + var _react = __webpack_require__(191); + + var _react2 = _interopRequireDefault(_react); + + var _classnames = __webpack_require__(358); + + var _classnames2 = _interopRequireDefault(_classnames); + + var Marks = function Marks(_ref) { + var className = _ref.className; + var marks = _ref.marks; + var included = _ref.included; + var upperBound = _ref.upperBound; + var lowerBound = _ref.lowerBound; + var max = _ref.max; + var min = _ref.min; + + var marksKeys = Object.keys(marks); + var marksCount = marksKeys.length; + var unit = 100 / (marksCount - 1); + var markWidth = unit * 0.9; + + var range = max - min; + var elements = marksKeys.map(parseFloat).map(function (point) { + var _classNames; + + var isActived = !included && point === upperBound || included && point <= upperBound && point >= lowerBound; + var markClassName = (0, _classnames2['default'])((_classNames = {}, _defineProperty(_classNames, className + '-text', true), _defineProperty(_classNames, className + '-text-active', isActived), _classNames)); + + var style = { width: markWidth + '%' }; + style.left = (point - min) / range * 100 - markWidth / 2 + '%'; + + return _react2['default'].createElement( + 'span', + { className: markClassName, style: style, key: point }, + marks[point] + ); + }); + + return _react2['default'].createElement( + 'div', + { className: className }, + elements + ); + }; + + exports['default'] = Marks; + module.exports = exports['default']; + +/***/ }, +/* 408 */ +/***/ function(module, exports, __webpack_require__) { + + // style-loader: Adds some css to the DOM by adding a <style> tag + + // load the styles + var content = __webpack_require__(409); + if(typeof content === 'string') content = [[module.id, content, '']]; + // add the styles to the DOM + var update = __webpack_require__(351)(content, {}); + if(content.locals) module.exports = content.locals; + // Hot Module Replacement + if(false) { + // When the styles change, update the <style> tags + if(!content.locals) { + module.hot.accept("!!./node_modules/css-loader/index.js!./node_modules/sass-loader/index.js!./style.scss", function() { + var newContent = require("!!./node_modules/css-loader/index.js!./node_modules/sass-loader/index.js!./style.scss"); + if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; + update(newContent); + }); + } + // When the module is disposed, remove the <style> tags + module.hot.dispose(function() { update(); }); + } + +/***/ }, +/* 409 */ +/***/ function(module, exports, __webpack_require__) { + + exports = module.exports = __webpack_require__(350)(); + // imports + + + // module + exports.push([module.id, "body {\n margin: 0;\n padding: 0; }\n body #datetime {\n position: fixed;\n color: #ee8877;\n z-index: 100;\n font-family: monospace;\n padding: 5px; }\n body #date {\n font-size: 0.7em; }\n body #map {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 100%; }\n body .rc-slider {\n position: fixed;\n bottom: 50px;\n width: 80%;\n margin: 0 auto;\n margin-left: 10%; }\n body .rc-slider .rc-slider-handle {\n border: 2px solid #bababa;\n background-color: #bababa;\n margin-left: -12px;\n margin-top: -13px;\n width: 30px;\n height: 30px; }\n body .rc-slider .rc-slider-track {\n background-color: #bababa; }\n", ""]); + + // exports + + +/***/ }, +/* 410 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(411)(__webpack_require__(412)) + +/***/ }, +/* 411 */ +/***/ function(module, exports) { + + /*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+ */
+ module.exports = function(src) {
+ if (typeof execScript === "function")
+ execScript(src);
+ else
+ eval.call(null, src);
+ } + +/***/ }, +/* 412 */ +/***/ function(module, exports) { + + module.exports = "(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.mapboxgl = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n\"use strict\";function Bucket(e){this.layer=e.layer,this.zoom=e.zoom,this.layers=[this.layer.id],this.type=this.layer.type,this.features=[],this.id=this.layer.id,this[\"source-layer\"]=this.layer[\"source-layer\"],this.interactive=this.layer.interactive,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.filter=featureFilter(this.layer.filter),this.layoutProperties=createLayoutProperties(this.layer,this.zoom),this.resetBuffers(e.buffers);for(var t in this.shaders){var r=this.shaders[t];this[this.getAddMethodName(t,\"vertex\")]=createVertexAddMethod(t,r,this.getBufferName(t,\"vertex\"))}}function createLayoutProperties(e,t){var r=new StyleDeclarationSet(\"layout\",e.type,e.layout,{}).values(),i={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0},a={};for(var s in r)a[s]=r[s].calculate(t,i);return\"symbol\"===e.type&&(r[\"text-size\"]&&(a[\"text-max-size\"]=r[\"text-size\"].calculate(18,i),a[\"text-size\"]=r[\"text-size\"].calculate(t+1,i)),r[\"icon-size\"]&&(a[\"icon-max-size\"]=r[\"icon-size\"].calculate(18,i),a[\"icon-size\"]=r[\"icon-size\"].calculate(t+1,i))),new LayoutProperties[e.type](a)}function createVertexAddMethod(e,t,r){for(var i=[],a=0;a<t.attributes.length;a++)i=i.concat(t.attributes[a].value);var s=\"return this.buffers.\"+r+\".push(\"+i.join(\", \")+\");\";return createVertexAddMethodCache[s]||(createVertexAddMethodCache[s]=new Function(t.attributeArgs,s)),createVertexAddMethodCache[s]}function createElementAddMethod(e){return function(t,r,i){return e.push(t,r,i)}}function createElementBuffer(e){return new Buffer({type:Buffer.BufferType.ELEMENT,attributes:[{name:\"vertices\",components:e||3,type:Buffer.ELEMENT_ATTRIBUTE_TYPE}]})}function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}var featureFilter=require(\"feature-filter\"),StyleDeclarationSet=require(\"../style/style_declaration_set\"),LayoutProperties=require(\"../style/layout_properties\"),ElementGroups=require(\"./element_groups\"),Buffer=require(\"./buffer\");module.exports=Bucket,Bucket.create=function(e){var t={fill:require(\"./fill_bucket\"),line:require(\"./line_bucket\"),circle:require(\"./circle_bucket\"),symbol:require(\"./symbol_bucket\")};return new t[e.layer.type](e)},Bucket.AttributeType=Buffer.AttributeType,Bucket.prototype.addFeatures=function(){for(var e=0;e<this.features.length;e++)this.addFeature(this.features[e])},Bucket.prototype.makeRoomFor=function(e,t){return this.elementGroups[e].makeRoomFor(t)},Bucket.prototype.resetBuffers=function(e){this.buffers=e,this.elementGroups={};for(var t in this.shaders){var r=this.shaders[t],i=this.getBufferName(t,\"vertex\");if(r.vertexBuffer&&!e[i]&&(e[i]=new Buffer({type:Buffer.BufferType.VERTEX,attributes:r.attributes})),r.elementBuffer){var a=this.getBufferName(t,\"element\");e[a]||(e[a]=createElementBuffer(r.elementBufferComponents)),this[this.getAddMethodName(t,\"element\")]=createElementAddMethod(this.buffers[a])}if(r.secondElementBuffer){var s=this.getBufferName(t,\"secondElement\");e[s]||(e[s]=createElementBuffer(r.secondElementBufferComponents)),this[this.getAddMethodName(t,\"secondElement\")]=createElementAddMethod(this.buffers[s])}this.elementGroups[t]=new ElementGroups(e[this.getBufferName(t,\"vertex\")],e[this.getBufferName(t,\"element\")],e[this.getBufferName(t,\"secondElement\")])}},Bucket.prototype.getAddMethodName=function(e,t){return\"add\"+capitalize(e)+capitalize(t)},Bucket.prototype.getBufferName=function(e,t){return e+capitalize(t)};var createVertexAddMethodCache={};\n},{\"../style/layout_properties\":43,\"../style/style_declaration_set\":49,\"./buffer\":2,\"./circle_bucket\":3,\"./element_groups\":4,\"./fill_bucket\":6,\"./line_bucket\":7,\"./symbol_bucket\":8,\"feature-filter\":97}],2:[function(require,module,exports){\n\"use strict\";function Buffer(t){if(this.type=t.type,t.arrayBuffer)this.capacity=t.capacity,this.arrayBuffer=t.arrayBuffer,this.attributes=t.attributes,this.itemSize=t.itemSize,this.length=t.length;else{this.capacity=align(Buffer.CAPACITY_DEFAULT,Buffer.CAPACITY_ALIGNMENT),this.arrayBuffer=new ArrayBuffer(this.capacity),this.attributes=[],this.itemSize=0,this.length=0;var e=this.type===Buffer.BufferType.VERTEX?Buffer.VERTEX_ATTRIBUTE_ALIGNMENT:1;this.attributes=t.attributes.map(function(t){var r={};return r.name=t.name,r.components=t.components||1,r.type=t.type||Buffer.AttributeType.UNSIGNED_BYTE,r.size=r.type.size*r.components,r.offset=this.itemSize,this.itemSize=align(r.offset+r.size,e),r},this),this._createPushMethod(),this._refreshViews()}}function align(t,e){e=e||1;var r=t%e;return 1!==e&&0!==r&&(t+=e-r),t}Buffer.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer.slice(0,this.length*this.itemSize),t.STATIC_DRAW),this.arrayBuffer=null)},Buffer.prototype.destroy=function(t){this.buffer&&t.deleteBuffer(this.buffer)},Buffer.prototype.setAttribPointers=function(t,e,r){for(var i=0;i<this.attributes.length;i++){var f=this.attributes[i];t.vertexAttribPointer(e[\"a_\"+f.name],f.components,t[f.type.name],!1,this.itemSize,r+f.offset)}},Buffer.prototype.get=function(t){this._refreshViews();for(var e={},r=t*this.itemSize,i=0;i<this.attributes.length;i++)for(var f=this.attributes[i],s=e[f.name]=[],a=0;a<f.components;a++){var h=(r+f.offset)/f.type.size+a;s.push(this.views[f.type.name][h])}return e},Buffer.prototype.validate=function(t){for(var e=0;e<this.attributes.length;e++)for(var r=0;r<this.attributes[e].components;r++);},Buffer.prototype._resize=function(t){var e=this.views.UNSIGNED_BYTE;this.capacity=align(t,Buffer.CAPACITY_ALIGNMENT),this.arrayBuffer=new ArrayBuffer(this.capacity),this._refreshViews(),this.views.UNSIGNED_BYTE.set(e)},Buffer.prototype._refreshViews=function(){this.views={UNSIGNED_BYTE:new Uint8Array(this.arrayBuffer),BYTE:new Int8Array(this.arrayBuffer),UNSIGNED_SHORT:new Uint16Array(this.arrayBuffer),SHORT:new Int16Array(this.arrayBuffer)}};var createPushMethodCache={};Buffer.prototype._createPushMethod=function(){var t=\"\",e=[];t+=\"var i = this.length++;\\n\",t+=\"var o = i * \"+this.itemSize+\";\\n\",t+=\"if (o + \"+this.itemSize+\" > this.capacity) { this._resize(this.capacity * 1.5); }\\n\";for(var r=0;r<this.attributes.length;r++){var i=this.attributes[r],f=\"o\"+r;t+=\"\\nvar \"+f+\" = (o + \"+i.offset+\") / \"+i.type.size+\";\\n\";for(var s=0;s<i.components;s++){var a=\"v\"+e.length,h=\"this.views.\"+i.type.name+\"[\"+f+\" + \"+s+\"]\";t+=h+\" = \"+a+\";\\n\",e.push(a)}}t+=\"\\nreturn i;\\n\",createPushMethodCache[t]||(createPushMethodCache[t]=new Function(e,t)),this.push=createPushMethodCache[t]},Buffer.BufferType={VERTEX:\"ARRAY_BUFFER\",ELEMENT:\"ELEMENT_ARRAY_BUFFER\"},Buffer.AttributeType={BYTE:{size:1,name:\"BYTE\"},UNSIGNED_BYTE:{size:1,name:\"UNSIGNED_BYTE\"},SHORT:{size:2,name:\"SHORT\"},UNSIGNED_SHORT:{size:2,name:\"UNSIGNED_SHORT\"}},Buffer.ELEMENT_ATTRIBUTE_TYPE=Buffer.AttributeType.UNSIGNED_SHORT,Buffer.CAPACITY_DEFAULT=8192,Buffer.CAPACITY_ALIGNMENT=2,Buffer.VERTEX_ATTRIBUTE_ALIGNMENT=4,module.exports=Buffer;\n},{}],3:[function(require,module,exports){\n\"use strict\";function CircleBucket(){Bucket.apply(this,arguments)}var Bucket=require(\"./bucket\"),util=require(\"../util/util\");module.exports=CircleBucket;var EXTENT=4096;CircleBucket.prototype=util.inherit(Bucket,{}),CircleBucket.prototype.shaders={circle:{vertexBuffer:!0,elementBuffer:!0,attributeArgs:[\"x\",\"y\",\"extrudeX\",\"extrudeY\"],attributes:[{name:\"pos\",components:2,type:Bucket.AttributeType.SHORT,value:[\"(x * 2) + ((extrudeX + 1) / 2)\",\"(y * 2) + ((extrudeY + 1) / 2)\"]}]}},CircleBucket.prototype.addFeature=function(e){for(var t=e.loadGeometry()[0],r=0;r<t.length;r++){var i=this.makeRoomFor(\"circle\",4),u=t[r].x,c=t[r].y;if(!(0>u||u>=EXTENT||0>c||c>=EXTENT)){var l=this.addCircleVertex(u,c,-1,-1)-i.vertexStartIndex;this.addCircleVertex(u,c,1,-1),this.addCircleVertex(u,c,1,1),this.addCircleVertex(u,c,-1,1),i.vertexLength+=4,this.addCircleElement(l,l+1,l+2),this.addCircleElement(l,l+3,l+2),i.elementLength+=2}}};\n},{\"../util/util\":95,\"./bucket\":1}],4:[function(require,module,exports){\n\"use strict\";function ElementGroups(e,t,n){this.vertexBuffer=e,this.elementBuffer=t,this.secondElementBuffer=n,this.groups=[]}function ElementGroup(e,t,n){this.vertexStartIndex=e,this.elementStartIndex=t,this.secondElementStartIndex=n,this.elementLength=0,this.vertexLength=0,this.secondElementLength=0}module.exports=ElementGroups,ElementGroups.prototype.makeRoomFor=function(e){return(!this.current||this.current.vertexLength+e>65535)&&(this.current=new ElementGroup(this.vertexBuffer.length,this.elementBuffer&&this.elementBuffer.length,this.secondElementBuffer&&this.secondElementBuffer.length),this.groups.push(this.current)),this.current};\n},{}],5:[function(require,module,exports){\n\"use strict\";function FeatureTree(t,e){this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.rtree=rbush(9),this.toBeInserted=[]}function geometryIntersectsBox(t,e,n){return\"Point\"===e?pointIntersectsBox(t,n):\"LineString\"===e?lineIntersectsBox(t,n):\"Polygon\"===e?polyIntersectsBox(t,n)||lineIntersectsBox(t,n):!1}function polyIntersectsBox(t,e){return polyContainsPoint(t,new Point(e[0],e[1]))||polyContainsPoint(t,new Point(e[0],e[3]))||polyContainsPoint(t,new Point(e[2],e[1]))||polyContainsPoint(t,new Point(e[2],e[3]))?!0:lineIntersectsBox(t,e)}function lineIntersectsBox(t,e){for(var n=0;n<t.length;n++)for(var r=t[n],o=0,i=r.length-1;o<r.length;i=o++){var s=r[o],a=r[i],u=new Point(s.y,s.x),l=new Point(a.y,a.x);if(segmentCrossesHorizontal(s,a,e[0],e[2],e[1])||segmentCrossesHorizontal(s,a,e[0],e[2],e[3])||segmentCrossesHorizontal(u,l,e[1],e[3],e[0])||segmentCrossesHorizontal(u,l,e[1],e[3],e[2]))return!0}return pointIntersectsBox(t,e)}function segmentCrossesHorizontal(t,e,n,r,o){if(e.y===t.y)return e.y===o&&Math.min(t.x,e.x)<=r&&Math.max(t.x,e.x)>=n;var i=(o-t.y)/(e.y-t.y),s=t.x+i*(e.x-t.x);return s>=n&&r>=s&&1>=i&&i>=0}function pointIntersectsBox(t,e){for(var n=0;n<t.length;n++)for(var r=t[n],o=0;o<r.length;o++)if(r[o].x>=e[0]&&r[o].y>=e[1]&&r[o].x<=e[2]&&r[o].y<=e[3])return!0;return!1}function geometryContainsPoint(t,e,n,r){return\"Point\"===e?pointContainsPoint(t,n,r):\"LineString\"===e?lineContainsPoint(t,n,r):\"Polygon\"===e?polyContainsPoint(t,n)||lineContainsPoint(t,n,r):!1}function distToSegmentSquared(t,e,n){var r=e.distSqr(n);if(0===r)return t.distSqr(e);var o=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return 0>o?t.distSqr(e):o>1?t.distSqr(n):t.distSqr(n.sub(e)._mult(o)._add(e))}function lineContainsPoint(t,e,n){for(var r=n*n,o=0;o<t.length;o++)for(var i=t[o],s=1;s<i.length;s++){var a=i[s-1],u=i[s];if(distToSegmentSquared(e,a,u)<r)return!0}return!1}function polyContainsPoint(t,e){for(var n,r,o,i=!1,s=0;s<t.length;s++){n=t[s];for(var a=0,u=n.length-1;a<n.length;u=a++)r=n[a],o=n[u],r.y>e.y!=o.y>e.y&&e.x<(o.x-r.x)*(e.y-r.y)/(o.y-r.y)+r.x&&(i=!i)}return i}function pointContainsPoint(t,e,n){for(var r=n*n,o=0;o<t.length;o++)for(var i=t[o],s=0;s<i.length;s++)if(i[s].distSqr(e)<=r)return!0;return!1}var rbush=require(\"rbush\"),Point=require(\"point-geometry\"),vt=require(\"vector-tile\"),util=require(\"../util/util\");module.exports=FeatureTree,FeatureTree.prototype.insert=function(t,e,n){t.layers=e,t.feature=n,this.toBeInserted.push(t)},FeatureTree.prototype._load=function(){this.rtree.load(this.toBeInserted),this.toBeInserted=[]},FeatureTree.prototype.query=function(t,e){this.toBeInserted.length&&this._load();var n,r,o=t.params||{},i=t.x,s=t.y,a=[];\"undefined\"!=typeof i&&\"undefined\"!=typeof s?(n=(o.radius||0)*(t.tileExtent||4096)/t.scale,r=[i-n,s-n,i+n,s+n]):r=[t.minX,t.minY,t.maxX,t.maxY];for(var u=this.rtree.search(r),l=0;l<u.length;l++){var y=u[l].feature,x=u[l].layers,f=vt.VectorTileFeature.types[y.type];if((!o.$type||f===o.$type)&&(!n||geometryContainsPoint(y.loadGeometry(),f,new Point(i,s),n))&&geometryIntersectsBox(y.loadGeometry(),f,r)){var h=y.toGeoJSON(this.x,this.y,this.z);o.includeGeometry||(h.geometry=null);for(var d=0;d<x.length;d++){var g=x[d];o.layerIds&&o.layerIds.indexOf(g)<0||a.push(util.extend({layer:g},h))}}}e(null,a)};\n},{\"../util/util\":95,\"point-geometry\":128,\"rbush\":130,\"vector-tile\":135}],6:[function(require,module,exports){\n\"use strict\";function FillBucket(){Bucket.apply(this,arguments)}var Bucket=require(\"./bucket\"),util=require(\"../util/util\");module.exports=FillBucket,FillBucket.prototype=util.inherit(Bucket,{}),FillBucket.prototype.shaders={fill:{vertexBuffer:!0,elementBuffer:!0,secondElementBuffer:!0,secondElementBufferComponents:2,attributeArgs:[\"x\",\"y\"],attributes:[{name:\"pos\",components:2,type:Bucket.AttributeType.SHORT,value:[\"x\",\"y\"]}]}},FillBucket.prototype.addFeature=function(e){for(var t=e.loadGeometry(),l=0;l<t.length;l++)this.addFill(t[l])},FillBucket.prototype.addFill=function(e){if(!(e.length<3))for(var t,l,i=e.length,r=this.makeRoomFor(\"fill\",i+1),n=0;n<e.length;n++){var u=e[n],o=this.addFillVertex(u.x,u.y)-r.vertexStartIndex;r.vertexLength++,0===n&&(t=o),n>=2&&(u.x!==e[0].x||u.y!==e[0].y)&&(this.addFillElement(t,l,o),r.elementLength++),n>=1&&(this.addFillSecondElement(l,o),r.secondElementLength++),l=o}};\n},{\"../util/util\":95,\"./bucket\":1}],7:[function(require,module,exports){\n\"use strict\";function LineBucket(){Bucket.apply(this,arguments)}var Bucket=require(\"./bucket\"),util=require(\"../util/util\"),EXTRUDE_SCALE=63;module.exports=LineBucket,LineBucket.prototype=util.inherit(Bucket,{}),LineBucket.prototype.shaders={line:{vertexBuffer:!0,elementBuffer:!0,attributeArgs:[\"point\",\"extrude\",\"tx\",\"ty\",\"dir\",\"linesofar\"],attributes:[{name:\"pos\",components:2,type:Bucket.AttributeType.SHORT,value:[\"(point.x << 1) | tx\",\"(point.y << 1) | ty\"]},{name:\"data\",components:4,type:Bucket.AttributeType.BYTE,value:[\"Math.round(\"+EXTRUDE_SCALE+\" * extrude.x)\",\"Math.round(\"+EXTRUDE_SCALE+\" * extrude.y)\",\"((dir < 0) ? -1 : 1) * ((dir ? 1 : 0) | ((linesofar << 1) & 0x7F))\",\"(linesofar >> 6) & 0x7F\"]}]}},LineBucket.prototype.addFeature=function(e){for(var t=e.loadGeometry(),i=this.layoutProperties,r=0;r<t.length;r++)this.addLine(t[r],i[\"line-join\"],i[\"line-cap\"],i[\"line-miter-limit\"],i[\"line-round-limit\"])},LineBucket.prototype.addLine=function(e,t,i,r,n){for(var s=e.length;s>2&&e[s-1].equals(e[s-2]);)s--;if(!(e.length<2)){\"bevel\"===t&&(r=1.05);var u=e[0],d=e[s-1],a=u.equals(d);if(this.makeRoomFor(\"line\",10*s),2!==s||!a){var h,l,o,x,p,m,f,c=i,v=a?\"butt\":i,L=1,y=0,V=!0;this.e1=this.e2=this.e3=-1,a&&(h=e[s-2],p=u.sub(h)._unit()._perp());for(var _=0;s>_;_++)if(o=a&&_===s-1?e[1]:e[_+1],!o||!e[_].equals(o)){p&&(x=p),h&&(l=h),h=e[_],l&&(y+=h.dist(l)),p=o?o.sub(h)._unit()._perp():x,x=x||p;var b=x.add(p)._unit(),k=b.x*p.x+b.y*p.y,C=1/k,B=l&&o,E=B?t:o?c:v;if(B&&\"round\"===E&&(n>C?E=\"miter\":2>=C&&(E=\"fakeround\")),\"miter\"===E&&C>r&&(E=\"bevel\"),\"bevel\"===E&&(C>2&&(E=\"flipbevel\"),r>C&&(E=\"miter\")),\"miter\"===E)b._mult(C),this.addCurrentVertex(h,L,y,b,0,0,!1);else if(\"flipbevel\"===E){if(C>100)b=p.clone();else{var g=x.x*p.y-x.y*p.x>0?-1:1,S=C*x.add(p).mag()/x.sub(p).mag();b._perp()._mult(S*g)}this.addCurrentVertex(h,L,y,b,0,0,!1),this.addCurrentVertex(h,-L,y,b,0,0,!1)}else if(\"bevel\"===E||\"fakeround\"===E){var q=L*(x.x*p.y-x.y*p.x)>0,T=-Math.sqrt(C*C-1);if(q?(f=0,m=T):(m=0,f=T),V||this.addCurrentVertex(h,L,y,x,m,f,!1),\"fakeround\"===E){for(var A,P=Math.floor(8*(.5-(k-.5))),R=0;P>R;R++)A=p.mult((R+1)/(P+1))._add(x)._unit(),this.addPieSliceVertex(h,L,y,A,q);this.addPieSliceVertex(h,L,y,b,q);for(var F=P-1;F>=0;F--)A=x.mult((F+1)/(P+1))._add(p)._unit(),this.addPieSliceVertex(h,L,y,A,q)}o&&this.addCurrentVertex(h,L,y,p,-m,-f,!1)}else\"butt\"===E?(V||this.addCurrentVertex(h,L,y,x,0,0,!1),o&&this.addCurrentVertex(h,L,y,p,0,0,!1)):\"square\"===E?(V||(this.addCurrentVertex(h,L,y,x,1,1,!1),this.e1=this.e2=-1,L=1),o&&this.addCurrentVertex(h,L,y,p,-1,-1,!1)):\"round\"===E&&(V||(this.addCurrentVertex(h,L,y,x,0,0,!1),this.addCurrentVertex(h,L,y,x,1,1,!0),this.e1=this.e2=-1,L=1),o&&(this.addCurrentVertex(h,L,y,p,-1,-1,!0),this.addCurrentVertex(h,L,y,p,0,0,!1)));V=!1}}}},LineBucket.prototype.addCurrentVertex=function(e,t,i,r,n,s,u){var d,a=u?1:0,h=this.elementGroups.line.current;h.vertexLength+=2,d=r.mult(t),n&&d._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(e,d,a,0,n,i)-h.vertexStartIndex,this.e1>=0&&this.e2>=0&&(this.addLineElement(this.e1,this.e2,this.e3),h.elementLength++),this.e1=this.e2,this.e2=this.e3,d=r.mult(-t),s&&d._sub(r.perp()._mult(s)),this.e3=this.addLineVertex(e,d,a,1,-s,i)-h.vertexStartIndex,this.e1>=0&&this.e2>=0&&(this.addLineElement(this.e1,this.e2,this.e3),h.elementLength++),this.e1=this.e2,this.e2=this.e3},LineBucket.prototype.addPieSliceVertex=function(e,t,i,r,n){var s=n?1:0;r=r.mult(t*(n?-1:1));var u=this.elementGroups.line.current;this.e3=this.addLineVertex(e,r,0,s,0,i)-u.vertexStartIndex,u.vertexLength++,this.e1>=0&&this.e2>=0&&(this.addLineElement(this.e1,this.e2,this.e3),u.elementLength++),n?this.e2=this.e3:this.e1=this.e3};\n},{\"../util/util\":95,\"./bucket\":1}],8:[function(require,module,exports){\n\"use strict\";function SymbolBucket(e){Bucket.apply(this,arguments),this.collisionDebug=e.collisionDebug,this.overscaling=e.overscaling}function SymbolInstance(e,t,o,i,a,s,n,r,l,h,u,c){this.x=e.x,this.y=e.y,this.hasText=!!o,this.hasIcon=!!i,this.hasText&&(this.glyphQuads=s?getGlyphQuads(e,o,n,t,a,l):[],this.textCollisionFeature=new CollisionFeature(t,e,o,n,r,l)),this.hasIcon&&(this.iconQuads=s?getIconQuads(e,i,h,t,a,c):[],this.iconCollisionFeature=new CollisionFeature(t,e,i,h,u,c))}var Point=require(\"point-geometry\"),Bucket=require(\"./bucket\"),ElementGroups=require(\"./element_groups\"),Anchor=require(\"../symbol/anchor\"),getAnchors=require(\"../symbol/get_anchors\"),resolveTokens=require(\"../util/token\"),Quads=require(\"../symbol/quads\"),Shaping=require(\"../symbol/shaping\"),resolveText=require(\"../symbol/resolve_text\"),mergeLines=require(\"../symbol/mergelines\"),shapeText=Shaping.shapeText,shapeIcon=Shaping.shapeIcon,getGlyphQuads=Quads.getGlyphQuads,getIconQuads=Quads.getIconQuads,clipLine=require(\"../symbol/clip_line\"),util=require(\"../util/util\"),CollisionFeature=require(\"../symbol/collision_feature\");module.exports=SymbolBucket,SymbolBucket.prototype=util.inherit(Bucket,{});var shaderAttributeArgs=[\"x\",\"y\",\"ox\",\"oy\",\"tx\",\"ty\",\"minzoom\",\"maxzoom\",\"labelminzoom\"],shaderAttributes=[{name:\"pos\",components:2,type:Bucket.AttributeType.SHORT,value:[\"x\",\"y\"]},{name:\"offset\",components:2,type:Bucket.AttributeType.SHORT,value:[\"Math.round(ox * 64)\",\"Math.round(oy * 64)\"]},{name:\"data1\",components:4,type:Bucket.AttributeType.UNSIGNED_BYTE,value:[\"tx / 4\",\"ty / 4\",\"(labelminzoom || 0) * 10\",\"0\"]},{name:\"data2\",components:2,type:Bucket.AttributeType.UNSIGNED_BYTE,value:[\"(minzoom || 0) * 10\",\"Math.min(maxzoom || 25, 25) * 10\"]}];SymbolBucket.prototype.shaders={glyph:{vertexBuffer:!0,elementBuffer:!0,attributeArgs:shaderAttributeArgs,attributes:shaderAttributes},icon:{vertexBuffer:!0,elementBuffer:!0,attributeArgs:shaderAttributeArgs,attributes:shaderAttributes},collisionBox:{vertexBuffer:\"collisionBoxVertex\",attributeArgs:[\"point\",\"extrude\",\"maxZoom\",\"placementZoom\"],attributes:[{name:\"pos\",components:2,type:Bucket.AttributeType.SHORT,value:[\"point.x\",\"point.y\"]},{name:\"extrude\",components:2,type:Bucket.AttributeType.SHORT,value:[\"Math.round(extrude.x)\",\"Math.round(extrude.y)\"]},{name:\"data\",components:2,type:Bucket.AttributeType.UNSIGNED_BYTE,value:[\"maxZoom * 10\",\"placementZoom * 10\"]}]}},SymbolBucket.prototype.addFeatures=function(e,t,o){var i=512*this.overscaling,a=4096;this.tilePixelRatio=a/i,this.compareText={},this.symbolInstances=[];var s=this.layoutProperties,n=this.features,r=this.textFeatures,l=.5,h=.5;switch(s[\"text-anchor\"]){case\"right\":case\"top-right\":case\"bottom-right\":l=1;break;case\"left\":case\"top-left\":case\"bottom-left\":l=0}switch(s[\"text-anchor\"]){case\"bottom\":case\"bottom-right\":case\"bottom-left\":h=1;break;case\"top\":case\"top-right\":case\"top-left\":h=0}for(var u=\"right\"===s[\"text-justify\"]?1:\"left\"===s[\"text-justify\"]?0:.5,c=24,m=s[\"text-line-height\"]*c,p=\"line\"!==s[\"symbol-placement\"]?s[\"text-max-width\"]*c:0,x=s[\"text-letter-spacing\"]*c,y=[s[\"text-offset\"][0]*c,s[\"text-offset\"][1]*c],g=s[\"text-font\"].join(\",\"),d=[],f=0;f<n.length;f++)d.push(n[f].loadGeometry());if(\"line\"===s[\"symbol-placement\"]){var b=mergeLines(n,r,d);d=b.geometries,n=b.features,r=b.textFeatures}for(var v,B,S=0;S<n.length;S++)if(d[S]){if(v=r[S]?shapeText(r[S],t[g],p,m,l,h,u,x,y):null,s[\"icon-image\"]){var I=resolveTokens(n[S].properties,s[\"icon-image\"]),M=o[I];B=shapeIcon(M,s),M&&(void 0===this.sdfIcons?this.sdfIcons=M.sdf:this.sdfIcons!==M.sdf&&console.warn(\"Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer\"))}else B=null;(v||B)&&this.addFeature(d[S],v,B)}this.placeFeatures(e,this.buffers,this.collisionDebug)},SymbolBucket.prototype.addFeature=function(e,t,o){var i=this.layoutProperties,a=24,s=i[\"text-size\"]/a,n=this.tilePixelRatio*s,r=this.tilePixelRatio*i[\"text-max-size\"]/a,l=this.tilePixelRatio*i[\"icon-size\"],h=this.tilePixelRatio*i[\"symbol-spacing\"],u=i[\"symbol-avoid-edges\"],c=i[\"text-padding\"]*this.tilePixelRatio,m=i[\"icon-padding\"]*this.tilePixelRatio,p=i[\"text-max-angle\"]/180*Math.PI,x=\"map\"===i[\"text-rotation-alignment\"]&&\"line\"===i[\"symbol-placement\"],y=\"map\"===i[\"icon-rotation-alignment\"]&&\"line\"===i[\"symbol-placement\"],g=i[\"text-allow-overlap\"]||i[\"icon-allow-overlap\"]||i[\"text-ignore-placement\"]||i[\"icon-ignore-placement\"],d=\"line\"===i[\"symbol-placement\"],f=h/2;d&&(e=clipLine(e,0,0,4096,4096));for(var b=0;b<e.length;b++)for(var v=e[b],B=d?getAnchors(v,h,p,t,o,a,r,this.overscaling):[new Anchor(v[0].x,v[0].y,0)],S=0,I=B.length;I>S;S++){var M=B[S];if(!(t&&d&&this.anchorIsTooClose(t.text,f,M))){var k=!(M.x<0||M.x>4096||M.y<0||M.y>4096);if(!u||k){var T=k||g;this.symbolInstances.push(new SymbolInstance(M,v,t,o,i,T,n,c,x,l,m,y))}}}},SymbolBucket.prototype.anchorIsTooClose=function(e,t,o){var i=this.compareText;if(e in i){for(var a=i[e],s=a.length-1;s>=0;s--)if(o.dist(a[s])<t)return!0}else i[e]=[];return i[e].push(o),!1},SymbolBucket.prototype.placeFeatures=function(e,t,o){this.resetBuffers(t);var i=this.elementGroups={glyph:new ElementGroups(t.glyphVertex,t.glyphElement),icon:new ElementGroups(t.iconVertex,t.iconElement),sdfIcons:this.sdfIcons},a=this.layoutProperties,s=e.maxScale;i.glyph[\"text-size\"]=a[\"text-size\"],i.icon[\"icon-size\"]=a[\"icon-size\"];var n=\"map\"===a[\"text-rotation-alignment\"]&&\"line\"===a[\"symbol-placement\"],r=\"map\"===a[\"icon-rotation-alignment\"]&&\"line\"===a[\"symbol-placement\"],l=a[\"text-allow-overlap\"]||a[\"icon-allow-overlap\"]||a[\"text-ignore-placement\"]||a[\"icon-ignore-placement\"];if(l){var h=e.angle,u=Math.sin(h),c=Math.cos(h);this.symbolInstances.sort(function(e,t){var o=u*e.x+c*e.y,i=u*t.x+c*t.y;return i-o})}for(var m=0;m<this.symbolInstances.length;m++){var p=this.symbolInstances[m],x=p.hasText,y=p.hasIcon,g=a[\"text-optional\"]||!x,d=a[\"icon-optional\"]||!y,f=x&&!a[\"text-allow-overlap\"]?e.placeCollisionFeature(p.textCollisionFeature):e.minScale,b=y&&!a[\"icon-allow-overlap\"]?e.placeCollisionFeature(p.iconCollisionFeature):e.minScale;g||d?!d&&f?f=Math.max(b,f):!g&&b&&(b=Math.max(b,f)):b=f=Math.max(b,f),x&&(a[\"text-ignore-placement\"]||e.insertCollisionFeature(p.textCollisionFeature,f),s>=f&&this.addSymbols(\"glyph\",p.glyphQuads,f,a[\"text-keep-upright\"],n,e.angle)),y&&(a[\"icon-ignore-placement\"]||e.insertCollisionFeature(p.iconCollisionFeature,b),s>=b&&this.addSymbols(\"icon\",p.iconQuads,b,a[\"icon-keep-upright\"],r,e.angle))}o&&this.addToDebugBuffers(e)},SymbolBucket.prototype.addSymbols=function(e,t,o,i,a,s){for(var n=this.makeRoomFor(e,4*t.length),r=this[this.getAddMethodName(e,\"element\")].bind(this),l=this[this.getAddMethodName(e,\"vertex\")].bind(this),h=this.zoom,u=Math.max(Math.log(o)/Math.LN2+h,0),c=0;c<t.length;c++){var m=t[c],p=m.angle,x=(p+s+Math.PI)%(2*Math.PI);if(!(i&&a&&(x<=Math.PI/2||x>3*Math.PI/2))){var y=m.tl,g=m.tr,d=m.bl,f=m.br,b=m.tex,v=m.anchorPoint,B=Math.max(h+Math.log(m.minScale)/Math.LN2,u),S=Math.min(h+Math.log(m.maxScale)/Math.LN2,25);if(!(B>=S)){B===u&&(B=0);var I=l(v.x,v.y,y.x,y.y,b.x,b.y,B,S,u)-n.vertexStartIndex;l(v.x,v.y,g.x,g.y,b.x+b.w,b.y,B,S,u),l(v.x,v.y,d.x,d.y,b.x,b.y+b.h,B,S,u),l(v.x,v.y,f.x,f.y,b.x+b.w,b.y+b.h,B,S,u),n.vertexLength+=4,r(I,I+1,I+2),r(I+1,I+2,I+3),n.elementLength+=2}}}},SymbolBucket.prototype.updateIcons=function(e){var t=this.layoutProperties[\"icon-image\"];if(t)for(var o=0;o<this.features.length;o++){var i=resolveTokens(this.features[o].properties,t);i&&(e[i]=!0)}},SymbolBucket.prototype.updateFont=function(e){var t=this.layoutProperties[\"text-font\"],o=e[t]=e[t]||{};this.textFeatures=resolveText(this.features,this.layoutProperties,o)},SymbolBucket.prototype.addToDebugBuffers=function(e){this.elementGroups.collisionBox=new ElementGroups(this.buffers.collisionBoxVertex);for(var t=this.makeRoomFor(\"collisionBox\",8),o=-e.angle,i=e.yStretch,a=0;a<this.symbolInstances.length;a++)for(var s=0;2>s;s++){var n=this.symbolInstances[a][0===s?\"textCollisionFeature\":\"iconCollisionFeature\"];if(n)for(var r=n.boxes,l=0;l<r.length;l++){var h=r[l],u=h.anchorPoint,c=new Point(h.x1,h.y1*i)._rotate(o),m=new Point(h.x2,h.y1*i)._rotate(o),p=new Point(h.x1,h.y2*i)._rotate(o),x=new Point(h.x2,h.y2*i)._rotate(o),y=Math.max(0,Math.min(25,this.zoom+Math.log(h.maxScale)/Math.LN2)),g=Math.max(0,Math.min(25,this.zoom+Math.log(h.placementScale)/Math.LN2));this.addCollisionBoxVertex(u,c,y,g),this.addCollisionBoxVertex(u,m,y,g),this.addCollisionBoxVertex(u,m,y,g),this.addCollisionBoxVertex(u,x,y,g),this.addCollisionBoxVertex(u,x,y,g),this.addCollisionBoxVertex(u,p,y,g),this.addCollisionBoxVertex(u,p,y,g),this.addCollisionBoxVertex(u,c,y,g),t.vertexLength+=8}}};\n},{\"../symbol/anchor\":52,\"../symbol/clip_line\":55,\"../symbol/collision_feature\":57,\"../symbol/get_anchors\":59,\"../symbol/mergelines\":62,\"../symbol/quads\":63,\"../symbol/resolve_text\":64,\"../symbol/shaping\":65,\"../util/token\":94,\"../util/util\":95,\"./bucket\":1,\"./element_groups\":4,\"point-geometry\":128}],9:[function(require,module,exports){\n\"use strict\";function Coordinate(o,t,n){this.column=o,this.row=t,this.zoom=n}module.exports=Coordinate,Coordinate.prototype={clone:function(){return new Coordinate(this.column,this.row,this.zoom)},zoomTo:function(o){return this.clone()._zoomTo(o)},sub:function(o){return this.clone()._sub(o)},_zoomTo:function(o){var t=Math.pow(2,o-this.zoom);return this.column*=t,this.row*=t,this.zoom=o,this},_sub:function(o){return o=o.zoomTo(this.zoom),this.column-=o.column,this.row-=o.row,this}};\n},{}],10:[function(require,module,exports){\n\"use strict\";function LngLat(t,n){if(isNaN(t)||isNaN(n))throw new Error(\"Invalid LngLat object: (\"+t+\", \"+n+\")\");if(this.lng=+t,this.lat=+n,this.lat>90||this.lat<-90)throw new Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}module.exports=LngLat;var wrap=require(\"../util/util\").wrap;LngLat.prototype.wrap=function(){return new LngLat(wrap(this.lng,-180,180),this.lat)},LngLat.prototype.toArray=function(){return[this.lng,this.lat]},LngLat.prototype.toString=function(){return\"LngLat(\"+this.lng+\", \"+this.lat+\")\"},LngLat.convert=function(t){return t instanceof LngLat?t:Array.isArray(t)?new LngLat(t[0],t[1]):t};\n},{\"../util/util\":95}],11:[function(require,module,exports){\n\"use strict\";function LngLatBounds(t,n){t&&(n?this.extend(t).extend(n):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}module.exports=LngLatBounds;var LngLat=require(\"./lng_lat\");LngLatBounds.prototype={extend:function(t){var n,e,s=this._sw,i=this._ne;if(t instanceof LngLat)n=t,e=t;else{if(!(t instanceof LngLatBounds))return t?this.extend(LngLat.convert(t)||LngLatBounds.convert(t)):this;if(n=t._sw,e=t._ne,!n||!e)return this}return s||i?(s.lng=Math.min(n.lng,s.lng),s.lat=Math.min(n.lat,s.lat),i.lng=Math.max(e.lng,i.lng),i.lat=Math.max(e.lat,i.lat)):(this._sw=new LngLat(n.lng,n.lat),this._ne=new LngLat(e.lng,e.lat)),this},getCenter:function(){return new LngLat((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new LngLat(this.getWest(),this.getNorth())},getSouthEast:function(){return new LngLat(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return\"LngLatBounds(\"+this._sw.toString()+\", \"+this._ne.toString()+\")\"}},LngLatBounds.convert=function(t){return!t||t instanceof LngLatBounds?t:new LngLatBounds(t)};\n},{\"./lng_lat\":10}],12:[function(require,module,exports){\n\"use strict\";function Transform(t,i){this.tileSize=512,this._minZoom=t||0,this._maxZoom=i||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new LngLat(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var LngLat=require(\"./lng_lat\"),Point=require(\"point-geometry\"),Coordinate=require(\"./coordinate\"),wrap=require(\"../util/util\").wrap,interp=require(\"../util/interpolate\"),glmatrix=require(\"gl-matrix\"),vec4=glmatrix.vec4,mat4=glmatrix.mat4,mat2=glmatrix.mat2;module.exports=Transform,Transform.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new Point(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var i=-wrap(t,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcProjMatrix(),this.rotationMatrix=mat2.create(),mat2.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var i=Math.min(60,t)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcProjMatrix())},get altitude(){return this._altitude},set altitude(t){var i=Math.max(.75,t);this._altitude!==i&&(this._unmodified=!1,this._altitude=i,this._calcProjMatrix())},get zoom(){return this._zoom},set zoom(t){var i=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==i&&(this._unmodified=!1,this._zoom=i,this.scale=this.zoomScale(i),this.tileZoom=Math.floor(i),this.zoomFraction=i-this.tileZoom,this._calcProjMatrix(),this._constrain())},get center(){return this._center},set center(t){(t.lat!==this._center.lat||t.lng!==this._center.lng)&&(this._unmodified=!1,this._center=t,this._calcProjMatrix(),this._constrain())},resize:function(t,i){this.width=t,this.height=i,this.exMatrix=mat4.create(),mat4.ortho(this.exMatrix,0,t,i,0,0,-1),this._calcProjMatrix(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,i){return new Point(this.lngX(t.lng,i),this.latY(t.lat,i))},unproject:function(t,i){return new LngLat(this.xLng(t.x,i),this.yLat(t.y,i))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new Point(this.x,this.y)},lngX:function(t,i){return(180+t)*(i||this.worldSize)/360},latY:function(t,i){var n=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-n)*(i||this.worldSize)/360},xLng:function(t,i){return 360*t/(i||this.worldSize)-180},yLat:function(t,i){var n=180-360*t/(i||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90},panBy:function(t){var i=this.centerPoint._add(t);this.center=this.pointLocation(i)},setLocationAtPoint:function(t,i){var n=this.locationCoordinate(t),o=this.pointCoordinate(i),e=this.pointCoordinate(this.centerPoint),a=o._sub(n);this._unmodified=!1,this.center=this.coordinateLocation(e._sub(a))},setZoomAround:function(t,i){var n;i&&(n=this.locationPoint(i)),this.zoom=t,i&&this.setLocationAtPoint(i,n)},setBearingAround:function(t,i){var n;i&&(n=this.locationPoint(i)),this.bearing=t,i&&this.setLocationAtPoint(i,n)},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var i=this.zoomScale(this.tileZoom)/this.worldSize,n=LngLat.convert(t);return new Coordinate(this.lngX(n.lng)*i,this.latY(n.lat)*i,this.tileZoom)},coordinateLocation:function(t){var i=this.zoomScale(t.zoom);return new LngLat(this.xLng(t.column,i),this.yLat(t.row,i))},pointCoordinate:function(t,i){void 0===i&&(i=0);var n=this.coordinatePointMatrix(this.tileZoom);if(mat4.invert(n,n),!n)throw new Error(\"failed to invert matrix\");var o=[t.x,t.y,0,1],e=[t.x,t.y,1,1];vec4.transformMat4(o,o,n),vec4.transformMat4(e,e,n);var a=o[3],r=e[3],h=o[0]/a,s=e[0]/r,c=o[1]/a,u=e[1]/r,l=o[2]/a,m=e[2]/r,g=l===m?0:(i-l)/(m-l);return new Coordinate(interp(h,s,g),interp(c,u,g),this.tileZoom)},coordinatePoint:function(t){var i=this.coordinatePointMatrix(t.zoom),n=[t.column,t.row,0,1];return vec4.transformMat4(n,n,i),new Point(n[0]/n[3],n[1]/n[3])},coordinatePointMatrix:function(t){var i=mat4.copy(new Float64Array(16),this.projMatrix),n=this.worldSize/this.zoomScale(t);return mat4.scale(i,i,[n,n,1]),mat4.multiply(i,this.getPixelMatrix(),i),i},getPixelMatrix:function(){var t=mat4.create();return mat4.scale(t,t,[this.width/2,-this.height/2,1]),mat4.translate(t,t,[1,-1,0]),t},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,i,n,o,e,a,r,h,s=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),i=this.latY(this.latRange[0]),e=i-t<s.y?s.y/(i-t):0),this.lngRange&&(n=this.lngX(this.lngRange[0]),o=this.lngX(this.lngRange[1]),a=o-n<s.x?s.x/(o-n):0);var u=Math.max(a||0,e||0);if(u)return this.center=this.unproject(new Point(a?(o+n)/2:this.x,e?(i+t)/2:this.y)),this.zoom+=this.scaleZoom(u),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var l=this.y,m=s.y/2;t>l-m&&(h=t+m),l+m>i&&(h=i-m)}if(this.lngRange){var g=this.x,d=s.x/2;n>g-d&&(r=n+d),g+d>o&&(r=o-d)}(void 0!==r||void 0!==h)&&(this.center=this.unproject(new Point(void 0!==r?r:this.x,void 0!==h?h:this.y))),this._unmodified=c,this._constraining=!1}},_calcProjMatrix:function(){var t=new Float64Array(16),i=Math.atan(.5/this.altitude),n=Math.sin(i)*this.altitude/Math.sin(Math.PI/2-this._pitch-i),o=Math.cos(Math.PI/2-this._pitch)*n+this.altitude;mat4.perspective(t,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,o),mat4.translate(t,t,[0,0,-this.altitude]),mat4.scale(t,t,[1,-1,1/this.height]),mat4.rotateX(t,t,this._pitch),mat4.rotateZ(t,t,this.angle),mat4.translate(t,t,[-this.x,-this.y,0]),this.projMatrix=t}};\n},{\"../util/interpolate\":91,\"../util/util\":95,\"./coordinate\":9,\"./lng_lat\":10,\"gl-matrix\":105,\"point-geometry\":128}],13:[function(require,module,exports){\n\"use strict\";var simplexFont={\" \":[16,[]],\"!\":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'\"':[16,[4,21,4,14,-1,-1,12,21,12,14]],\"#\":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],\"%\":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],\"&\":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],\"'\":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],\"(\":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],\")\":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],\"*\":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],\"+\":[26,[13,18,13,0,-1,-1,4,9,22,9]],\",\":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],\"-\":[26,[4,9,22,9]],\".\":[10,[5,2,4,1,5,0,6,1,5,2]],\"/\":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],\":\":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],\";\":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],\"<\":[24,[20,18,4,9,20,0]],\"=\":[26,[4,12,22,12,-1,-1,4,6,22,6]],\">\":[24,[4,18,20,9,4,0]],\"?\":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],\"@\":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],\"[\":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],\"\\\\\":[14,[0,21,14,-3]],\"]\":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],\"^\":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],\"`\":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],\"{\":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],\"|\":[8,[4,25,4,-7]],\"}\":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],\"~\":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};module.exports=function(l,n,t,e){e=e||1;var r,o,u,s,i,x,f,p,h=[];for(r=0,o=l.length;o>r;r++)if(i=simplexFont[l[r]]){for(p=null,u=0,s=i[1].length;s>u;u+=2)-1===i[1][u]&&-1===i[1][u+1]?p=null:(x=n+i[1][u]*e,f=t-i[1][u+1]*e,p&&h.push(p.x,p.y,x,f),p={x:x,y:f});n+=i[0]*e}return h};\n},{}],14:[function(require,module,exports){\n\"use strict\";var mapboxgl=module.exports={};mapboxgl.Map=require(\"./ui/map\"),mapboxgl.Control=require(\"./ui/control/control\"),mapboxgl.Navigation=require(\"./ui/control/navigation\"),mapboxgl.Attribution=require(\"./ui/control/attribution\"),mapboxgl.Popup=require(\"./ui/popup\"),mapboxgl.GeoJSONSource=require(\"./source/geojson_source\"),mapboxgl.VideoSource=require(\"./source/video_source\"),mapboxgl.ImageSource=require(\"./source/image_source\"),mapboxgl.Style=require(\"./style/style\"),mapboxgl.LngLat=require(\"./geo/lng_lat\"),mapboxgl.LngLatBounds=require(\"./geo/lng_lat_bounds\"),mapboxgl.Point=require(\"point-geometry\"),mapboxgl.Evented=require(\"./util/evented\"),mapboxgl.util=require(\"./util/util\"),mapboxgl.supported=require(\"./util/browser\").supported;var ajax=require(\"./util/ajax\");mapboxgl.util.getJSON=ajax.getJSON,mapboxgl.util.getArrayBuffer=ajax.getArrayBuffer;var config=require(\"./util/config\");mapboxgl.config=config,Object.defineProperty(mapboxgl,\"accessToken\",{get:function(){return config.ACCESS_TOKEN},set:function(e){config.ACCESS_TOKEN=e}});\n},{\"./geo/lng_lat\":10,\"./geo/lng_lat_bounds\":11,\"./source/geojson_source\":29,\"./source/image_source\":31,\"./source/video_source\":38,\"./style/style\":46,\"./ui/control/attribution\":68,\"./ui/control/control\":69,\"./ui/control/navigation\":70,\"./ui/map\":80,\"./ui/popup\":81,\"./util/ajax\":83,\"./util/browser\":84,\"./util/config\":88,\"./util/evented\":89,\"./util/util\":95,\"point-geometry\":128}],15:[function(require,module,exports){\n\"use strict\";function drawBackground(t,a,r){var e,i=t.gl,o=a.paint[\"background-color\"],n=a.paint[\"background-pattern\"],l=a.paint[\"background-opacity\"],u=n?t.spriteAtlas.getPosition(n.from,!0):null,m=n?t.spriteAtlas.getPosition(n.to,!0):null;if(u&&m){e=t.patternShader,i.switchShader(e,r),i.uniform1i(e.u_image,0),i.uniform2fv(e.u_pattern_tl_a,u.tl),i.uniform2fv(e.u_pattern_br_a,u.br),i.uniform2fv(e.u_pattern_tl_b,m.tl),i.uniform2fv(e.u_pattern_br_b,m.br),i.uniform1f(e.u_opacity,l);var c=t.transform,f=u.size,s=m.size,_=c.locationCoordinate(c.center),S=1/Math.pow(2,c.zoomFraction);i.uniform1f(e.u_mix,n.t);var d=mat3.create();mat3.scale(d,d,[1/(f[0]*n.fromScale),1/(f[1]*n.fromScale)]),mat3.translate(d,d,[_.column*c.tileSize%(f[0]*n.fromScale),_.row*c.tileSize%(f[1]*n.fromScale)]),mat3.rotate(d,d,-c.angle),mat3.scale(d,d,[S*c.width/2,-S*c.height/2]);var p=mat3.create();mat3.scale(p,p,[1/(s[0]*n.toScale),1/(s[1]*n.toScale)]),mat3.translate(p,p,[_.column*c.tileSize%(s[0]*n.toScale),_.row*c.tileSize%(s[1]*n.toScale)]),mat3.rotate(p,p,-c.angle),mat3.scale(p,p,[S*c.width/2,-S*c.height/2]),i.uniformMatrix3fv(e.u_patternmatrix_a,!1,d),i.uniformMatrix3fv(e.u_patternmatrix_b,!1,p),t.spriteAtlas.bind(i,!0)}else e=t.fillShader,i.switchShader(e,r),i.uniform4fv(e.u_color,o);i.disable(i.STENCIL_TEST),i.bindBuffer(i.ARRAY_BUFFER,t.backgroundBuffer),i.vertexAttribPointer(e.a_pos,t.backgroundBuffer.itemSize,i.SHORT,!1,0,0),i.drawArrays(i.TRIANGLE_STRIP,0,t.backgroundBuffer.itemCount),i.enable(i.STENCIL_TEST),i.stencilMask(0),i.stencilFunc(i.EQUAL,128,128)}var mat3=require(\"gl-matrix\").mat3;module.exports=drawBackground;\n},{\"gl-matrix\":105}],16:[function(require,module,exports){\n\"use strict\";function drawCircles(e,r,i,t){if(t.buffers&&(i=e.translateMatrix(i,t,r.paint[\"circle-translate\"],r.paint[\"circle-translate-anchor\"]),t.elementGroups[r.ref||r.id])){var a=t.elementGroups[r.ref||r.id].circle,l=e.gl;l.disable(l.STENCIL_TEST),l.switchShader(e.circleShader,i,t.exMatrix);var c=t.buffers.circleVertex,n=e.circleShader,s=t.buffers.circleElement,u=1/browser.devicePixelRatio/r.paint[\"circle-radius\"];l.uniform4fv(n.u_color,r.paint[\"circle-color\"]),l.uniform1f(n.u_blur,Math.max(r.paint[\"circle-blur\"],u)),l.uniform1f(n.u_size,r.paint[\"circle-radius\"]);for(var o=0;o<a.groups.length;o++){var d=a.groups[o],f=d.vertexStartIndex*c.itemSize;c.bind(l),c.setAttribPointers(l,n,f),s.bind(l);var S=3*d.elementLength,b=d.elementStartIndex*s.itemSize;l.drawElements(l.TRIANGLES,S,l.UNSIGNED_SHORT,b)}l.enable(l.STENCIL_TEST)}}var browser=require(\"../util/browser.js\");module.exports=drawCircles;\n},{\"../util/browser.js\":84}],17:[function(require,module,exports){\n\"use strict\";function drawPlacementDebug(o,r,e,t){var i=t.elementGroups[r.ref||r.id].collisionBox;if(i){var a=o.gl,n=t.buffers.collisionBoxVertex,s=o.collisionBoxShader;a.enable(a.STENCIL_TEST),a.switchShader(s,e),n.bind(a),n.setAttribPointers(a,s,0),a.lineWidth(1),a.uniform1f(s.u_scale,Math.pow(2,o.transform.zoom-t.coord.z)),a.uniform1f(s.u_zoom,10*o.transform.zoom),a.uniform1f(s.u_maxzoom,10*(t.coord.z+1));var l=i.groups[0].vertexStartIndex,u=i.groups[0].vertexLength;a.drawArrays(a.LINES,l,u),a.disable(a.STENCIL_TEST)}}module.exports=drawPlacementDebug;\n},{}],18:[function(require,module,exports){\n\"use strict\";function drawDebug(e,r){var t=e.gl;t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.switchShader(e.debugShader,r.posMatrix),t.bindBuffer(t.ARRAY_BUFFER,e.debugBuffer),t.vertexAttribPointer(e.debugShader.a_pos,e.debugBuffer.itemSize,t.SHORT,!1,0,0),t.uniform4f(e.debugShader.u_color,1,0,0,1),t.lineWidth(4),t.drawArrays(t.LINE_STRIP,0,e.debugBuffer.itemCount);var i=textVertices(r.coord.toString(),50,200,5);t.bindBuffer(t.ARRAY_BUFFER,e.debugTextBuffer),t.bufferData(t.ARRAY_BUFFER,new Int16Array(i),t.STREAM_DRAW),t.vertexAttribPointer(e.debugShader.a_pos,e.debugTextBuffer.itemSize,t.SHORT,!1,0,0),t.lineWidth(8*browser.devicePixelRatio),t.uniform4f(e.debugShader.u_color,1,1,1,1),t.drawArrays(t.LINES,0,i.length/e.debugTextBuffer.itemSize),t.lineWidth(2*browser.devicePixelRatio),t.uniform4f(e.debugShader.u_color,0,0,0,1),t.drawArrays(t.LINES,0,i.length/e.debugTextBuffer.itemSize),t.blendFunc(t.ONE_MINUS_DST_ALPHA,t.ONE)}var textVertices=require(\"../lib/debugtext\"),browser=require(\"../util/browser\");module.exports=drawDebug;\n},{\"../lib/debugtext\":13,\"../util/browser\":84}],19:[function(require,module,exports){\n\"use strict\";function drawFill(e,t,r,i){if(i.buffers&&i.elementGroups[t.ref||t.id]){var a,l,n,f,o=i.elementGroups[t.ref||t.id].fill,s=e.gl,u=e.translateMatrix(r,i,t.paint[\"fill-translate\"],t.paint[\"fill-translate-anchor\"]),c=t.paint[\"fill-color\"];s.stencilMask(63),s.clear(s.STENCIL_BUFFER_BIT),s.stencilFunc(s.NOTEQUAL,128,128),s.stencilOpSeparate(s.FRONT,s.INCR_WRAP,s.KEEP,s.KEEP),s.stencilOpSeparate(s.BACK,s.DECR_WRAP,s.KEEP,s.KEEP),s.colorMask(!1,!1,!1,!1),s.switchShader(e.fillShader,u),a=i.buffers.fillVertex,a.bind(s),l=i.buffers.fillElement,l.bind(s);for(var m,d,E=0;E<o.groups.length;E++)n=o.groups[E],m=n.vertexStartIndex*a.itemSize,a.setAttribPointers(s,e.fillShader,m),f=3*n.elementLength,d=n.elementStartIndex*l.itemSize,s.drawElements(s.TRIANGLES,f,s.UNSIGNED_SHORT,d);s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.stencilMask(0);var S=t.paint[\"fill-outline-color\"];if(t.paint[\"fill-antialias\"]===!0&&(!t.paint[\"fill-pattern\"]||S)){s.switchShader(e.outlineShader,u),s.lineWidth(2*browser.devicePixelRatio),S?s.stencilFunc(s.EQUAL,128,128):s.stencilFunc(s.EQUAL,128,191),s.uniform2f(e.outlineShader.u_world,s.drawingBufferWidth,s.drawingBufferHeight),s.uniform4fv(e.outlineShader.u_color,S?S:c),a=i.buffers.fillVertex,l=i.buffers.fillSecondElement,l.bind(s);for(var p=0;p<o.groups.length;p++)n=o.groups[p],m=n.vertexStartIndex*a.itemSize,a.setAttribPointers(s,e.outlineShader,m),f=2*n.secondElementLength,d=n.secondElementStartIndex*l.itemSize,s.drawElements(s.LINES,f,s.UNSIGNED_SHORT,d)}var _,h=t.paint[\"fill-pattern\"],b=t.paint[\"fill-opacity\"]||1;if(h){var x=e.spriteAtlas.getPosition(h.from,!0),v=e.spriteAtlas.getPosition(h.to,!0);if(!x||!v)return;_=e.patternShader,s.switchShader(_,r),s.uniform1i(_.u_image,0),s.uniform2fv(_.u_pattern_tl_a,x.tl),s.uniform2fv(_.u_pattern_br_a,x.br),s.uniform2fv(_.u_pattern_tl_b,v.tl),s.uniform2fv(_.u_pattern_br_b,v.br),s.uniform1f(_.u_opacity,b),s.uniform1f(_.u_mix,h.t);var A=i.tileExtent/i.tileSize/Math.pow(2,e.transform.tileZoom-i.coord.z),g=mat3.create();mat3.scale(g,g,[1/(x.size[0]*A*h.fromScale),1/(x.size[1]*A*h.fromScale)]);var w=mat3.create();mat3.scale(w,w,[1/(v.size[0]*A*h.toScale),1/(v.size[1]*A*h.toScale)]),s.uniformMatrix3fv(_.u_patternmatrix_a,!1,g),s.uniformMatrix3fv(_.u_patternmatrix_b,!1,w),e.spriteAtlas.bind(s,!0)}else _=e.fillShader,s.switchShader(_,r),s.uniform4fv(_.u_color,c);s.stencilFunc(s.NOTEQUAL,0,63),s.bindBuffer(s.ARRAY_BUFFER,e.tileExtentBuffer),s.vertexAttribPointer(_.a_pos,e.tileExtentBuffer.itemSize,s.SHORT,!1,0,0),s.drawArrays(s.TRIANGLE_STRIP,0,e.tileExtentBuffer.itemCount),s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}}var browser=require(\"../util/browser\"),mat3=require(\"gl-matrix\").mat3;module.exports=drawFill;\n},{\"../util/browser\":84,\"gl-matrix\":105}],20:[function(require,module,exports){\n\"use strict\";var browser=require(\"../util/browser\"),mat2=require(\"gl-matrix\").mat2;module.exports=function(t,i,e,r){if(r.buffers&&r.elementGroups[i.ref||i.id]){var a=r.elementGroups[i.ref||i.id].line,n=t.gl;if(!(i.paint[\"line-width\"]<=0)){var f=1/browser.devicePixelRatio,o=i.paint[\"line-blur\"]+f,l=i.paint[\"line-width\"]/2,u=-1,s=0,m=0;i.paint[\"line-gap-width\"]>0&&(u=i.paint[\"line-gap-width\"]/2+.5*f,l=i.paint[\"line-width\"],s=u-f/2);var _=s+l+f/2+m,h=i.paint[\"line-color\"],d=t.transform.scale/(1<<r.coord.z)/(r.tileExtent/r.tileSize),p=t.translateMatrix(e,r,i.paint[\"line-translate\"],i.paint[\"line-translate-anchor\"]),c=t.transform,v=mat2.create();mat2.scale(v,v,[1,Math.cos(c._pitch)]),mat2.rotate(v,v,t.transform.angle);var x,b=Math.sqrt(c.height*c.height/4*(1+c.altitude*c.altitude)),w=c.height/2*Math.tan(c._pitch),g=(b+w)/b-1,S=r.tileSize/t.transform.tileSize,M=i.paint[\"line-dasharray\"],z=i.paint[\"line-pattern\"];if(M){x=t.linesdfpatternShader,n.switchShader(x,p,r.exMatrix),n.uniform2fv(x.u_linewidth,[_,u]),n.uniform1f(x.u_ratio,d),n.uniform1f(x.u_blur,o),n.uniform4fv(x.u_color,h);var A=t.lineAtlas.getDash(M.from,\"round\"===i.layout[\"line-cap\"]),y=t.lineAtlas.getDash(M.to,\"round\"===i.layout[\"line-cap\"]);t.lineAtlas.bind(n);var E=Math.pow(2,Math.floor(Math.log(t.transform.scale)/Math.LN2)-r.coord.z)/8*S,P=[E/A.width/M.fromScale,-A.height/2],R=t.lineAtlas.width/(M.fromScale*A.width*256*browser.devicePixelRatio)/2,G=[E/y.width/M.toScale,-y.height/2],I=t.lineAtlas.width/(M.toScale*y.width*256*browser.devicePixelRatio)/2;n.uniform2fv(x.u_patternscale_a,P),n.uniform1f(x.u_tex_y_a,A.y),n.uniform2fv(x.u_patternscale_b,G),n.uniform1f(x.u_tex_y_b,y.y),n.uniform1i(x.u_image,0),n.uniform1f(x.u_sdfgamma,Math.max(R,I)),n.uniform1f(x.u_mix,M.t),n.uniform1f(x.u_extra,g),n.uniform1f(x.u_offset,-i.paint[\"line-offset\"]),n.uniformMatrix2fv(x.u_antialiasingmatrix,!1,v)}else if(z){var N=t.spriteAtlas.getPosition(z.from,!0),q=t.spriteAtlas.getPosition(z.to,!0);if(!N||!q)return;var D=r.tileExtent/r.tileSize/Math.pow(2,t.transform.tileZoom-r.coord.z)*S;t.spriteAtlas.bind(n,!0),x=t.linepatternShader,n.switchShader(x,p,r.exMatrix),n.uniform2fv(x.u_linewidth,[_,u]),n.uniform1f(x.u_ratio,d),n.uniform1f(x.u_blur,o),n.uniform2fv(x.u_pattern_size_a,[N.size[0]*D*z.fromScale,q.size[1]]),n.uniform2fv(x.u_pattern_size_b,[q.size[0]*D*z.toScale,q.size[1]]),n.uniform2fv(x.u_pattern_tl_a,N.tl),n.uniform2fv(x.u_pattern_br_a,N.br),n.uniform2fv(x.u_pattern_tl_b,q.tl),n.uniform2fv(x.u_pattern_br_b,q.br),n.uniform1f(x.u_fade,z.t),n.uniform1f(x.u_opacity,i.paint[\"line-opacity\"]),n.uniform1f(x.u_extra,g),n.uniform1f(x.u_offset,-i.paint[\"line-offset\"]),n.uniformMatrix2fv(x.u_antialiasingmatrix,!1,v)}else x=t.lineShader,n.switchShader(x,p,r.exMatrix),n.uniform2fv(x.u_linewidth,[_,u]),n.uniform1f(x.u_ratio,d),n.uniform1f(x.u_blur,o),n.uniform1f(x.u_extra,g),n.uniform1f(x.u_offset,-i.paint[\"line-offset\"]),n.uniformMatrix2fv(x.u_antialiasingmatrix,!1,v),n.uniform4fv(x.u_color,h);var L=r.buffers.lineVertex;L.bind(n);var T=r.buffers.lineElement;T.bind(n);for(var H=0;H<a.groups.length;H++){var O=a.groups[H],U=O.vertexStartIndex*L.itemSize;L.setAttribPointers(n,x,U);var V=3*O.elementLength,Z=O.elementStartIndex*T.itemSize;n.drawElements(n.TRIANGLES,V,n.UNSIGNED_SHORT,Z)}}}};\n},{\"../util/browser\":84,\"gl-matrix\":105}],21:[function(require,module,exports){\n\"use strict\";function drawRaster(t,r,e,a){var i=t.gl;i.disable(i.STENCIL_TEST);var o=t.rasterShader;i.switchShader(o,e),i.uniform1f(o.u_brightness_low,r.paint[\"raster-brightness-min\"]),i.uniform1f(o.u_brightness_high,r.paint[\"raster-brightness-max\"]),i.uniform1f(o.u_saturation_factor,saturationFactor(r.paint[\"raster-saturation\"])),i.uniform1f(o.u_contrast_factor,contrastFactor(r.paint[\"raster-contrast\"])),i.uniform3fv(o.u_spin_weights,spinWeights(r.paint[\"raster-hue-rotate\"]));var n,u,s=a.source&&a.source._pyramid.findLoadedParent(a.coord,0,{}),c=getOpacities(a,s,r,t.transform);i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.texture),s?(i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,s.texture),n=Math.pow(2,s.coord.z-a.coord.z),u=[a.coord.x*n%1,a.coord.y*n%1]):c[1]=0,i.uniform2fv(o.u_tl_parent,u||[0,0]),i.uniform1f(o.u_scale_parent,n||1),i.uniform1f(o.u_buffer_scale,1),i.uniform1f(o.u_opacity0,c[0]),i.uniform1f(o.u_opacity1,c[1]),i.uniform1i(o.u_image0,0),i.uniform1i(o.u_image1,1),i.bindBuffer(i.ARRAY_BUFFER,a.boundsBuffer||t.tileExtentBuffer),i.vertexAttribPointer(o.a_pos,2,i.SHORT,!1,8,0),i.vertexAttribPointer(o.a_texture_pos,2,i.SHORT,!1,8,4),i.drawArrays(i.TRIANGLE_STRIP,0,4),i.enable(i.STENCIL_TEST)}function spinWeights(t){t*=Math.PI/180;var r=Math.sin(t),e=Math.cos(t);return[(2*e+1)/3,(-Math.sqrt(3)*r-e+1)/3,(Math.sqrt(3)*r-e+1)/3]}function contrastFactor(t){return t>0?1/(1-t):1+t}function saturationFactor(t){return t>0?1-1/(1.001-t):-t}function getOpacities(t,r,e,a){var i=[1,0];if(t.source){var o=(new Date).getTime(),n=e.paint[\"raster-fade-duration\"],u=(o-t.timeAdded)/n,s=r?(o-r.timeAdded)/n:-1,c=t.source._pyramid.coveringZoomLevel(a),f=r?Math.abs(r.coord.z-c)>Math.abs(t.coord.z-c):!1;!r||f?(i[0]=util.clamp(u,0,1),i[1]=1-i[0]):(i[0]=util.clamp(1-s,0,1),i[1]=1-i[0])}var d=e.paint[\"raster-opacity\"];return i[0]*=d,i[1]*=d,i}var util=require(\"../util/util\");module.exports=drawRaster;\n},{\"../util/util\":95}],22:[function(require,module,exports){\n\"use strict\";function drawSymbols(e,t,r,a){if(a.buffers){var o=a.elementGroups[t.ref||t.id];if(o){var i=!(t.layout[\"text-allow-overlap\"]||t.layout[\"icon-allow-overlap\"]||t.layout[\"text-ignore-placement\"]||t.layout[\"icon-ignore-placement\"]),n=e.gl;i&&n.disable(n.STENCIL_TEST),o.glyph.groups.length&&drawSymbol(e,t,r,a,o.glyph,\"text\",!0),o.icon.groups.length&&drawSymbol(e,t,r,a,o.icon,\"icon\",o.sdfIcons),drawCollisionDebug(e,t,r,a),i&&n.enable(n.STENCIL_TEST)}}}function drawSymbol(e,t,r,a,o,i,n){var l=e.gl;r=e.translateMatrix(r,a,t.paint[i+\"-translate\"],t.paint[i+\"-translate-anchor\"]);var m,s,f,u=e.transform,d=\"map\"===t.layout[i+\"-rotation-alignment\"],h=d;h?(m=mat4.create(),s=a.tileExtent/a.tileSize/Math.pow(2,e.transform.zoom-a.coord.z),f=1/Math.cos(u._pitch)):(m=mat4.clone(a.exMatrix),s=e.transform.altitude,f=1),mat4.scale(m,m,[s,s,1]);var p=t.paint[i+\"-size\"],g=p/defaultSizes[i];mat4.scale(m,m,[g,g,1]);var S,c,b,x,v=Math.sqrt(u.height*u.height/4*(1+u.altitude*u.altitude)),_=u.height/2*Math.tan(u._pitch),z=(v+_)/v-1,w=\"text\"===i;if(w||e.style.sprite.loaded()){l.activeTexture(l.TEXTURE0),S=n?e.sdfShader:e.iconShader,w?(e.glyphAtlas.updateTexture(l),c=a.buffers.glyphVertex,b=a.buffers.glyphElement,x=[e.glyphAtlas.width/4,e.glyphAtlas.height/4]):(e.spriteAtlas.bind(l,d||e.options.rotating||e.options.zooming||1!==g||n||e.transform.pitch),c=a.buffers.iconVertex,b=a.buffers.iconElement,x=[e.spriteAtlas.width/4,e.spriteAtlas.height/4]),l.switchShader(S,r,m),l.uniform1i(S.u_texture,0),l.uniform2fv(S.u_texsize,x),l.uniform1i(S.u_skewed,h),l.uniform1f(S.u_extra,z);var y=Math.log(p/o[i+\"-size\"])/Math.LN2||0;l.uniform1f(S.u_zoom,10*(e.transform.zoom-y));var E=e.frameHistory.getFadeProperties(300);l.uniform1f(S.u_fadedist,10*E.fadedist),l.uniform1f(S.u_minfadezoom,Math.floor(10*E.minfadezoom)),l.uniform1f(S.u_maxfadezoom,Math.floor(10*E.maxfadezoom)),l.uniform1f(S.u_fadezoom,10*(e.transform.zoom+E.bump));var T,I,A,N;if(b.bind(l),n){var M=8,L=1.19,R=6,G=.105*defaultSizes[i]/p/browser.devicePixelRatio;l.uniform1f(S.u_gamma,G*f),l.uniform4fv(S.u_color,t.paint[i+\"-color\"]),l.uniform1f(S.u_buffer,.75);for(var D=0;D<o.groups.length;D++)T=o.groups[D],I=T.vertexStartIndex*c.itemSize,c.bind(l),c.setAttribPointers(l,S,I),A=3*T.elementLength,N=T.elementStartIndex*b.itemSize,l.drawElements(l.TRIANGLES,A,l.UNSIGNED_SHORT,N);if(t.paint[i+\"-halo-width\"]){l.uniform1f(S.u_gamma,(t.paint[i+\"-halo-blur\"]*L/g/M+G)*f),l.uniform4fv(S.u_color,t.paint[i+\"-halo-color\"]),l.uniform1f(S.u_buffer,(R-t.paint[i+\"-halo-width\"]/g)/M);for(var P=0;P<o.groups.length;P++)T=o.groups[P],I=T.vertexStartIndex*c.itemSize,c.bind(l),c.setAttribPointers(l,S,I),A=3*T.elementLength,N=T.elementStartIndex*b.itemSize,l.drawElements(l.TRIANGLES,A,l.UNSIGNED_SHORT,N)}}else{l.uniform1f(S.u_opacity,t.paint[\"icon-opacity\"]);for(var q=0;q<o.groups.length;q++)T=o.groups[q],I=T.vertexStartIndex*c.itemSize,c.bind(l),c.setAttribPointers(l,S,I),A=3*T.elementLength,N=T.elementStartIndex*b.itemSize,l.drawElements(l.TRIANGLES,A,l.UNSIGNED_SHORT,N)}}}var browser=require(\"../util/browser\"),mat4=require(\"gl-matrix\").mat4,drawCollisionDebug=require(\"./draw_collision_debug\");module.exports=drawSymbols;var defaultSizes={icon:1,text:24};\n},{\"../util/browser\":84,\"./draw_collision_debug\":17,\"gl-matrix\":105}],23:[function(require,module,exports){\n\"use strict\";function drawVertices(e,r,t,i){function o(r,t,i){f.switchShader(e.dotShader,i),f.uniform1f(e.dotShader.u_size,4*browser.devicePixelRatio),f.uniform1f(e.dotShader.u_blur,.25),f.uniform4fv(e.dotShader.u_color,[.1,0,0,.1]),r.bind(f);for(var o=0;o<t.length;o++){var s=t[o],u=s.vertexStartIndex,a=s.vertexLength;f.vertexAttribPointer(e.dotShader.a_pos,2,f.SHORT,!1,r.itemSize,0),f.drawArrays(f.POINTS,u,a)}}var f=e.gl;if(i&&i.buffers){var s=i.elementGroups[r.ref||r.id];if(s){if(f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA),\"fill\"===r.type)o(i.buffers.fillVertex,s.groups,t);else if(\"symbol\"===r.type)o(i.buffers.iconVertex,s.icon.groups,t),o(i.buffers.glyphVertex,s.glyph.groups,t);else if(\"line\"===r.type){var u=mat4.clone(t);mat4.scale(u,u,[.5,.5,1]),o(i.buffers.lineVertex,s.groups,u)}f.blendFunc(f.ONE_MINUS_DST_ALPHA,f.ONE)}}}var browser=require(\"../util/browser\"),mat4=require(\"gl-matrix\").mat4;module.exports=drawVertices;\n},{\"../util/browser\":84,\"gl-matrix\":105}],24:[function(require,module,exports){\n\"use strict\";function FrameHistory(){this.frameHistory=[]}module.exports=FrameHistory,FrameHistory.prototype.getFadeProperties=function(t){void 0===t&&(t=300);for(var e=(new Date).getTime();this.frameHistory.length>3&&this.frameHistory[1].time+t<e;)this.frameHistory.shift();this.frameHistory[1].time+t<e&&(this.frameHistory[0].z=this.frameHistory[1].z);var r=this.frameHistory.length;3>r&&console.warn(\"there should never be less than three frames in the history\");var i=this.frameHistory[0].z,s=this.frameHistory[r-1],o=s.z,a=Math.min(i,o),m=Math.max(i,o),h=s.z-this.frameHistory[1].z,f=s.time-this.frameHistory[1].time,y=h/(f/t);isNaN(y)&&console.warn(\"fadedist should never be NaN\");var n=(e-s.time)/t*y;return{fadedist:y,minfadezoom:a,maxfadezoom:m,bump:n}},FrameHistory.prototype.record=function(t){var e=(new Date).getTime();this.frameHistory.length||this.frameHistory.push({time:0,z:t},{time:0,z:t}),(2===this.frameHistory.length||this.frameHistory[this.frameHistory.length-1].z!==t)&&this.frameHistory.push({time:e,z:t})};\n},{}],25:[function(require,module,exports){\n\"use strict\";var shaders=require(\"./shaders\"),util=require(\"../util/util\");exports.extend=function(r){var t=r.lineWidth,e=r.getParameter(r.ALIASED_LINE_WIDTH_RANGE);return r.lineWidth=function(i){t.call(r,util.clamp(i,e[0],e[1]))},r.getShader=function(r,t){var e=t===this.FRAGMENT_SHADER?\"fragment\":\"vertex\";if(!shaders[r]||!shaders[r][e])throw new Error(\"Could not find shader \"+r);var i=this.createShader(t),a=shaders[r][e];if(\"undefined\"==typeof orientation&&(a=a.replace(/ highp /g,\" \")),this.shaderSource(i,a),this.compileShader(i),!this.getShaderParameter(i,this.COMPILE_STATUS))throw new Error(this.getShaderInfoLog(i));return i},r.initializeShader=function(r,t,e){var i={program:this.createProgram(),fragment:this.getShader(r,this.FRAGMENT_SHADER),vertex:this.getShader(r,this.VERTEX_SHADER),attributes:[]};if(this.attachShader(i.program,i.vertex),this.attachShader(i.program,i.fragment),this.linkProgram(i.program),this.getProgramParameter(i.program,this.LINK_STATUS)){for(var a=0;a<t.length;a++)i[t[a]]=this.getAttribLocation(i.program,t[a]),i.attributes.push(i[t[a]]);for(var h=0;h<e.length;h++)i[e[h]]=this.getUniformLocation(i.program,e[h])}else console.error(this.getProgramInfoLog(i.program));return i},r.switchShader=function(r,t,e){if(t||console.trace(\"posMatrix does not have required argument\"),this.currentShader!==r){this.useProgram(r.program);for(var i=this.currentShader?this.currentShader.attributes:[],a=r.attributes,h=0;h<i.length;h++)a.indexOf(i[h])<0&&this.disableVertexAttribArray(i[h]);for(var o=0;o<a.length;o++)i.indexOf(a[o])<0&&this.enableVertexAttribArray(a[o]);this.currentShader=r}r.posMatrix!==t&&(this.uniformMatrix4fv(r.u_matrix,!1,t),r.posMatrix=t),e&&r.exMatrix!==e&&r.u_exmatrix&&(this.uniformMatrix4fv(r.u_exmatrix,!1,e),r.exMatrix=e)},r.vertexAttrib2fv=function(t,e){r.vertexAttrib2f(t,e[0],e[1])},r.vertexAttrib3fv=function(t,e){r.vertexAttrib3f(t,e[0],e[1],e[2])},r.vertexAttrib4fv=function(t,e){r.vertexAttrib4f(t,e[0],e[1],e[2],e[3])},r};\n},{\"../util/util\":95,\"./shaders\":28}],26:[function(require,module,exports){\n\"use strict\";function LineAtlas(t,i){this.width=t,this.height=i,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}module.exports=LineAtlas,LineAtlas.prototype.setSprite=function(t){this.sprite=t},LineAtlas.prototype.getDash=function(t,i){var e=t.join(\",\")+i;return this.positions[e]||(this.positions[e]=this.addDash(t,i)),this.positions[e]},LineAtlas.prototype.addDash=function(t,i){var e=i?7:0,h=2*e+1,s=128;if(this.nextRow+h>this.height)return console.warn(\"LineAtlas out of space\"),null;for(var a=0,r=0;r<t.length;r++)a+=t[r];for(var n=this.width/a,o=n/2,d=t.length%2===1,E=-e;e>=E;E++)for(var T=this.nextRow+e+E,l=this.width*T,R=d?-t[t.length-1]:0,u=t[0],g=1,p=0;p<this.width;p++){for(;p/n>u;)R=u,u+=t[g],d&&g===t.length-1&&(u+=t[0]),g++;var x,f=Math.abs(p-R*n),A=Math.abs(p-u*n),w=Math.min(f,A),_=g%2===1;if(i){var y=e?E/e*(o+1):0;if(_){var D=o-Math.abs(y);x=Math.sqrt(w*w+D*D)}else x=o-Math.sqrt(w*w+y*y)}else x=(_?1:-1)*w;this.data[3+4*(l+p)]=Math.max(0,Math.min(255,x+s))}var c={y:(this.nextRow+e+.5)/this.height,height:2*e/this.height,width:a};return this.nextRow+=h,this.dirty=!0,c},LineAtlas.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))},LineAtlas.prototype.debug=function(){var t=document.createElement(\"canvas\");document.body.appendChild(t),t.style.position=\"absolute\",t.style.top=0,t.style.left=0,t.style.background=\"#ff0\",t.width=this.width,t.height=this.height;for(var i=t.getContext(\"2d\"),e=i.getImageData(0,0,this.width,this.height),h=0;h<this.data.length;h++)if(this.sdf){var s=4*h;e.data[s]=e.data[s+1]=e.data[s+2]=0,e.data[s+3]=this.data[h]}else e.data[h]=this.data[h];i.putImageData(e,0,0)};\n},{}],27:[function(require,module,exports){\n\"use strict\";function Painter(t,e){this.gl=glutil.extend(t),this.transform=e,this.reusableTextures={},this.preFbos={},this.frameHistory=new FrameHistory,this.setup()}var glutil=require(\"./gl_util\"),browser=require(\"../util/browser\"),mat4=require(\"gl-matrix\").mat4,FrameHistory=require(\"./frame_history\");module.exports=Painter,Painter.prototype.resize=function(t,e){var i=this.gl;this.width=t*browser.devicePixelRatio,this.height=e*browser.devicePixelRatio,i.viewport(0,0,this.width,this.height)},Painter.prototype.setup=function(){var t=this.gl;t.verbose=!0,t.enable(t.BLEND),t.blendFunc(t.ONE_MINUS_DST_ALPHA,t.ONE),t.enable(t.STENCIL_TEST),this.debugShader=t.initializeShader(\"debug\",[\"a_pos\"],[\"u_matrix\",\"u_color\"]),this.rasterShader=t.initializeShader(\"raster\",[\"a_pos\",\"a_texture_pos\"],[\"u_matrix\",\"u_brightness_low\",\"u_brightness_high\",\"u_saturation_factor\",\"u_spin_weights\",\"u_contrast_factor\",\"u_opacity0\",\"u_opacity1\",\"u_image0\",\"u_image1\",\"u_tl_parent\",\"u_scale_parent\",\"u_buffer_scale\"]),this.circleShader=t.initializeShader(\"circle\",[\"a_pos\"],[\"u_matrix\",\"u_exmatrix\",\"u_blur\",\"u_size\",\"u_color\"]),this.lineShader=t.initializeShader(\"line\",[\"a_pos\",\"a_data\"],[\"u_matrix\",\"u_linewidth\",\"u_color\",\"u_ratio\",\"u_blur\",\"u_extra\",\"u_antialiasingmatrix\",\"u_offset\"]),this.linepatternShader=t.initializeShader(\"linepattern\",[\"a_pos\",\"a_data\"],[\"u_matrix\",\"u_linewidth\",\"u_ratio\",\"u_pattern_size_a\",\"u_pattern_size_b\",\"u_pattern_tl_a\",\"u_pattern_br_a\",\"u_pattern_tl_b\",\"u_pattern_br_b\",\"u_blur\",\"u_fade\",\"u_opacity\",\"u_extra\",\"u_antialiasingmatrix\",\"u_offset\"]),this.linesdfpatternShader=t.initializeShader(\"linesdfpattern\",[\"a_pos\",\"a_data\"],[\"u_matrix\",\"u_linewidth\",\"u_color\",\"u_ratio\",\"u_blur\",\"u_patternscale_a\",\"u_tex_y_a\",\"u_patternscale_b\",\"u_tex_y_b\",\"u_image\",\"u_sdfgamma\",\"u_mix\",\"u_extra\",\"u_antialiasingmatrix\",\"u_offset\"]),this.dotShader=t.initializeShader(\"dot\",[\"a_pos\"],[\"u_matrix\",\"u_size\",\"u_color\",\"u_blur\"]),this.sdfShader=t.initializeShader(\"sdf\",[\"a_pos\",\"a_offset\",\"a_data1\",\"a_data2\"],[\"u_matrix\",\"u_exmatrix\",\"u_texture\",\"u_texsize\",\"u_color\",\"u_gamma\",\"u_buffer\",\"u_zoom\",\"u_fadedist\",\"u_minfadezoom\",\"u_maxfadezoom\",\"u_fadezoom\",\"u_skewed\",\"u_extra\"]),this.iconShader=t.initializeShader(\"icon\",[\"a_pos\",\"a_offset\",\"a_data1\",\"a_data2\"],[\"u_matrix\",\"u_exmatrix\",\"u_texture\",\"u_texsize\",\"u_zoom\",\"u_fadedist\",\"u_minfadezoom\",\"u_maxfadezoom\",\"u_fadezoom\",\"u_opacity\",\"u_skewed\",\"u_extra\"]),this.outlineShader=t.initializeShader(\"outline\",[\"a_pos\"],[\"u_matrix\",\"u_color\",\"u_world\"]),this.patternShader=t.initializeShader(\"pattern\",[\"a_pos\"],[\"u_matrix\",\"u_pattern_tl_a\",\"u_pattern_br_a\",\"u_pattern_tl_b\",\"u_pattern_br_b\",\"u_mix\",\"u_patternmatrix_a\",\"u_patternmatrix_b\",\"u_opacity\",\"u_image\"]),this.fillShader=t.initializeShader(\"fill\",[\"a_pos\"],[\"u_matrix\",\"u_color\"]),this.collisionBoxShader=t.initializeShader(\"collisionbox\",[\"a_pos\",\"a_extrude\",\"a_data\"],[\"u_matrix\",\"u_scale\",\"u_zoom\",\"u_maxzoom\"]),this.identityMatrix=mat4.create(),this.backgroundBuffer=t.createBuffer(),this.backgroundBuffer.itemSize=2,this.backgroundBuffer.itemCount=4,t.bindBuffer(t.ARRAY_BUFFER,this.backgroundBuffer),t.bufferData(t.ARRAY_BUFFER,new Int16Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),this.setExtent(4096),this.debugTextBuffer=t.createBuffer(),this.debugTextBuffer.itemSize=2},Painter.prototype.setExtent=function(t){if(t&&t!==this.tileExtent){this.tileExtent=t;var e=this.gl;this.tileExtentBuffer=e.createBuffer(),this.tileExtentBuffer.itemSize=4,this.tileExtentBuffer.itemCount=4,e.bindBuffer(e.ARRAY_BUFFER,this.tileExtentBuffer),e.bufferData(e.ARRAY_BUFFER,new Int16Array([0,0,0,0,this.tileExtent,0,32767,0,0,this.tileExtent,0,32767,this.tileExtent,this.tileExtent,32767,32767]),e.STATIC_DRAW),this.debugBuffer=e.createBuffer(),this.debugBuffer.itemSize=2,this.debugBuffer.itemCount=5,e.bindBuffer(e.ARRAY_BUFFER,this.debugBuffer),e.bufferData(e.ARRAY_BUFFER,new Int16Array([0,0,this.tileExtent-1,0,this.tileExtent-1,this.tileExtent-1,0,this.tileExtent-1,0,0]),e.STATIC_DRAW)}},Painter.prototype.clearColor=function(){var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},Painter.prototype.clearStencil=function(){var t=this.gl;t.clearStencil(0),t.stencilMask(255),t.clear(t.STENCIL_BUFFER_BIT)},Painter.prototype.drawClippingMask=function(t){var e=this.gl;e.switchShader(this.fillShader,t.posMatrix),e.colorMask(!1,!1,!1,!1),e.clearStencil(0),e.stencilMask(191),e.clear(e.STENCIL_BUFFER_BIT),e.stencilFunc(e.EQUAL,192,64),e.stencilMask(192),e.stencilOp(e.REPLACE,e.KEEP,e.KEEP),e.bindBuffer(e.ARRAY_BUFFER,this.tileExtentBuffer),e.vertexAttribPointer(this.fillShader.a_pos,this.tileExtentBuffer.itemSize,e.SHORT,!1,8,0),e.drawArrays(e.TRIANGLE_STRIP,0,this.tileExtentBuffer.itemCount),e.stencilFunc(e.EQUAL,128,128),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.stencilMask(0),e.colorMask(!0,!0,!0,!0)},Painter.prototype.prepareBuffers=function(){},Painter.prototype.bindDefaultFramebuffer=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)};var draw={symbol:require(\"./draw_symbol\"),circle:require(\"./draw_circle\"),line:require(\"./draw_line\"),fill:require(\"./draw_fill\"),raster:require(\"./draw_raster\"),background:require(\"./draw_background\"),debug:require(\"./draw_debug\"),vertices:require(\"./draw_vertices\")};Painter.prototype.render=function(t,e){this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.spriteAtlas=t.spriteAtlas,this.spriteAtlas.setSprite(t.sprite),this.glyphAtlas=t.glyphAtlas,this.glyphAtlas.bind(this.gl),this.frameHistory.record(this.transform.zoom),this.prepareBuffers(),this.clearColor();for(var i=t._groups.length-1;i>=0;i--){var r=t._groups[i],a=t.sources[r.source];a?(this.clearStencil(),a.render(r,this)):void 0===r.source&&this.drawLayers(r,this.identityMatrix)}},Painter.prototype.drawTile=function(t,e){this.setExtent(t.tileExtent),this.drawClippingMask(t),this.drawLayers(e,t.posMatrix,t),this.options.debug&&draw.debug(this,t)},Painter.prototype.drawLayers=function(t,e,i){for(var r=t.length-1;r>=0;r--){var a=t[r];a.hidden||(draw[a.type](this,a,e,i),this.options.vertices&&draw.vertices(this,a,e,i))}},Painter.prototype.drawStencilBuffer=function(){var t=this.gl;t.switchShader(this.fillShader,this.identityMatrix),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.stencilMask(0),t.stencilFunc(t.EQUAL,128,128),t.bindBuffer(t.ARRAY_BUFFER,this.backgroundBuffer),t.vertexAttribPointer(this.fillShader.a_pos,this.backgroundBuffer.itemSize,t.SHORT,!1,0,0),t.uniform4fv(this.fillShader.u_color,[0,0,0,.5]),t.drawArrays(t.TRIANGLE_STRIP,0,this.tileExtentBuffer.itemCount),t.blendFunc(t.ONE_MINUS_DST_ALPHA,t.ONE)},Painter.prototype.translateMatrix=function(t,e,i,r){if(!i[0]&&!i[1])return t;if(\"viewport\"===r){var a=Math.sin(-this.transform.angle),s=Math.cos(-this.transform.angle);i=[i[0]*s-i[1]*a,i[0]*a+i[1]*s]}var u=this.transform.scale/(1<<e.coord.z)/(e.tileExtent/e.tileSize),n=[i[0]/u,i[1]/u,0],_=new Float32Array(16);return mat4.translate(_,t,n),_},Painter.prototype.saveTexture=function(t){var e=this.reusableTextures[t.size];e?e.push(t):this.reusableTextures[t.size]=[t]},Painter.prototype.getTexture=function(t){var e=this.reusableTextures[t];return e&&e.length>0?e.pop():null};\n},{\"../util/browser\":84,\"./draw_background\":15,\"./draw_circle\":16,\"./draw_debug\":18,\"./draw_fill\":19,\"./draw_line\":20,\"./draw_raster\":21,\"./draw_symbol\":22,\"./draw_vertices\":23,\"./frame_history\":24,\"./gl_util\":25,\"gl-matrix\":105}],28:[function(require,module,exports){\n\"use strict\";var path=require(\"path\");module.exports={debug:{fragment:\"precision mediump float;\\n\\nuniform vec4 u_color;\\n\\nvoid main() {\\n gl_FragColor = u_color;\\n}\\n\",vertex:\"precision mediump float;\\n\\nattribute vec2 a_pos;\\n\\nuniform highp mat4 u_matrix;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);\\n}\\n\"},dot:{fragment:\"precision mediump float;\\n\\nuniform vec4 u_color;\\nuniform float u_blur;\\n\\nvoid main() {\\n float dist = length(gl_PointCoord - 0.5);\\n float t = smoothstep(0.5, 0.5 - u_blur, dist);\\n\\n gl_FragColor = u_color * t;\\n}\\n\",vertex:\"precision mediump float;\\n\\nuniform highp mat4 u_matrix;\\nuniform float u_size;\\n\\nattribute vec2 a_pos;\\n\\nvoid main(void) {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n gl_PointSize = u_size;\\n}\\n\"},fill:{fragment:\"precision mediump float;\\n\\nuniform vec4 u_color;\\n\\nvoid main() {\\n gl_FragColor = u_color;\\n}\\n\",vertex:\"precision mediump float;\\n\\nattribute vec2 a_pos;\\nuniform highp mat4 u_matrix;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n}\\n\"},circle:{fragment:\"precision mediump float;\\n\\nuniform vec4 u_color;\\nuniform float u_blur;\\nuniform float u_size;\\n\\nvarying vec2 v_extrude;\\n\\nvoid main() {\\n float t = smoothstep(1.0 - u_blur, 1.0, length(v_extrude));\\n gl_FragColor = u_color * (1.0 - t);\\n}\\n\",vertex:\"precision mediump float;\\n\\n// set by gl_util\\nuniform float u_size;\\n\\nattribute vec2 a_pos;\\n\\nuniform highp mat4 u_matrix;\\nuniform mat4 u_exmatrix;\\n\\nvarying vec2 v_extrude;\\n\\nvoid main(void) {\\n // unencode the extrusion vector that we snuck into the a_pos vector\\n v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\\n\\n vec4 extrude = u_exmatrix * vec4(v_extrude * u_size, 0, 0);\\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\\n // in extrusion data\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\\n\\n // gl_Position is divided by gl_Position.w after this shader runs.\\n // Multiply the extrude by it so that it isn't affected by it.\\n gl_Position += extrude * gl_Position.w;\\n}\\n\"},line:{fragment:\"precision mediump float;\\n\\nuniform vec2 u_linewidth;\\nuniform vec4 u_color;\\nuniform float u_blur;\\n\\nvarying vec2 v_normal;\\nvarying float v_linesofar;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n // Calculate the distance of the pixel from the line in pixels.\\n float dist = length(v_normal) * u_linewidth.s;\\n\\n // Calculate the antialiasing fade factor. This is either when fading in\\n // the line in case of an offset line (v_linewidth.t) or when fading out\\n // (v_linewidth.s)\\n float blur = u_blur * v_gamma_scale;\\n float alpha = clamp(min(dist - (u_linewidth.t - blur), u_linewidth.s - dist) / blur, 0.0, 1.0);\\n\\n gl_FragColor = u_color * alpha;\\n}\\n\",vertex:\"precision mediump float;\\n\\n// floor(127 / 2) == 63.0\\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\\n// there are also \\\"special\\\" normals that have a bigger length (of up to 126 in\\n// this case).\\n// #define scale 63.0\\n#define scale 0.015873016\\n\\nattribute vec2 a_pos;\\nattribute vec4 a_data;\\n\\nuniform highp mat4 u_matrix;\\nuniform float u_ratio;\\nuniform vec2 u_linewidth;\\nuniform float u_extra;\\nuniform mat2 u_antialiasingmatrix;\\nuniform float u_offset;\\n\\nvarying vec2 v_normal;\\nvarying float v_linesofar;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_extrude = a_data.xy;\\n float a_direction = sign(a_data.z) * mod(a_data.z, 2.0);\\n\\n // We store the texture normals in the most insignificant bit\\n // transform y so that 0 => -1 and 1 => 1\\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\\n // y is 1 if the normal points up, and -1 if it points down\\n vec2 normal = mod(a_pos, 2.0);\\n normal.y = sign(normal.y - 0.5);\\n v_normal = normal;\\n\\n // Scale the extrusion vector down to a normal and then up by the line width\\n // of this vertex.\\n vec4 dist = vec4(u_linewidth.s * a_extrude * scale, 0.0, 0.0);\\n\\n // Calculate the offset when drawing a line that is to the side of the actual line.\\n // We do this by creating a vector that points towards the extrude, but rotate\\n // it when we're drawing round end points (a_direction = -1 or 1) since their\\n // extrude vector points in another direction.\\n float u = 0.5 * a_direction;\\n float t = 1.0 - abs(u);\\n vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\\n\\n // Remove the texture normal bit of the position before scaling it with the\\n // model/view matrix.\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist.xy) / u_ratio, 0.0, 1.0);\\n\\n // position of y on the screen\\n float y = gl_Position.y / gl_Position.w;\\n\\n // how much features are squished in the y direction by the tilt\\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\\n\\n // how much features are squished in all directions by the perspectiveness\\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\\n\\n v_gamma_scale = perspective_scale * squish_scale;\\n}\\n\"},linepattern:{fragment:\"precision mediump float;\\n\\nuniform vec2 u_linewidth;\\nuniform float u_point;\\nuniform float u_blur;\\n\\nuniform vec2 u_pattern_size_a;\\nuniform vec2 u_pattern_size_b;\\nuniform vec2 u_pattern_tl_a;\\nuniform vec2 u_pattern_br_a;\\nuniform vec2 u_pattern_tl_b;\\nuniform vec2 u_pattern_br_b;\\nuniform float u_fade;\\nuniform float u_opacity;\\n\\nuniform sampler2D u_image;\\n\\nvarying vec2 v_normal;\\nvarying float v_linesofar;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n // Calculate the distance of the pixel from the line in pixels.\\n float dist = length(v_normal) * u_linewidth.s;\\n\\n // Calculate the antialiasing fade factor. This is either when fading in\\n // the line in case of an offset line (v_linewidth.t) or when fading out\\n // (v_linewidth.s)\\n float blur = u_blur * v_gamma_scale;\\n float alpha = clamp(min(dist - (u_linewidth.t - blur), u_linewidth.s - dist) / blur, 0.0, 1.0);\\n\\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\\n float y_a = 0.5 + (v_normal.y * u_linewidth.s / u_pattern_size_a.y);\\n float y_b = 0.5 + (v_normal.y * u_linewidth.s / u_pattern_size_b.y);\\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\\n\\n vec4 color = mix(texture2D(u_image, pos), texture2D(u_image, pos2), u_fade);\\n\\n alpha *= u_opacity;\\n\\n gl_FragColor = color * alpha;\\n}\\n\",vertex:\"precision mediump float;\\n\\n// floor(127 / 2) == 63.0\\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\\n// there are also \\\"special\\\" normals that have a bigger length (of up to 126 in\\n// this case).\\n// #define scale 63.0\\n#define scale 0.015873016\\n\\nattribute vec2 a_pos;\\nattribute vec4 a_data;\\n\\nuniform highp mat4 u_matrix;\\nuniform float u_ratio;\\nuniform vec2 u_linewidth;\\nuniform vec4 u_color;\\nuniform float u_extra;\\nuniform mat2 u_antialiasingmatrix;\\nuniform float u_offset;\\n\\nvarying vec2 v_normal;\\nvarying float v_linesofar;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_extrude = a_data.xy;\\n float a_direction = sign(a_data.z) * mod(a_data.z, 2.0);\\n float a_linesofar = abs(floor(a_data.z / 2.0)) + a_data.w * 64.0;\\n\\n // We store the texture normals in the most insignificant bit\\n // transform y so that 0 => -1 and 1 => 1\\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\\n // y is 1 if the normal points up, and -1 if it points down\\n vec2 normal = mod(a_pos, 2.0);\\n normal.y = sign(normal.y - 0.5);\\n v_normal = normal;\\n\\n // Scale the extrusion vector down to a normal and then up by the line width\\n // of this vertex.\\n vec2 extrude = a_extrude * scale;\\n vec2 dist = u_linewidth.s * extrude;\\n\\n // Calculate the offset when drawing a line that is to the side of the actual line.\\n // We do this by creating a vector that points towards the extrude, but rotate\\n // it when we're drawing round end points (a_direction = -1 or 1) since their\\n // extrude vector points in another direction.\\n float u = 0.5 * a_direction;\\n float t = 1.0 - abs(u);\\n vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\\n\\n // Remove the texture normal bit of the position before scaling it with the\\n // model/view matrix.\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist.xy) / u_ratio, 0.0, 1.0);\\n v_linesofar = a_linesofar;\\n\\n // position of y on the screen\\n float y = gl_Position.y / gl_Position.w;\\n\\n // how much features are squished in the y direction by the tilt\\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\\n\\n // how much features are squished in all directions by the perspectiveness\\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\\n\\n v_gamma_scale = perspective_scale * squish_scale;\\n}\\n\"},linesdfpattern:{fragment:\"precision mediump float;\\n\\nuniform vec2 u_linewidth;\\nuniform vec4 u_color;\\nuniform float u_blur;\\nuniform sampler2D u_image;\\nuniform float u_sdfgamma;\\nuniform float u_mix;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_tex_a;\\nvarying vec2 v_tex_b;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n // Calculate the distance of the pixel from the line in pixels.\\n float dist = length(v_normal) * u_linewidth.s;\\n\\n // Calculate the antialiasing fade factor. This is either when fading in\\n // the line in case of an offset line (v_linewidth.t) or when fading out\\n // (v_linewidth.s)\\n float blur = u_blur * v_gamma_scale;\\n float alpha = clamp(min(dist - (u_linewidth.t - blur), u_linewidth.s - dist) / blur, 0.0, 1.0);\\n\\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\\n\\n gl_FragColor = u_color * alpha;\\n}\\n\",vertex:\"precision mediump float;\\n\\n// floor(127 / 2) == 63.0\\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\\n// there are also \\\"special\\\" normals that have a bigger length (of up to 126 in\\n// this case).\\n// #define scale 63.0\\n#define scale 0.015873016\\n\\nattribute vec2 a_pos;\\nattribute vec4 a_data;\\n\\nuniform highp mat4 u_matrix;\\nuniform vec2 u_linewidth;\\nuniform float u_ratio;\\nuniform vec2 u_patternscale_a;\\nuniform float u_tex_y_a;\\nuniform vec2 u_patternscale_b;\\nuniform float u_tex_y_b;\\nuniform float u_extra;\\nuniform mat2 u_antialiasingmatrix;\\nuniform float u_offset;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_tex_a;\\nvarying vec2 v_tex_b;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_extrude = a_data.xy;\\n float a_direction = sign(a_data.z) * mod(a_data.z, 2.0);\\n float a_linesofar = abs(floor(a_data.z / 2.0)) + a_data.w * 64.0;\\n\\n // We store the texture normals in the most insignificant bit\\n // transform y so that 0 => -1 and 1 => 1\\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\\n // y is 1 if the normal points up, and -1 if it points down\\n vec2 normal = mod(a_pos, 2.0);\\n normal.y = sign(normal.y - 0.5);\\n v_normal = normal;\\n\\n // Scale the extrusion vector down to a normal and then up by the line width\\n // of this vertex.\\n vec4 dist = vec4(u_linewidth.s * a_extrude * scale, 0.0, 0.0);\\n\\n // Calculate the offset when drawing a line that is to the side of the actual line.\\n // We do this by creating a vector that points towards the extrude, but rotate\\n // it when we're drawing round end points (a_direction = -1 or 1) since their\\n // extrude vector points in another direction.\\n float u = 0.5 * a_direction;\\n float t = 1.0 - abs(u);\\n vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\\n\\n // Remove the texture normal bit of the position before scaling it with the\\n // model/view matrix.\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist.xy) / u_ratio, 0.0, 1.0);\\n\\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\\n\\n // position of y on the screen\\n float y = gl_Position.y / gl_Position.w;\\n\\n // how much features are squished in the y direction by the tilt\\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\\n\\n // how much features are squished in all directions by the perspectiveness\\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\\n\\n v_gamma_scale = perspective_scale * squish_scale;\\n}\\n\"},outline:{fragment:\"precision mediump float;\\n\\nuniform vec4 u_color;\\n\\nvarying vec2 v_pos;\\n\\nvoid main() {\\n float dist = length(v_pos - gl_FragCoord.xy);\\n float alpha = smoothstep(1.0, 0.0, dist);\\n gl_FragColor = u_color * alpha;\\n}\\n\",vertex:\"precision mediump float;\\n\\nattribute vec2 a_pos;\\n\\nuniform highp mat4 u_matrix;\\nuniform vec2 u_world;\\n\\nvarying vec2 v_pos;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n v_pos = (gl_Position.xy/gl_Position.w + 1.0) / 2.0 * u_world;\\n}\\n\"},pattern:{fragment:\"precision mediump float;\\n\\nuniform float u_opacity;\\nuniform vec2 u_pattern_tl_a;\\nuniform vec2 u_pattern_br_a;\\nuniform vec2 u_pattern_tl_b;\\nuniform vec2 u_pattern_br_b;\\nuniform float u_mix;\\n\\nuniform sampler2D u_image;\\n\\nvarying vec2 v_pos_a;\\nvarying vec2 v_pos_b;\\n\\nvoid main() {\\n\\n vec2 imagecoord = mod(v_pos_a, 1.0);\\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\\n vec4 color1 = texture2D(u_image, pos);\\n\\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\\n vec4 color2 = texture2D(u_image, pos2);\\n\\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\\n}\\n\",vertex:\"precision mediump float;\\n\\nuniform highp mat4 u_matrix;\\nuniform mat3 u_patternmatrix_a;\\nuniform mat3 u_patternmatrix_b;\\n\\nattribute vec2 a_pos;\\n\\nvarying vec2 v_pos_a;\\nvarying vec2 v_pos_b;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n v_pos_a = (u_patternmatrix_a * vec3(a_pos, 1)).xy;\\n v_pos_b = (u_patternmatrix_b * vec3(a_pos, 1)).xy;\\n}\\n\"},raster:{fragment:\"precision mediump float;\\n\\nuniform float u_opacity0;\\nuniform float u_opacity1;\\nuniform sampler2D u_image0;\\nuniform sampler2D u_image1;\\nvarying vec2 v_pos0;\\nvarying vec2 v_pos1;\\n\\nuniform float u_brightness_low;\\nuniform float u_brightness_high;\\n\\nuniform float u_saturation_factor;\\nuniform float u_contrast_factor;\\nuniform vec3 u_spin_weights;\\n\\nvoid main() {\\n\\n // read and cross-fade colors from the main and parent tiles\\n vec4 color0 = texture2D(u_image0, v_pos0);\\n vec4 color1 = texture2D(u_image1, v_pos1);\\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\\n vec3 rgb = color.rgb;\\n\\n // spin\\n rgb = vec3(\\n dot(rgb, u_spin_weights.xyz),\\n dot(rgb, u_spin_weights.zxy),\\n dot(rgb, u_spin_weights.yzx));\\n\\n // saturation\\n float average = (color.r + color.g + color.b) / 3.0;\\n rgb += (average - rgb) * u_saturation_factor;\\n\\n // contrast\\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\\n\\n // brightness\\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\\n\\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\\n}\\n\",vertex:\"precision mediump float;\\n\\nuniform highp mat4 u_matrix;\\nuniform vec2 u_tl_parent;\\nuniform float u_scale_parent;\\nuniform float u_buffer_scale;\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_texture_pos;\\n\\nvarying vec2 v_pos0;\\nvarying vec2 v_pos1;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\\n}\\n\"},icon:{fragment:\"precision mediump float;\\n\\nuniform sampler2D u_texture;\\n\\nvarying vec2 v_tex;\\nvarying float v_alpha;\\n\\nvoid main() {\\n gl_FragColor = texture2D(u_texture, v_tex) * v_alpha;\\n}\\n\",vertex:\"precision mediump float;\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_offset;\\nattribute vec4 a_data1;\\nattribute vec4 a_data2;\\n\\n\\n// matrix is for the vertex position, exmatrix is for rotating and projecting\\n// the extrusion vector.\\nuniform highp mat4 u_matrix;\\nuniform mat4 u_exmatrix;\\nuniform float u_zoom;\\nuniform float u_fadedist;\\nuniform float u_minfadezoom;\\nuniform float u_maxfadezoom;\\nuniform float u_fadezoom;\\nuniform float u_opacity;\\nuniform bool u_skewed;\\nuniform float u_extra;\\n\\nuniform vec2 u_texsize;\\n\\nvarying vec2 v_tex;\\nvarying float v_alpha;\\n\\nvoid main() {\\n vec2 a_tex = a_data1.xy;\\n float a_labelminzoom = a_data1[2];\\n vec2 a_zoom = a_data2.st;\\n float a_minzoom = a_zoom[0];\\n float a_maxzoom = a_zoom[1];\\n\\n float a_fadedist = 10.0;\\n\\n // u_zoom is the current zoom level adjusted for the change in font size\\n float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\\n\\n // fade out labels\\n float alpha = clamp((u_fadezoom - a_labelminzoom) / u_fadedist, 0.0, 1.0);\\n\\n if (u_fadedist >= 0.0) {\\n v_alpha = alpha;\\n } else {\\n v_alpha = 1.0 - alpha;\\n }\\n if (u_maxfadezoom < a_labelminzoom) {\\n v_alpha = 0.0;\\n }\\n if (u_minfadezoom >= a_labelminzoom) {\\n v_alpha = 1.0;\\n }\\n\\n // if label has been faded out, clip it\\n z += step(v_alpha, 0.0);\\n\\n if (u_skewed) {\\n vec4 extrude = u_exmatrix * vec4(a_offset / 64.0, 0, 0);\\n gl_Position = u_matrix * vec4(a_pos + extrude.xy, 0, 1);\\n gl_Position.z += z * gl_Position.w;\\n } else {\\n vec4 extrude = u_exmatrix * vec4(a_offset / 64.0, z, 0);\\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + extrude;\\n }\\n\\n v_tex = a_tex / u_texsize;\\n\\n v_alpha *= u_opacity;\\n}\\n\"},sdf:{fragment:\"precision mediump float;\\n\\nuniform sampler2D u_texture;\\nuniform vec4 u_color;\\nuniform float u_buffer;\\nuniform float u_gamma;\\n\\nvarying vec2 v_tex;\\nvarying float v_alpha;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n float gamma = u_gamma * v_gamma_scale;\\n float dist = texture2D(u_texture, v_tex).a;\\n float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * v_alpha;\\n gl_FragColor = u_color * alpha;\\n}\\n\",vertex:\"precision mediump float;\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_offset;\\nattribute vec4 a_data1;\\nattribute vec4 a_data2;\\n\\n\\n// matrix is for the vertex position, exmatrix is for rotating and projecting\\n// the extrusion vector.\\nuniform highp mat4 u_matrix;\\nuniform mat4 u_exmatrix;\\n\\nuniform float u_zoom;\\nuniform float u_fadedist;\\nuniform float u_minfadezoom;\\nuniform float u_maxfadezoom;\\nuniform float u_fadezoom;\\nuniform bool u_skewed;\\nuniform float u_extra;\\n\\nuniform vec2 u_texsize;\\n\\nvarying vec2 v_tex;\\nvarying float v_alpha;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_tex = a_data1.xy;\\n float a_labelminzoom = a_data1[2];\\n vec2 a_zoom = a_data2.st;\\n float a_minzoom = a_zoom[0];\\n float a_maxzoom = a_zoom[1];\\n\\n // u_zoom is the current zoom level adjusted for the change in font size\\n float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\\n\\n // fade out labels\\n float alpha = clamp((u_fadezoom - a_labelminzoom) / u_fadedist, 0.0, 1.0);\\n\\n if (u_fadedist >= 0.0) {\\n v_alpha = alpha;\\n } else {\\n v_alpha = 1.0 - alpha;\\n }\\n if (u_maxfadezoom < a_labelminzoom) {\\n v_alpha = 0.0;\\n }\\n if (u_minfadezoom >= a_labelminzoom) {\\n v_alpha = 1.0;\\n }\\n\\n // if label has been faded out, clip it\\n z += step(v_alpha, 0.0);\\n\\n if (u_skewed) {\\n vec4 extrude = u_exmatrix * vec4(a_offset / 64.0, 0, 0);\\n gl_Position = u_matrix * vec4(a_pos + extrude.xy, 0, 1);\\n gl_Position.z += z * gl_Position.w;\\n } else {\\n vec4 extrude = u_exmatrix * vec4(a_offset / 64.0, z, 0);\\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + extrude;\\n }\\n\\n // position of y on the screen\\n float y = gl_Position.y / gl_Position.w;\\n // how much features are squished in all directions by the perspectiveness\\n float perspective_scale = 1.0 / (1.0 - y * u_extra);\\n v_gamma_scale = perspective_scale;\\n\\n v_tex = a_tex / u_texsize;\\n}\\n\"},collisionbox:{fragment:\"precision mediump float;\\n\\nuniform float u_zoom;\\nuniform float u_maxzoom;\\n\\nvarying float v_max_zoom;\\nvarying float v_placement_zoom;\\n\\nvoid main() {\\n\\n float alpha = 0.5;\\n\\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\\n\\n if (v_placement_zoom > u_zoom) {\\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\\n }\\n\\n if (u_zoom >= v_max_zoom) {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\\n }\\n\\n if (v_placement_zoom >= u_maxzoom) {\\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\\n }\\n}\\n\",vertex:\"precision mediump float;\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_extrude;\\nattribute vec2 a_data;\\n\\nuniform highp mat4 u_matrix;\\nuniform float u_scale;\\n\\nvarying float v_max_zoom;\\nvarying float v_placement_zoom;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\\n\\n v_max_zoom = a_data.x;\\n v_placement_zoom = a_data.y;\\n}\\n\"}};\n},{\"path\":125}],29:[function(require,module,exports){\n\"use strict\";function GeoJSONSource(e){e=e||{},this._data=e.data,void 0!==e.maxzoom&&(this.maxzoom=e.maxzoom),this.geojsonVtOptions={maxZoom:this.maxzoom},void 0!==e.buffer&&(this.geojsonVtOptions.buffer=e.buffer),void 0!==e.tolerance&&(this.geojsonVtOptions.tolerance=e.tolerance),this._pyramid=new TilePyramid({tileSize:512,minzoom:this.minzoom,maxzoom:this.maxzoom,cacheSize:20,load:this._loadTile.bind(this),abort:this._abortTile.bind(this),unload:this._unloadTile.bind(this),add:this._addTile.bind(this),remove:this._removeTile.bind(this),redoPlacement:this._redoTilePlacement.bind(this)})}var util=require(\"../util/util\"),Evented=require(\"../util/evented\"),TilePyramid=require(\"./tile_pyramid\"),Source=require(\"./source\"),urlResolve=require(\"resolve-url\");module.exports=GeoJSONSource,GeoJSONSource.prototype=util.inherit(Evented,{minzoom:0,maxzoom:14,_dirty:!0,setData:function(e){return this._data=e,this._dirty=!0,this.fire(\"change\"),this.map&&this.update(this.map.transform),this},onAdd:function(e){this.map=e},loaded:function(){return this._loaded&&this._pyramid.loaded()},update:function(e){this._dirty&&this._updateData(),this._loaded&&this._pyramid.update(this.used,e)},reload:function(){this._loaded&&this._pyramid.reload()},render:Source._renderTiles,featuresAt:Source._vectorFeaturesAt,featuresIn:Source._vectorFeaturesIn,_updateData:function(){this._dirty=!1;var e=this._data;\"string\"==typeof e&&\"undefined\"!=typeof window&&(e=urlResolve(window.location.href,e)),this.workerID=this.dispatcher.send(\"parse geojson\",{data:e,tileSize:512,source:this.id,geojsonVtOptions:this.geojsonVtOptions},function(e){this._loaded=!0,e?this.fire(\"error\",{error:e}):(this._pyramid.reload(),this.fire(\"change\"))}.bind(this))},_loadTile:function(e){var i=e.coord.z>this.maxzoom?Math.pow(2,e.coord.z-this.maxzoom):1,t={uid:e.uid,coord:e.coord,zoom:e.coord.z,maxZoom:this.maxzoom,tileSize:512,source:this.id,overscaling:i,angle:this.map.transform.angle,pitch:this.map.transform.pitch,collisionDebug:this.map.collisionDebug};e.workerID=this.dispatcher.send(\"load geojson tile\",t,function(i,t){if(e.unloadVectorData(this.map.painter),!e.aborted){if(i)return void this.fire(\"tile.error\",{tile:e});e.loadVectorData(t),e.redoWhenDone&&(e.redoWhenDone=!1,e.redoPlacement(this)),this.fire(\"tile.load\",{tile:e})}}.bind(this),this.workerID)},_abortTile:function(e){e.aborted=!0},_addTile:function(e){this.fire(\"tile.add\",{tile:e})},_removeTile:function(e){this.fire(\"tile.remove\",{tile:e})},_unloadTile:function(e){e.unloadVectorData(this.map.painter),this.glyphAtlas.removeGlyphs(e.uid),this.dispatcher.send(\"remove tile\",{uid:e.uid,source:this.id},null,e.workerID)},redoPlacement:Source.redoPlacement,_redoTilePlacement:function(e){e.redoPlacement(this)}});\n},{\"../util/evented\":89,\"../util/util\":95,\"./source\":33,\"./tile_pyramid\":36,\"resolve-url\":131}],30:[function(require,module,exports){\n\"use strict\";function GeoJSONWrapper(e){this.features=e,this.length=e.length}function FeatureWrapper(e){this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=4096}var Point=require(\"point-geometry\"),VectorTileFeature=require(\"vector-tile\").VectorTileFeature;module.exports=GeoJSONWrapper,GeoJSONWrapper.prototype.feature=function(e){return new FeatureWrapper(this.features[e])},FeatureWrapper.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var r=e[t],o=[],a=0;a<r.length;a++)o.push(new Point(r[a][0],r[a][1]));this.geometry.push(o)}return this.geometry},FeatureWrapper.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-(1/0),o=1/0,a=-(1/0),p=0;p<e.length;p++)for(var i=e[p],n=0;n<i.length;n++){var h=i[n];t=Math.min(t,h.x),r=Math.max(r,h.x),o=Math.min(o,h.y),a=Math.max(a,h.y)}return[t,o,r,a]},FeatureWrapper.prototype.toGeoJSON=VectorTileFeature.prototype.toGeoJSON;\n},{\"point-geometry\":128,\"vector-tile\":135}],31:[function(require,module,exports){\n\"use strict\";function ImageSource(e){this.coordinates=e.coordinates,ajax.getImage(e.url,function(e,t){e||(this.image=t,this.image.addEventListener(\"load\",function(){this.map._rerender()}.bind(this)),this._loaded=!0,this.map&&(this.createTile(),this.fire(\"change\")))}.bind(this))}var util=require(\"../util/util\"),Tile=require(\"./tile\"),LngLat=require(\"../geo/lng_lat\"),Point=require(\"point-geometry\"),Evented=require(\"../util/evented\"),ajax=require(\"../util/ajax\");module.exports=ImageSource,ImageSource.prototype=util.inherit(Evented,{onAdd:function(e){this.map=e,this.image&&this.createTile()},createTile:function(){var e=this.map,t=this.coordinates.map(function(t){var i=LngLat.convert(t);return e.transform.locationCoordinate(i).zoomTo(0)}),i=util.getCoordinatesCenter(t),r=4096,a=t.map(function(e){var t=e.zoomTo(i.zoom);return new Point(Math.round((t.column-i.column)*r),Math.round((t.row-i.row)*r))}),n=e.painter.gl,o=32767,u=new Int16Array([a[0].x,a[0].y,0,0,a[1].x,a[1].y,o,0,a[3].x,a[3].y,0,o,a[2].x,a[2].y,o,o]);this.tile=new Tile,this.tile.buckets={},this.tile.boundsBuffer=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,this.tile.boundsBuffer),n.bufferData(n.ARRAY_BUFFER,u,n.STATIC_DRAW),this.center=i},loaded:function(){return this.image&&this.image.complete},update:function(){},reload:function(){},render:function(e,t){if(this._loaded&&this.loaded()){var i=this.center;this.tile.calculateMatrices(i.zoom,i.column,i.row,this.map.transform,t);var r=t.gl;this.tile.texture?(r.bindTexture(r.TEXTURE_2D,this.tile.texture),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.image)):(this.tile.texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.tile.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,this.image)),t.drawLayers(e,this.tile.posMatrix,this.tile)}},featuresAt:function(e,t,i){return i(null,[])},featuresIn:function(e,t,i){return i(null,[])}});\n},{\"../geo/lng_lat\":10,\"../util/ajax\":83,\"../util/evented\":89,\"../util/util\":95,\"./tile\":34,\"point-geometry\":128}],32:[function(require,module,exports){\n\"use strict\";function RasterTileSource(e){util.extend(this,util.pick(e,[\"url\",\"tileSize\"])),Source._loadTileJSON.call(this,e)}var util=require(\"../util/util\"),ajax=require(\"../util/ajax\"),Evented=require(\"../util/evented\"),Source=require(\"./source\"),normalizeURL=require(\"../util/mapbox\").normalizeTileURL;module.exports=RasterTileSource,RasterTileSource.prototype=util.inherit(Evented,{minzoom:0,maxzoom:22,roundZoom:!0,tileSize:512,_loaded:!1,onAdd:function(e){this.map=e},loaded:function(){return this._pyramid&&this._pyramid.loaded()},update:function(e){this._pyramid&&this._pyramid.update(this.used,e,this.map.style.rasterFadeDuration)},reload:function(){},render:Source._renderTiles,_loadTile:function(e){function t(t,i){if(delete e.request,!e.aborted){if(t)return e.errored=!0,void this.fire(\"tile.error\",{tile:e,error:t});var r=this.map.painter.gl;e.texture=this.map.painter.getTexture(i.width),e.texture?(r.bindTexture(r.TEXTURE_2D,e.texture),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,i)):(e.texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,e.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,i),e.texture.size=i.width),r.generateMipmap(r.TEXTURE_2D),e.timeAdded=(new Date).getTime(),this.map.animationLoop.set(this.style.rasterFadeDuration),e.source=this,e.loaded=!0,this.fire(\"tile.load\",{tile:e})}}var i=normalizeURL(e.coord.url(this.tiles),this.url);e.request=ajax.getImage(i,t.bind(this))},_abortTile:function(e){e.aborted=!0,e.request&&(e.request.abort(),delete e.request)},_addTile:function(e){this.fire(\"tile.add\",{tile:e})},_removeTile:function(e){this.fire(\"tile.remove\",{tile:e})},_unloadTile:function(e){e.texture&&this.map.painter.saveTexture(e.texture)},featuresAt:function(e,t,i){i(null,[])},featuresIn:function(e,t,i){i(null,[])}});\n},{\"../util/ajax\":83,\"../util/evented\":89,\"../util/mapbox\":92,\"../util/util\":95,\"./source\":33}],33:[function(require,module,exports){\n\"use strict\";var util=require(\"../util/util\"),ajax=require(\"../util/ajax\"),browser=require(\"../util/browser\"),TilePyramid=require(\"./tile_pyramid\"),TileCoord=require(\"./tile_coord\"),normalizeURL=require(\"../util/mapbox\").normalizeSourceURL;exports._loadTileJSON=function(e){var i=function(e,i){return e?void this.fire(\"error\",{error:e}):(util.extend(this,util.pick(i,[\"tiles\",\"minzoom\",\"maxzoom\",\"attribution\"])),i.vector_layers&&(this.vectorLayers=i.vector_layers,this.vectorLayerIds=this.vectorLayers.map(function(e){return e.id})),this._pyramid=new TilePyramid({tileSize:this.tileSize,cacheSize:20,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom,reparseOverscaled:this.reparseOverscaled,load:this._loadTile.bind(this),abort:this._abortTile.bind(this),unload:this._unloadTile.bind(this),add:this._addTile.bind(this),remove:this._removeTile.bind(this),redoPlacement:this._redoTilePlacement?this._redoTilePlacement.bind(this):void 0}),void this.fire(\"load\"))}.bind(this);e.url?ajax.getJSON(normalizeURL(e.url),i):browser.frame(i.bind(this,null,e))},exports.redoPlacement=function(){if(this._pyramid)for(var e=this._pyramid.orderedIDs(),i=0;i<e.length;i++){var r=this._pyramid.getTile(e[i]);this._redoTilePlacement(r)}},exports._renderTiles=function(e,i){if(this._pyramid)for(var r=this._pyramid.renderedIDs(),t=0;t<r.length;t++){var o=this._pyramid.getTile(r[t]),a=TileCoord.fromID(r[t]),s=a.z,n=a.x,l=a.y,d=a.w;s=Math.min(s,this.maxzoom),n+=d*(1<<s),o.calculateMatrices(s,n,l,i.transform,i),i.drawTile(o,e)}},exports._vectorFeaturesAt=function(e,i,r){if(!this._pyramid)return r(null,[]);var t=this._pyramid.tileAt(e);return t?void this.dispatcher.send(\"query features\",{uid:t.tile.uid,x:t.x,y:t.y,tileExtent:t.tile.tileExtent,scale:t.scale,source:this.id,params:i},r,t.tile.workerID):r(null,[])},exports._vectorFeaturesIn=function(e,i,r){if(!this._pyramid)return r(null,[]);var t=this._pyramid.tilesIn(e);return t?void util.asyncAll(t,function(e,r){this.dispatcher.send(\"query features\",{uid:e.tile.uid,source:this.id,minX:e.minX,maxX:e.maxX,minY:e.minY,maxY:e.maxY,params:i},r,e.tile.workerID)}.bind(this),function(e,i){r(e,Array.prototype.concat.apply([],i))}):r(null,[])},exports.create=function(e){var i={vector:require(\"./vector_tile_source\"),raster:require(\"./raster_tile_source\"),geojson:require(\"./geojson_source\"),video:require(\"./video_source\"),image:require(\"./image_source\")};for(var r in i)if(e instanceof i[r])return e;return new i[e.type](e)};\n},{\"../util/ajax\":83,\"../util/browser\":84,\"../util/mapbox\":92,\"../util/util\":95,\"./geojson_source\":29,\"./image_source\":31,\"./raster_tile_source\":32,\"./tile_coord\":35,\"./tile_pyramid\":36,\"./vector_tile_source\":37,\"./video_source\":38}],34:[function(require,module,exports){\n\"use strict\";function Tile(t,e){this.coord=t,this.uid=util.uniqueId(),this.loaded=!1,this.uses=0,this.tileSize=e}function unserializeBuffers(t){var e={};for(var i in t)e[i]=new Buffer(t[i]);return e}var mat4=require(\"gl-matrix\").mat4,util=require(\"../util/util\"),Buffer=require(\"../data/buffer\");module.exports=Tile,Tile.prototype={tileExtent:4096,calculateMatrices:function(t,e,i,s){var r=Math.pow(2,t),o=s.worldSize/r;this.scale=o,this.posMatrix=new Float64Array(16),mat4.identity(this.posMatrix),mat4.translate(this.posMatrix,this.posMatrix,[e*o,i*o,0]),mat4.scale(this.posMatrix,this.posMatrix,[o/this.tileExtent,o/this.tileExtent,1]),mat4.multiply(this.posMatrix,s.projMatrix,this.posMatrix),this.posMatrix=new Float32Array(this.posMatrix),this.exMatrix=s.exMatrix,this.rotationMatrix=s.rotationMatrix},positionAt:function(t,e){return t=t.zoomTo(Math.min(this.coord.z,e)),{x:(t.column-this.coord.x)*this.tileExtent,y:(t.row-this.coord.y)*this.tileExtent,scale:this.scale}},loadVectorData:function(t){this.loaded=!0,t&&(this.buffers=unserializeBuffers(t.buffers),this.elementGroups=t.elementGroups,this.tileExtent=t.extent)},reloadSymbolData:function(t,e){if(this.buffers){this.buffers.glyphVertex&&this.buffers.glyphVertex.destroy(e.gl),this.buffers.glyphElement&&this.buffers.glyphElement.destroy(e.gl),this.buffers.iconVertex&&this.buffers.iconVertex.destroy(e.gl),this.buffers.iconElement&&this.buffers.iconElement.destroy(e.gl),this.buffers.collisionBoxVertex&&this.buffers.collisionBoxVertex.destroy(e.gl);var i=unserializeBuffers(t.buffers);this.buffers.glyphVertex=i.glyphVertex,this.buffers.glyphElement=i.glyphElement,this.buffers.iconVertex=i.iconVertex,this.buffers.iconElement=i.iconElement,this.buffers.collisionBoxVertex=i.collisionBoxVertex;for(var s in t.elementGroups)this.elementGroups[s]=t.elementGroups[s]}},unloadVectorData:function(t){for(var e in this.buffers)this.buffers[e]&&this.buffers[e].destroy(t.gl);this.buffers=null},redoPlacement:function(t){function e(e,i){this.reloadSymbolData(i,t.map.painter),t.fire(\"tile.load\",{tile:this}),this.redoingPlacement=!1,this.redoWhenDone&&(this.redoPlacement(t),this.redoWhenDone=!1)}return!this.loaded||this.redoingPlacement?void(this.redoWhenDone=!0):(this.redoingPlacement=!0,void t.dispatcher.send(\"redo placement\",{uid:this.uid,source:t.id,angle:t.map.transform.angle,pitch:t.map.transform.pitch,collisionDebug:t.map.collisionDebug},e.bind(this),this.workerID))}};\n},{\"../data/buffer\":2,\"../util/util\":95,\"gl-matrix\":105}],35:[function(require,module,exports){\n\"use strict\";function TileCoord(t,i,o,r){isNaN(r)&&(r=0),this.z=+t,this.x=+i,this.y=+o,this.w=+r,r*=2,0>r&&(r=-1*r-1);var e=1<<this.z;this.id=32*(e*e*r+e*this.y+this.x)+this.z}function edge(t,i){if(t.row>i.row){var o=t;t=i,i=o}return{x0:t.column,y0:t.row,x1:i.column,y1:i.row,dx:i.column-t.column,dy:i.row-t.row}}function scanSpans(t,i,o,r,e){var n=Math.max(o,Math.floor(i.y0)),h=Math.min(r,Math.ceil(i.y1));if(t.x0===i.x0&&t.y0===i.y0?t.x0+i.dy/t.dy*t.dx<i.x1:t.x1-i.dy/t.dy*t.dx<i.x0){var s=t;t=i,i=s}for(var d=t.dx/t.dy,a=i.dx/i.dy,l=t.dx>0,y=i.dx<0,x=n;h>x;x++){var c=d*Math.max(0,Math.min(t.dy,x+l-t.y0))+t.x0,u=a*Math.max(0,Math.min(i.dy,x+y-i.y0))+i.x0;e(Math.floor(u),Math.ceil(c),x)}}function scanTriangle(t,i,o,r,e,n){var h,s=edge(t,i),d=edge(i,o),a=edge(o,t);s.dy>d.dy&&(h=s,s=d,d=h),s.dy>a.dy&&(h=s,s=a,a=h),d.dy>a.dy&&(h=d,d=a,a=h),s.dy&&scanSpans(a,s,r,e,n),d.dy&&scanSpans(a,d,r,e,n)}module.exports=TileCoord,TileCoord.prototype.toString=function(){return this.z+\"/\"+this.x+\"/\"+this.y},TileCoord.fromID=function(t){var i=t%32,o=1<<i,r=(t-i)/32,e=r%o,n=(r-e)/o%o,h=Math.floor(r/(o*o));return h%2!==0&&(h=-1*h-1),h/=2,new TileCoord(i,e,n,h)},TileCoord.prototype.url=function(t,i){return t[(this.x+this.y)%t.length].replace(\"{prefix}\",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(\"{z}\",Math.min(this.z,i||this.z)).replace(\"{x}\",this.x).replace(\"{y}\",this.y)},TileCoord.prototype.parent=function(t){return 0===this.z?null:this.z>t?new TileCoord(this.z-1,this.x,this.y,this.w):new TileCoord(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},TileCoord.prototype.wrapped=function(){return new TileCoord(this.z,this.x,this.y,0)},TileCoord.prototype.children=function(t){if(this.z>=t)return[new TileCoord(this.z+1,this.x,this.y,this.w)];var i=this.z+1,o=2*this.x,r=2*this.y;return[new TileCoord(i,o,r,this.w),new TileCoord(i,o+1,r,this.w),new TileCoord(i,o,r+1,this.w),new TileCoord(i,o+1,r+1,this.w)]},TileCoord.cover=function(t,i,o){function r(t,i,r){var h,s,d;if(r>=0&&e>=r)for(h=t;i>h;h++)s=(h%e+e)%e,d=new TileCoord(o,s,r,Math.floor(h/e)),n[d.id]=d}var e=1<<t,n={};return scanTriangle(i[0],i[1],i[2],0,e,r),scanTriangle(i[2],i[3],i[0],0,e,r),Object.keys(n).map(function(t){return n[t]})};\n},{}],36:[function(require,module,exports){\n\"use strict\";function TilePyramid(e){this.tileSize=e.tileSize,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,this.roundZoom=e.roundZoom,this.reparseOverscaled=e.reparseOverscaled,this._load=e.load,this._abort=e.abort,this._unload=e.unload,this._add=e.add,this._remove=e.remove,this._redoPlacement=e.redoPlacement,this._tiles={},this._cache=new Cache(e.cacheSize,function(e){return this._unload(e)}.bind(this)),this._filterRendered=this._filterRendered.bind(this)}function compareKeyZoom(e,i){return i%32-e%32}var Tile=require(\"./tile\"),TileCoord=require(\"./tile_coord\"),Point=require(\"point-geometry\"),Cache=require(\"../util/mru_cache\"),util=require(\"../util/util\");module.exports=TilePyramid,TilePyramid.prototype={loaded:function(){for(var e in this._tiles)if(!this._tiles[e].loaded&&!this._tiles[e].errored)return!1;return!0},orderedIDs:function(){return Object.keys(this._tiles).map(Number).sort(compareKeyZoom)},renderedIDs:function(){return this.orderedIDs().filter(this._filterRendered)},_filterRendered:function(e){return this._tiles[e].loaded&&!this._coveredTiles[e]},reload:function(){this._cache.reset();for(var e in this._tiles)this._load(this._tiles[e])},getTile:function(e){return this._tiles[e]},getZoom:function(e){return e.zoom+Math.log(e.tileSize/this.tileSize)/Math.LN2},coveringZoomLevel:function(e){return(this.roundZoom?Math.round:Math.floor)(this.getZoom(e))},coveringTiles:function(e){var i=this.coveringZoomLevel(e),t=i;if(i<this.minzoom)return[];i>this.maxzoom&&(i=this.maxzoom);var o=e,r=o.locationCoordinate(o.center)._zoomTo(i),s=new Point(r.column-.5,r.row-.5);return TileCoord.cover(i,[o.pointCoordinate(new Point(0,0))._zoomTo(i),o.pointCoordinate(new Point(o.width,0))._zoomTo(i),o.pointCoordinate(new Point(o.width,o.height))._zoomTo(i),o.pointCoordinate(new Point(0,o.height))._zoomTo(i)],this.reparseOverscaled?t:i).sort(function(e,i){return s.dist(e)-s.dist(i)})},findLoadedChildren:function(e,i,t){var o=!1;for(var r in this._tiles){var s=this._tiles[r];if(!(t[r]||!s.loaded||s.coord.z<=e.z||s.coord.z>i)){var n=Math.pow(2,Math.min(s.coord.z,this.maxzoom)-Math.min(e.z,this.maxzoom));if(Math.floor(s.coord.x/n)===e.x&&Math.floor(s.coord.y/n)===e.y)for(t[r]=!0,o=!0;s&&s.coord.z-1>e.z;){var d=s.coord.parent(this.maxzoom).id;s=this._tiles[d],s&&s.loaded&&(delete t[r],t[d]=!0)}}}return o},findLoadedParent:function(e,i,t){for(var o=e.z-1;o>=i;o--){e=e.parent(this.maxzoom);var r=this._tiles[e.id];if(r&&r.loaded)return t[e.id]=!0,r}},update:function(e,i,t){var o,r,s,n=(this.roundZoom?Math.round:Math.floor)(this.getZoom(i)),d=util.clamp(n-10,this.minzoom,this.maxzoom),a=util.clamp(n+3,this.minzoom,this.maxzoom),h={},l=(new Date).getTime();this._coveredTiles={};var m=e?this.coveringTiles(i):[];for(o=0;o<m.length;o++)r=m[o],s=this.addTile(r),h[r.id]=!0,s.loaded||this.findLoadedChildren(r,a,h)||this.findLoadedParent(r,d,h);for(var c in h)r=TileCoord.fromID(c),s=this._tiles[c],s&&s.timeAdded>l-(t||0)&&(this.findLoadedChildren(r,a,h)?(this._coveredTiles[c]=!0,h[c]=!0):this.findLoadedParent(r,d,h));var u=util.keysDifference(this._tiles,h);for(o=0;o<u.length;o++)this.removeTile(+u[o])},addTile:function(e){var i=this._tiles[e.id];if(i)return i;var t=e.wrapped();if(i=this._tiles[t.id],i||(i=this._cache.get(t.id),i&&this._redoPlacement&&this._redoPlacement(i)),!i){var o=e.z,r=o>this.maxzoom?Math.pow(2,o-this.maxzoom):1;i=new Tile(t,this.tileSize*r),this._load(i)}return i.uses++,this._tiles[e.id]=i,this._add(i,e),i},removeTile:function(e){var i=this._tiles[e];i&&(i.uses--,delete this._tiles[e],this._remove(i),i.uses>0||(i.loaded?this._cache.add(i.coord.wrapped().id,i):(this._abort(i),this._unload(i))))},clearTiles:function(){for(var e in this._tiles)this.removeTile(e);this._cache.reset()},tileAt:function(e){for(var i=this.orderedIDs(),t=0;t<i.length;t++){var o=this._tiles[i[t]],r=o.positionAt(e,this.maxzoom);if(r&&r.x>=0&&r.x<o.tileExtent&&r.y>=0&&r.y<o.tileExtent)return{tile:o,x:r.x,y:r.y,scale:r.scale}}},tilesIn:function(e){for(var i=[],t=this.orderedIDs(),o=0;o<t.length;o++){var r=this._tiles[t[o]],s=[r.positionAt(e[0],this.maxzoom),r.positionAt(e[1],this.maxzoom)];s[0].x<r.tileExtent&&s[0].y<r.tileExtent&&s[1].x>=0&&s[1].y>=0&&i.push({tile:r,minX:s[0].x,maxX:s[1].x,minY:s[0].y,maxY:s[1].y})}return i}};\n},{\"../util/mru_cache\":93,\"../util/util\":95,\"./tile\":34,\"./tile_coord\":35,\"point-geometry\":128}],37:[function(require,module,exports){\n\"use strict\";function VectorTileSource(e){if(util.extend(this,util.pick(e,[\"url\",\"tileSize\"])),512!==this.tileSize)throw new Error(\"vector tile sources must have a tileSize of 512\");Source._loadTileJSON.call(this,e)}var util=require(\"../util/util\"),Evented=require(\"../util/evented\"),Source=require(\"./source\"),normalizeURL=require(\"../util/mapbox\").normalizeTileURL;module.exports=VectorTileSource,VectorTileSource.prototype=util.inherit(Evented,{minzoom:0,maxzoom:22,tileSize:512,reparseOverscaled:!0,_loaded:!1,onAdd:function(e){this.map=e},loaded:function(){return this._pyramid&&this._pyramid.loaded()},update:function(e){this._pyramid&&this._pyramid.update(this.used,e)},reload:function(){this._pyramid&&this._pyramid.reload()},render:Source._renderTiles,featuresAt:Source._vectorFeaturesAt,featuresIn:Source._vectorFeaturesIn,_loadTile:function(e){var i=e.coord.z>this.maxzoom?Math.pow(2,e.coord.z-this.maxzoom):1,t={url:normalizeURL(e.coord.url(this.tiles,this.maxzoom),this.url),uid:e.uid,coord:e.coord,zoom:e.coord.z,tileSize:this.tileSize*i,source:this.id,overscaling:i,angle:this.map.transform.angle,pitch:this.map.transform.pitch,collisionDebug:this.map.collisionDebug};e.workerID?this.dispatcher.send(\"reload tile\",t,this._tileLoaded.bind(this,e),e.workerID):e.workerID=this.dispatcher.send(\"load tile\",t,this._tileLoaded.bind(this,e))},_tileLoaded:function(e,i,t){if(!e.aborted){if(i)return void this.fire(\"tile.error\",{tile:e,error:i});e.loadVectorData(t),e.redoWhenDone&&(e.redoWhenDone=!1,e.redoPlacement(this)),this.fire(\"tile.load\",{tile:e}),this.fire(\"tile.stats\",t.bucketStats)}},_abortTile:function(e){e.aborted=!0,this.dispatcher.send(\"abort tile\",{uid:e.uid,source:this.id},null,e.workerID)},_addTile:function(e){this.fire(\"tile.add\",{tile:e})},_removeTile:function(e){this.fire(\"tile.remove\",{tile:e})},_unloadTile:function(e){e.unloadVectorData(this.map.painter),this.glyphAtlas.removeGlyphs(e.uid),this.dispatcher.send(\"remove tile\",{uid:e.uid,source:this.id},null,e.workerID)},redoPlacement:Source.redoPlacement,_redoTilePlacement:function(e){e.redoPlacement(this)}});\n},{\"../util/evented\":89,\"../util/mapbox\":92,\"../util/util\":95,\"./source\":33}],38:[function(require,module,exports){\n\"use strict\";function VideoSource(e){this.coordinates=e.coordinates,ajax.getVideo(e.urls,function(e,t){if(!e){this.video=t,this.video.loop=!0;var i;this.video.addEventListener(\"playing\",function(){i=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener(\"pause\",function(){this.map.style.animationLoop.cancel(i)}.bind(this)),this._loaded=!0,this.map&&(this.video.play(),this.createTile(),this.fire(\"change\"))}}.bind(this))}var util=require(\"../util/util\"),Tile=require(\"./tile\"),LngLat=require(\"../geo/lng_lat\"),Point=require(\"point-geometry\"),Evented=require(\"../util/evented\"),ajax=require(\"../util/ajax\");module.exports=VideoSource,VideoSource.prototype=util.inherit(Evented,{roundZoom:!0,getVideo:function(){return this.video},onAdd:function(e){this.map=e,this.video&&(this.video.play(),this.createTile())},createTile:function(){var e=this.map,t=this.coordinates.map(function(t){var i=LngLat.convert(t);return e.transform.locationCoordinate(i).zoomTo(0)}),i=util.getCoordinatesCenter(t),r=4096,o=t.map(function(e){var t=e.zoomTo(i.zoom);return new Point(Math.round((t.column-i.column)*r),Math.round((t.row-i.row)*r))}),n=e.painter.gl,a=32767,u=new Int16Array([o[0].x,o[0].y,0,0,o[1].x,o[1].y,a,0,o[3].x,o[3].y,0,a,o[2].x,o[2].y,a,a]);this.tile=new Tile,this.tile.buckets={},this.tile.boundsBuffer=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,this.tile.boundsBuffer),n.bufferData(n.ARRAY_BUFFER,u,n.STATIC_DRAW),this.center=i},loaded:function(){return this.video&&this.video.readyState>=2},update:function(){},reload:function(){},render:function(e,t){if(this._loaded&&!(this.video.readyState<2)){var i=this.center;this.tile.calculateMatrices(i.zoom,i.column,i.row,this.map.transform,t);var r=t.gl;this.tile.texture?(r.bindTexture(r.TEXTURE_2D,this.tile.texture),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.tile.texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.tile.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,this.video)),t.drawLayers(e,this.tile.posMatrix,this.tile)}},featuresAt:function(e,t,i){return i(null,[])},featuresIn:function(e,t,i){return i(null,[])}});\n},{\"../geo/lng_lat\":10,\"../util/ajax\":83,\"../util/evented\":89,\"../util/util\":95,\"./tile\":34,\"point-geometry\":128}],39:[function(require,module,exports){\n\"use strict\";function Worker(e){this.self=e,this.actor=new Actor(e,this),this.loading={},this.loaded={},this.layers=[],this.geoJSONIndexes={}}var Actor=require(\"../util/actor\"),WorkerTile=require(\"./worker_tile\"),util=require(\"../util/util\"),ajax=require(\"../util/ajax\"),vt=require(\"vector-tile\"),Protobuf=require(\"pbf\"),geojsonvt=require(\"geojson-vt\"),GeoJSONWrapper=require(\"./geojson_wrapper\");module.exports=function(e){return new Worker(e)},util.extend(Worker.prototype,{\"set layers\":function(e){this.layers=e},\"load tile\":function(e,r){function t(e,t){return delete this.loading[i][o],e?r(e):(a.data=new vt.VectorTile(new Protobuf(new Uint8Array(t))),a.parse(a.data,this.layers,this.actor,r),this.loaded[i]=this.loaded[i]||{},void(this.loaded[i][o]=a))}var i=e.source,o=e.uid;this.loading[i]||(this.loading[i]={});var a=this.loading[i][o]=new WorkerTile(e);a.xhr=ajax.getArrayBuffer(e.url,t.bind(this))},\"reload tile\":function(e,r){var t=this.loaded[e.source],i=e.uid;if(t&&t[i]){var o=t[i];o.parse(o.data,this.layers,this.actor,r)}},\"abort tile\":function(e){var r=this.loading[e.source],t=e.uid;r&&r[t]&&(r[t].xhr.abort(),delete r[t])},\"remove tile\":function(e){var r=this.loaded[e.source],t=e.uid;r&&r[t]&&delete r[t]},\"redo placement\":function(e,r){var t=this.loaded[e.source],i=this.loading[e.source],o=e.uid;if(t&&t[o]){var a=t[o],n=a.redoPlacement(e.angle,e.pitch,e.collisionDebug);n.result&&r(null,n.result,n.transferables)}else i&&i[o]&&(i[o].angle=e.angle)},\"parse geojson\":function(e,r){var t=function(t,i){if(t)return r(t);if(\"object\"!=typeof i)return r(new Error(\"Input data is not a valid GeoJSON object.\"));try{this.geoJSONIndexes[e.source]=geojsonvt(i,e.geojsonVtOptions)}catch(t){return r(t)}r(null)}.bind(this);\"string\"==typeof e.data?ajax.getJSON(e.data,t):t(null,e.data)},\"load geojson tile\":function(e,r){var t=e.source,i=e.coord;if(!this.geoJSONIndexes[t])return r(null,null);var o=this.geoJSONIndexes[t].getTile(i.z,i.x,i.y);if(!o)return r(null,null);var a=new WorkerTile(e);a.parse(new GeoJSONWrapper(o.features),this.layers,this.actor,r),this.loaded[t]=this.loaded[t]||{},this.loaded[t][e.uid]=a},\"query features\":function(e,r){var t=this.loaded[e.source]&&this.loaded[e.source][e.uid];t?t.featureTree.query(e,r):r(null,[])}});\n},{\"../util/actor\":82,\"../util/ajax\":83,\"../util/util\":95,\"./geojson_wrapper\":30,\"./worker_tile\":40,\"geojson-vt\":100,\"pbf\":127,\"vector-tile\":135}],40:[function(require,module,exports){\n\"use strict\";function WorkerTile(e){this.coord=e.coord,this.uid=e.uid,this.zoom=e.zoom,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=e.overscaling,this.angle=e.angle,this.pitch=e.pitch,this.collisionDebug=e.collisionDebug}function getElementGroups(e){for(var t={},r=0;r<e.length;r++)t[e[r].id]=e[r].elementGroups;return t}function getTransferables(e){var t=[];for(var r in e)t.push(e[r].arrayBuffer),e[r].push=null;return t}var FeatureTree=require(\"../data/feature_tree\"),CollisionTile=require(\"../symbol/collision_tile\"),Bucket=require(\"../data/bucket\");module.exports=WorkerTile,WorkerTile.prototype.parse=function(e,t,r,o){function s(e,t){for(var r=0;r<e.length;r++){var o=e.feature(r);for(var s in t)t[s].filter(o)&&t[s].features.push(o)}}function i(e){if(e)return o(e);if(G++,2===G){for(var t=k.length-1;t>=0;t--)n(g,k[t]);l()}}function n(e,t){var r=Date.now();t.addFeatures(p,B,z);var o=Date.now()-r;if(t.interactive)for(var s=0;s<t.features.length;s++){var i=t.features[s];e.featureTree.insert(i.bbox(),t.layers,i)}t.features=null,h._total+=o,h[t.id]=(h[t.id]||0)+o}function l(){if(g.status=\"done\",g.redoPlacementAfterDone){var e=g.redoPlacement(g.angle,g.pitch).result;m.glyphVertex=e.buffers.glyphVertex,m.iconVertex=e.buffers.iconVertex,m.collisionBoxVertex=e.buffers.collisionBoxVertex,g.redoPlacementAfterDone=!1}o(null,{elementGroups:getElementGroups(y),buffers:m,extent:b,bucketStats:h},getTransferables(m))}this.status=\"parsing\",this.featureTree=new FeatureTree(this.coord,this.overscaling);var a,u,f,c,h={_total:0},g=this,m={},p=new CollisionTile(this.angle,this.pitch),d={},v={};for(a=0;a<t.length;a++)u=t[a],u.source!==this.source||u.ref||u.minzoom&&this.zoom<u.minzoom||u.maxzoom&&this.zoom>=u.maxzoom||\"none\"===u.layout.visibility||(c=Bucket.create({layer:u,buffers:m,zoom:this.zoom,overscaling:this.overscaling,collisionDebug:this.collisionDebug}),c.layers=[u.id],d[u.id]=c,e.layers&&(f=u[\"source-layer\"],v[f]=v[f]||{},v[f][u.id]=c));for(a=0;a<t.length;a++)u=t[a],u.source===this.source&&u.ref&&d[u.ref]&&d[u.ref].layers.push(u.id);var b=4096;if(e.layers)for(f in v)u=e.layers[f],u&&(u.extent&&(b=u.extent),s(u,v[f]));else s(e,d);var y=[],k=this.symbolBuckets=[],x=[];for(var T in d)c=d[T],0!==c.features.length&&(y.push(c),\"symbol\"===c.type?k.push(c):x.push(c));var z={},B={};if(k.length>0){for(a=k.length-1;a>=0;a--)k[a].updateIcons(z),k[a].updateFont(B);for(var D in B)B[D]=Object.keys(B[D]).map(Number);z=Object.keys(z);var G=0;r.send(\"get glyphs\",{uid:this.uid,stacks:B},function(e,t){B=t,i(e)}),z.length?r.send(\"get icons\",{icons:z},function(e,t){z=t,i(e)}):i()}for(a=x.length-1;a>=0;a--)n(this,x[a]);return 0===k.length?l():void 0},WorkerTile.prototype.redoPlacement=function(e,t,r){if(\"done\"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=e,{};for(var o={},s=new CollisionTile(e,t),i=this.symbolBuckets.length-1;i>=0;i--)this.symbolBuckets[i].placeFeatures(s,o,r);return{result:{elementGroups:getElementGroups(this.symbolBuckets),buffers:o},transferables:getTransferables(o)}};\n},{\"../data/bucket\":1,\"../data/feature_tree\":5,\"../symbol/collision_tile\":58}],41:[function(require,module,exports){\n\"use strict\";function AnimationLoop(){this.n=0,this.times=[]}module.exports=AnimationLoop,AnimationLoop.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},AnimationLoop.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},AnimationLoop.prototype.cancel=function(t){this.times=this.times.filter(function(i){return i.id!==t})};\n},{}],42:[function(require,module,exports){\n\"use strict\";function ImageSprite(t){this.base=t,this.retina=browser.devicePixelRatio>1;var i=this.retina?\"@2x\":\"\";ajax.getJSON(normalizeURL(t,i,\".json\"),function(t,i){return t?void this.fire(\"error\",{error:t}):(this.data=i,void(this.img&&this.fire(\"load\")))}.bind(this)),ajax.getImage(normalizeURL(t,i,\".png\"),function(t,i){if(t)return void this.fire(\"error\",{error:t});for(var e=i.getData(),r=i.data=new Uint8Array(e.length),a=0;a<e.length;a+=4){var o=e[a+3]/255;r[a+0]=e[a+0]*o,r[a+1]=e[a+1]*o,r[a+2]=e[a+2]*o,r[a+3]=e[a+3]}this.img=i,this.data&&this.fire(\"load\")}.bind(this))}function SpritePosition(){}var Evented=require(\"../util/evented\"),ajax=require(\"../util/ajax\"),browser=require(\"../util/browser\"),normalizeURL=require(\"../util/mapbox\").normalizeSpriteURL;module.exports=ImageSprite,ImageSprite.prototype=Object.create(Evented),ImageSprite.prototype.toJSON=function(){return this.base},ImageSprite.prototype.loaded=function(){return!(!this.data||!this.img)},ImageSprite.prototype.resize=function(){if(browser.devicePixelRatio>1!==this.retina){var t=new ImageSprite(this.base);t.on(\"load\",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},SpritePosition.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},ImageSprite.prototype.getSpritePosition=function(t){if(!this.loaded())return new SpritePosition;var i=this.data&&this.data[t];return i&&this.img?i:new SpritePosition};\n},{\"../util/ajax\":83,\"../util/browser\":84,\"../util/evented\":89,\"../util/mapbox\":92}],43:[function(require,module,exports){\n\"use strict\";var reference=require(\"./reference\");module.exports={},reference.layout.forEach(function(e){var r=function(e){for(var r in e)this[r]=e[r]},o=reference[e];for(var t in o)void 0!==o[t][\"default\"]&&(r.prototype[t]=o[t][\"default\"]);module.exports[e.replace(\"layout_\",\"\")]=r});\n},{\"./reference\":45}],44:[function(require,module,exports){\n\"use strict\";var reference=require(\"./reference\"),parseCSSColor=require(\"csscolorparser\").parseCSSColor;module.exports={},reference.paint.forEach(function(e){var r=function(){},o=reference[e];for(var p in o){var t=o[p],a=t[\"default\"];void 0!==a&&(\"color\"===t.type&&(a=parseCSSColor(a)),r.prototype[p]=a)}r.prototype.hidden=!1,module.exports[e.replace(\"paint_\",\"\")]=r});\n},{\"./reference\":45,\"csscolorparser\":96}],45:[function(require,module,exports){\n\"use strict\";module.exports=require(\"mapbox-gl-style-spec/reference/latest\");\n},{\"mapbox-gl-style-spec/reference/latest\":121}],46:[function(require,module,exports){\n\"use strict\";function Style(e,t){this.animationLoop=t||new AnimationLoop,this.dispatcher=new Dispatcher(Math.max(browser.hardwareConcurrency-1,1),this),this.glyphAtlas=new GlyphAtlas(1024,1024),this.spriteAtlas=new SpriteAtlas(512,512),this.spriteAtlas.resize(browser.devicePixelRatio),this.lineAtlas=new LineAtlas(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},util.bindAll([\"_forwardSourceEvent\",\"_forwardTileEvent\",\"_redoPlacement\"],this);var r=function(e,t){if(e)return void this.fire(\"error\",{error:e});var r=validate(t);if(r.length)for(var s=0;s<r.length;s++)this.fire(\"error\",{error:new Error(r[s].message)});else{this._loaded=!0,this.stylesheet=t;var i=t.sources;for(var o in i)this.addSource(o,i[o]);t.sprite&&(this.sprite=new ImageSprite(t.sprite),this.sprite.on(\"load\",this.fire.bind(this,\"change\"))),this.glyphSource=new GlyphSource(t.glyphs,this.glyphAtlas),this._resolve(),this.fire(\"load\")}}.bind(this);\"string\"==typeof e?ajax.getJSON(normalizeURL(e),r):browser.frame(r.bind(this,null,e)),this.on(\"source.load\",function(e){var t=e.source;if(t&&t.vectorLayerIds)for(var r in this._layers){var s=this._layers[r];s.source===t.id&&this._validateLayer(s)}})}var Evented=require(\"../util/evented\"),styleBatch=require(\"./style_batch\"),StyleLayer=require(\"./style_layer\"),ImageSprite=require(\"./image_sprite\"),GlyphSource=require(\"../symbol/glyph_source\"),GlyphAtlas=require(\"../symbol/glyph_atlas\"),SpriteAtlas=require(\"../symbol/sprite_atlas\"),LineAtlas=require(\"../render/line_atlas\"),util=require(\"../util/util\"),ajax=require(\"../util/ajax\"),normalizeURL=require(\"../util/mapbox\").normalizeStyleURL,browser=require(\"../util/browser\"),Dispatcher=require(\"../util/dispatcher\"),AnimationLoop=require(\"./animation_loop\"),validate=require(\"mapbox-gl-style-spec/lib/validate/latest\");module.exports=Style,Style.prototype=util.inherit(Evented,{_loaded:!1,_validateLayer:function(e){var t=this.sources[e.source];e[\"source-layer\"]&&t&&t.vectorLayerIds&&-1===t.vectorLayerIds.indexOf(e[\"source-layer\"])&&this.fire(\"error\",{error:new Error('Source layer \"'+e[\"source-layer\"]+'\" does not exist on source \"'+t.id+'\" as specified by style layer \"'+e.id+'\"')})},loaded:function(){if(!this._loaded)return!1;for(var e in this.sources)if(!this.sources[e].loaded())return!1;return this.sprite&&!this.sprite.loaded()?!1:!0},_resolve:function(){var e,t;this._layers={},this._order=[];for(var r=0;r<this.stylesheet.layers.length;r++)t=new StyleLayer(this.stylesheet.layers[r]),this._layers[t.id]=t,this._order.push(t.id);for(e in this._layers)this._layers[e].resolveLayout();for(e in this._layers)this._layers[e].resolveReference(this._layers),this._layers[e].resolvePaint();this._groupLayers(),this._broadcastLayers()},_groupLayers:function(){var e;this._groups=[];for(var t=0;t<this._order.length;++t){var r=this._layers[this._order[t]];e&&r.source===e.source||(e=[],e.source=r.source,this._groups.push(e)),e.push(r)}},_broadcastLayers:function(){this.dispatcher.broadcast(\"set layers\",this._order.map(function(e){return this._layers[e].json()},this))},_cascade:function(e,t){if(this._loaded){t=t||{transition:!0};for(var r in this._layers)this._layers[r].cascade(e,t,this.stylesheet.transition||{},this.animationLoop);this.fire(\"change\")}},_recalculate:function(e){for(var t in this.sources)this.sources[t].used=!1;this._updateZoomHistory(e),this.rasterFadeDuration=300;for(t in this._layers){var r=this._layers[t];r.recalculate(e,this.zoomHistory)&&r.source&&(this.sources[r.source].used=!0)}var s=300;Math.floor(this.z)!==Math.floor(e)&&this.animationLoop.set(s),this.z=e,this.fire(\"zoom\")},_updateZoomHistory:function(e){var t=this.zoomHistory;void 0===t.lastIntegerZoom&&(t.lastIntegerZoom=Math.floor(e),t.lastIntegerZoomTime=0,t.lastZoom=e),Math.floor(t.lastZoom)<Math.floor(e)?(t.lastIntegerZoom=Math.floor(e),t.lastIntegerZoomTime=Date.now()):Math.floor(t.lastZoom)>Math.floor(e)&&(t.lastIntegerZoom=Math.floor(e+1),t.lastIntegerZoomTime=Date.now()),t.lastZoom=e},batch:function(e){styleBatch(this,e)},addSource:function(e,t){return this.batch(function(r){r.addSource(e,t)}),this},removeSource:function(e){return this.batch(function(t){t.removeSource(e)}),this},getSource:function(e){return this.sources[e]},addLayer:function(e,t){return this.batch(function(r){r.addLayer(e,t)}),this},removeLayer:function(e){return this.batch(function(t){t.removeLayer(e)}),this},getLayer:function(e){return this._layers[e]},getReferentLayer:function(e){var t=this.getLayer(e);return t.ref&&(t=this.getLayer(t.ref)),t},setFilter:function(e,t){return this.batch(function(r){r.setFilter(e,t)}),this},setLayerZoomRange:function(e,t,r){return this.batch(function(s){s.setLayerZoomRange(e,t,r)}),this},getFilter:function(e){return this.getReferentLayer(e).filter},getLayoutProperty:function(e,t){return this.getReferentLayer(e).getLayoutProperty(t)},getPaintProperty:function(e,t,r){return this.getLayer(e).getPaintProperty(t,r)},featuresAt:function(e,t,r){this._queryFeatures(\"featuresAt\",e,t,r)},featuresIn:function(e,t,r){this._queryFeatures(\"featuresIn\",e,t,r)},_queryFeatures:function(e,t,r,s){var i=[],o=null;r.layer&&(r.layerIds=Array.isArray(r.layer)?r.layer:[r.layer]),util.asyncAll(Object.keys(this.sources),function(s,a){var n=this.sources[s];n[e](t,r,function(e,t){t&&(i=i.concat(t)),e&&(o=e),a()})}.bind(this),function(){return o?s(o):void s(null,i.filter(function(e){return void 0!==this._layers[e.layer]}.bind(this)).map(function(e){return e.layer=this._layers[e.layer].json(),e}.bind(this)))}.bind(this))},_remove:function(){this.dispatcher.remove()},_reloadSource:function(e){this.sources[e].reload()},_updateSources:function(e){for(var t in this.sources)this.sources[t].update(e)},_redoPlacement:function(){for(var e in this.sources)this.sources[e].redoPlacement&&this.sources[e].redoPlacement()},_forwardSourceEvent:function(e){this.fire(\"source.\"+e.type,util.extend({source:e.target},e))},_forwardTileEvent:function(e){this.fire(e.type,util.extend({source:e.target},e))},\"get sprite json\":function(e,t){var r=this.sprite;r.loaded()?t(null,{sprite:r.data,retina:r.retina}):r.on(\"load\",function(){t(null,{sprite:r.data,retina:r.retina})})},\"get icons\":function(e,t){var r=this.sprite,s=this.spriteAtlas;r.loaded()?(s.setSprite(r),s.addIcons(e.icons,t)):r.on(\"load\",function(){s.setSprite(r),s.addIcons(e.icons,t)})},\"get glyphs\":function(e,t){function r(e,r,s){e&&console.error(e),o[s]=r,i--,0===i&&t(null,o)}var s=e.stacks,i=Object.keys(s).length,o={};for(var a in s)this.glyphSource.getSimpleGlyphs(a,s[a],e.uid,r)}});\n},{\"../render/line_atlas\":26,\"../symbol/glyph_atlas\":60,\"../symbol/glyph_source\":61,\"../symbol/sprite_atlas\":66,\"../util/ajax\":83,\"../util/browser\":84,\"../util/dispatcher\":86,\"../util/evented\":89,\"../util/mapbox\":92,\"../util/util\":95,\"./animation_loop\":41,\"./image_sprite\":42,\"./style_batch\":47,\"./style_layer\":50,\"mapbox-gl-style-spec/lib/validate/latest\":118}],47:[function(require,module,exports){\n\"use strict\";function styleBatch(e,t){if(!e._loaded)throw new Error(\"Style is not done loading\");var r=Object.create(styleBatch.prototype);r._style=e,r._groupLayers=!1,r._broadcastLayers=!1,r._reloadSources={},r._events=[],r._change=!1,t(r),r._groupLayers&&r._style._groupLayers(),r._broadcastLayers&&r._style._broadcastLayers(),Object.keys(r._reloadSources).forEach(function(e){r._style._reloadSource(e)}),r._events.forEach(function(e){r._style.fire.apply(r._style,e)}),r._change&&r._style.fire(\"change\")}var Source=require(\"../source/source\"),StyleLayer=require(\"./style_layer\");styleBatch.prototype={addLayer:function(e,t){if(void 0!==this._style._layers[e.id])throw new Error(\"There is already a layer with this ID\");return e instanceof StyleLayer||(e=new StyleLayer(e)),this._style._validateLayer(e),this._style._layers[e.id]=e,this._style._order.splice(t?this._style._order.indexOf(t):1/0,0,e.id),e.resolveLayout(),e.resolveReference(this._style._layers),e.resolvePaint(),this._groupLayers=!0,this._broadcastLayers=!0,e.source&&(this._reloadSources[e.source]=!0),this._events.push([\"layer.add\",{layer:e}]),this._change=!0,this},removeLayer:function(e){var t=this._style._layers[e];if(void 0===t)throw new Error(\"There is no layer with this ID\");for(var r in this._style._layers)this._style._layers[r].ref===e&&this.removeLayer(r);return delete this._style._layers[e],this._style._order.splice(this._style._order.indexOf(e),1),this._groupLayers=!0,this._broadcastLayers=!0,this._events.push([\"layer.remove\",{layer:t}]),this._change=!0,this},setPaintProperty:function(e,t,r,s){return this._style.getLayer(e).setPaintProperty(t,r,s),this._change=!0,this},setLayoutProperty:function(e,t,r){return e=this._style.getReferentLayer(e),e.setLayoutProperty(t,r),this._broadcastLayers=!0,e.source&&(this._reloadSources[e.source]=!0),this._change=!0,this},setFilter:function(e,t){return e=this._style.getReferentLayer(e),e.filter=t,this._broadcastLayers=!0,e.source&&(this._reloadSources[e.source]=!0),this._change=!0,this},setLayerZoomRange:function(e,t,r){var s=this._style.getReferentLayer(e);return null!=t&&(s.minzoom=t),null!=r&&(s.maxzoom=r),this._broadcastLayers=!0,s.source&&(this._reloadSources[s.source]=!0),this._change=!0,this},addSource:function(e,t){if(!this._style._loaded)throw new Error(\"Style is not done loading\");if(void 0!==this._style.sources[e])throw new Error(\"There is already a source with this ID\");return t=Source.create(t),this._style.sources[e]=t,t.id=e,t.style=this._style,t.dispatcher=this._style.dispatcher,t.glyphAtlas=this._style.glyphAtlas,t.on(\"load\",this._style._forwardSourceEvent).on(\"error\",this._style._forwardSourceEvent).on(\"change\",this._style._forwardSourceEvent).on(\"tile.add\",this._style._forwardTileEvent).on(\"tile.load\",this._style._forwardTileEvent).on(\"tile.error\",this._style._forwardTileEvent).on(\"tile.remove\",this._style._forwardTileEvent).on(\"tile.stats\",this._style._forwardTileEvent),this._events.push([\"source.add\",{source:t}]),this._change=!0,this},removeSource:function(e){if(void 0===this._style.sources[e])throw new Error(\"There is no source with this ID\");var t=this._style.sources[e];return delete this._style.sources[e],t.off(\"load\",this._style._forwardSourceEvent).off(\"error\",this._style._forwardSourceEvent).off(\"change\",this._style._forwardSourceEvent).off(\"tile.add\",this._style._forwardTileEvent).off(\"tile.load\",this._style._forwardTileEvent).off(\"tile.error\",this._style._forwardTileEvent).off(\"tile.remove\",this._style._forwardTileEvent).off(\"tile.stats\",this._style._forwardTileEvent),this._events.push([\"source.remove\",{source:t}]),this._change=!0,this}},module.exports=styleBatch;\n},{\"../source/source\":33,\"./style_layer\":50}],48:[function(require,module,exports){\n\"use strict\";function StyleDeclaration(t,r){this.type=t.type,this.transitionable=t.transition,null==r&&(r=t[\"default\"]),this.json=JSON.stringify(r),\"color\"===this.type?this.value=parseColor(r):this.value=r,\"interpolated\"===t[\"function\"]?this.calculate=MapboxGLFunction.interpolated(this.value):(this.calculate=MapboxGLFunction[\"piecewise-constant\"](this.value),t.transition&&(this.calculate=transitioned(this.calculate)))}function transitioned(t){return function(r,o,e){var n,i,a,l=r%1,s=Math.min((Date.now()-o.lastIntegerZoomTime)/e,1),c=1,u=1;return r>o.lastIntegerZoom?(n=l+(1-l)*s,c*=2,i=t(r-1),a=t(r)):(n=1-(1-s)*l,a=t(r),i=t(r+1),c/=2),{from:i,fromScale:c,to:a,toScale:u,t:n}}}function parseColor(t){if(colorCache[t])return colorCache[t];if(Array.isArray(t))return t;if(t&&t.stops)return util.extend({},t,{stops:t.stops.map(function(t){return[t[0],parseColor(t[1])]})});if(\"string\"==typeof t){var r=colorDowngrade(parseCSSColor(t));return colorCache[t]=r,r}throw new Error(\"Invalid color \"+t)}function colorDowngrade(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]/1]}var parseCSSColor=require(\"csscolorparser\").parseCSSColor,MapboxGLFunction=require(\"mapbox-gl-function\"),util=require(\"../util/util\");module.exports=StyleDeclaration;var colorCache={};\n},{\"../util/util\":95,\"csscolorparser\":96,\"mapbox-gl-function\":117}],49:[function(require,module,exports){\n\"use strict\";function makeConstructor(t){function e(t){this._values={},this._transitions={};for(var e in t)this[e]=t[e]}return Object.keys(t).forEach(function(n){var r=t[n];Object.defineProperty(e.prototype,n,{set:function(t){this._values[n]=new StyleDeclaration(r,t)},get:function(){return this._values[n].value}}),r.transition&&Object.defineProperty(e.prototype,n+\"-transition\",{set:function(t){this._transitions[n]=t},get:function(){return this._transitions[n]}})}),e.prototype.values=function(){return this._values},e.prototype.transition=function(t,e){var n=this._transitions[t]||{};return{duration:util.coalesce(n.duration,e.duration,300),delay:util.coalesce(n.delay,e.delay,0)}},e.prototype.json=function(){var t={};for(var e in this._values)t[e]=this._values[e].value;for(var n in this._transitions)t[n+\"-transition\"]=this._transitions[e];return t},e}var util=require(\"../util/util\"),reference=require(\"./reference\"),StyleDeclaration=require(\"./style_declaration\"),lookup={paint:{},layout:{}};reference.layer.type.values.forEach(function(t){lookup.paint[t]=makeConstructor(reference[\"paint_\"+t]),lookup.layout[t]=makeConstructor(reference[\"layout_\"+t])}),module.exports=function(t,e,n){return new lookup[t][e](n)};\n},{\"../util/util\":95,\"./reference\":45,\"./style_declaration\":48}],50:[function(require,module,exports){\n\"use strict\";function StyleLayer(t){this._layer=t,this.id=t.id,this.ref=t.ref,this._resolved={},this._cascaded={},this.assign(t)}function premultiplyLayer(t,i){var e=i+\"-color\",a=i+\"-halo-color\",o=i+\"-outline-color\",r=t[e],s=t[a],n=t[o],l=t[i+\"-opacity\"],y=r&&l*r[3],u=s&&l*s[3],h=n&&l*n[3];void 0!==y&&1>y&&(t[e]=util.premultiply([r[0],r[1],r[2],y])),void 0!==u&&1>u&&(t[a]=util.premultiply([s[0],s[1],s[2],u])),void 0!==h&&1>h&&(t[o]=util.premultiply([n[0],n[1],n[2],h]))}var util=require(\"../util/util\"),StyleTransition=require(\"./style_transition\"),StyleDeclarationSet=require(\"./style_declaration_set\"),LayoutProperties=require(\"./layout_properties\"),PaintProperties=require(\"./paint_properties\");module.exports=StyleLayer,StyleLayer.prototype={resolveLayout:function(){this.ref||(this.layout=new LayoutProperties[this.type](this._layer.layout),\"line\"===this.layout[\"symbol-placement\"]&&(this.layout.hasOwnProperty(\"text-rotation-alignment\")||(this.layout[\"text-rotation-alignment\"]=\"map\"),this.layout.hasOwnProperty(\"icon-rotation-alignment\")||(this.layout[\"icon-rotation-alignment\"]=\"map\"),this.layout[\"symbol-avoid-edges\"]=!0))},setLayoutProperty:function(t,i){null==i?delete this.layout[t]:this.layout[t]=i},getLayoutProperty:function(t){return this.layout[t]},resolveReference:function(t){this.ref&&this.assign(t[this.ref])},resolvePaint:function(){for(var t in this._layer){var i=t.match(/^paint(?:\\.(.*))?$/);i&&(this._resolved[i[1]||\"\"]=new StyleDeclarationSet(\"paint\",this.type,this._layer[t]))}},setPaintProperty:function(t,i,e){var a=this._resolved[e||\"\"];a||(a=this._resolved[e||\"\"]=new StyleDeclarationSet(\"paint\",this.type,{})),a[t]=i},getPaintProperty:function(t,i){var e=this._resolved[i||\"\"];if(e)return e[t]},cascade:function(t,i,e,a){for(var o in this._resolved)if(\"\"===o||t[o]){var r=this._resolved[o],s=r.values();for(var n in s){var l=s[n],y=i.transition?this._cascaded[n]:void 0;if(!y||y.declaration.json!==l.json){var u=r.transition(n,e),h=this._cascaded[n]=new StyleTransition(l,y,u);h.instant()||(h.loopID=a.set(h.endTime-(new Date).getTime())),y&&a.cancel(y.loopID)}}}if(\"symbol\"===this.type){var c=new StyleDeclarationSet(\"layout\",this.type,this.layout);this._cascaded[\"text-size\"]=new StyleTransition(c.values()[\"text-size\"],void 0,e),this._cascaded[\"icon-size\"]=new StyleTransition(c.values()[\"icon-size\"],void 0,e)}},recalculate:function(t,i){var e=this.type,a=this.paint=new PaintProperties[e];for(var o in this._cascaded)a[o]=this._cascaded[o].at(t,i);if(this.hidden=this.minzoom&&t<this.minzoom||this.maxzoom&&t>=this.maxzoom||\"none\"===this.layout.visibility,\"symbol\"===e?0!==a[\"text-opacity\"]&&this.layout[\"text-field\"]||0!==a[\"icon-opacity\"]&&this.layout[\"icon-image\"]?(premultiplyLayer(a,\"text\"),premultiplyLayer(a,\"icon\")):this.hidden=!0:0===a[e+\"-opacity\"]?this.hidden=!0:premultiplyLayer(a,e),this._cascaded[\"line-dasharray\"]){var r=a[\"line-dasharray\"],s=this._cascaded[\"line-width\"]?this._cascaded[\"line-width\"].at(Math.floor(t),1/0):a[\"line-width\"];r.fromScale*=s,r.toScale*=s}return!this.hidden},assign:function(t){util.extend(this,util.pick(t,[\"type\",\"source\",\"source-layer\",\"minzoom\",\"maxzoom\",\"filter\",\"layout\"]))},json:function(){return util.extend({},this._layer,util.pick(this,[\"type\",\"source\",\"source-layer\",\"minzoom\",\"maxzoom\",\"filter\",\"layout\",\"paint\"]))}};\n},{\"../util/util\":95,\"./layout_properties\":43,\"./paint_properties\":44,\"./style_declaration_set\":49,\"./style_transition\":51}],51:[function(require,module,exports){\n\"use strict\";function StyleTransition(t,i,e){this.declaration=t,this.startTime=this.endTime=(new Date).getTime();var n=t.type;\"string\"!==n&&\"array\"!==n||!t.transitionable?this.interp=interpolate[n]:this.interp=interpZoomTransitioned,this.oldTransition=i,this.duration=e.duration||0,this.delay=e.delay||0,this.instant()||(this.endTime=this.startTime+this.duration+this.delay,this.ease=util.easeCubicInOut),i&&i.endTime<=this.startTime&&delete i.oldTransition}function interpZoomTransitioned(t,i,e){return{from:t.to,fromScale:t.toScale,to:i.to,toScale:i.toScale,t:e}}var util=require(\"../util/util\"),interpolate=require(\"../util/interpolate\");module.exports=StyleTransition,StyleTransition.prototype.instant=function(){return!this.oldTransition||!this.interp||0===this.duration&&0===this.delay},StyleTransition.prototype.at=function(t,i,e){var n=this.declaration.calculate(t,i,this.duration);if(this.instant())return n;if(e=e||Date.now(),e<this.endTime){var r=this.oldTransition.at(t,i,this.startTime),a=this.ease((e-this.startTime-this.delay)/this.duration);n=this.interp(r,n,a)}return n};\n},{\"../util/interpolate\":91,\"../util/util\":95}],52:[function(require,module,exports){\n\"use strict\";function Anchor(t,e,o,n){this.x=t,this.y=e,this.angle=o,void 0!==n&&(this.segment=n)}var Point=require(\"point-geometry\");module.exports=Anchor,Anchor.prototype=Object.create(Point.prototype),Anchor.prototype.clone=function(){return new Anchor(this.x,this.y,this.angle,this.segment)};\n},{\"point-geometry\":128}],53:[function(require,module,exports){\n\"use strict\";function BinPack(e,h){this.width=e,this.height=h,this.free=[{x:0,y:0,w:e,h:h}]}module.exports=BinPack,BinPack.prototype.release=function(e){for(var h=0;h<this.free.length;h++){var i=this.free[h];if(i.y===e.y&&i.h===e.h&&i.x+i.w===e.x)i.w+=e.w;else if(i.x===e.x&&i.w===e.w&&i.y+i.h===e.y)i.h+=e.h;else if(e.y===i.y&&e.h===i.h&&e.x+e.w===i.x)i.x=e.x,i.w+=e.w;else{if(e.x!==i.x||e.w!==i.w||e.y+e.h!==i.y)continue;i.y=e.y,i.h+=e.h}return this.free.splice(h,1),void this.release(i)}this.free.push(e)},BinPack.prototype.allocate=function(e,h){for(var i={x:1/0,y:1/0,w:1/0,h:1/0},t=-1,s=0;s<this.free.length;s++){var r=this.free[s];e<=r.w&&h<=r.h&&r.y<=i.y&&r.x<=i.x&&(i=r,t=s)}return 0>t?{x:-1,y:-1}:(this.free.splice(t,1),i.w<i.h?(i.w>e&&this.free.push({x:i.x+e,y:i.y,w:i.w-e,h:h}),i.h>h&&this.free.push({x:i.x,y:i.y+h,w:i.w,h:i.h-h})):(i.w>e&&this.free.push({x:i.x+e,y:i.y,w:i.w-e,h:i.h}),i.h>h&&this.free.push({x:i.x,y:i.y+h,w:e,h:i.h-h})),{x:i.x,y:i.y,w:e,h:h})};\n},{}],54:[function(require,module,exports){\n\"use strict\";function checkMaxAngle(e,t,a,r,n){if(void 0===t.segment)return!0;for(var i=t,s=t.segment+1,f=0;f>-a/2;){if(s--,0>s)return!1;f-=e[s].dist(i),i=e[s]}f+=e[s].dist(e[s+1]),s++;for(var l=[],o=0;a/2>f;){var u=e[s-1],c=e[s],g=e[s+1];if(!g)return!1;var h=u.angleTo(c)-c.angleTo(g);for(h=(h+3*Math.PI)%(2*Math.PI)-Math.PI,l.push({distance:f,angleDelta:h}),o+=h;f-l[0].distance>r;)o-=l.shift().angleDelta;if(Math.abs(o)>n)return!1;s++,f+=c.dist(g)}return!0}module.exports=checkMaxAngle;\n},{}],55:[function(require,module,exports){\n\"use strict\";function clipLine(x,y,n,e,t){for(var i=[],o=0;o<x.length;o++)for(var r,P=x[o],u=0;u<P.length-1;u++){var w=P[u],l=P[u+1];w.x<y&&l.x<y||(w.x<y?w=new Point(y,w.y+(l.y-w.y)*((y-w.x)/(l.x-w.x))):l.x<y&&(l=new Point(y,w.y+(l.y-w.y)*((y-w.x)/(l.x-w.x)))),w.y<n&&l.y<n||(w.y<n?w=new Point(w.x+(l.x-w.x)*((n-w.y)/(l.y-w.y)),n):l.y<n&&(l=new Point(w.x+(l.x-w.x)*((n-w.y)/(l.y-w.y)),n)),w.x>=e&&l.x>=e||(w.x>=e?w=new Point(e,w.y+(l.y-w.y)*((e-w.x)/(l.x-w.x))):l.x>=e&&(l=new Point(e,w.y+(l.y-w.y)*((e-w.x)/(l.x-w.x)))),w.y>=t&&l.y>=t||(w.y>=t?w=new Point(w.x+(l.x-w.x)*((t-w.y)/(l.y-w.y)),t):l.y>=t&&(l=new Point(w.x+(l.x-w.x)*((t-w.y)/(l.y-w.y)),t)),r&&w.equals(r[r.length-1])||(r=[w],i.push(r)),r.push(l)))))}return i}var Point=require(\"point-geometry\");module.exports=clipLine;\n},{\"point-geometry\":128}],56:[function(require,module,exports){\n\"use strict\";function CollisionBox(i,t,s,h,o,l){this.anchorPoint=i,this.x1=t,this.y1=s,this.x2=h,this.y2=o,this.maxScale=l,this.placementScale=0,this[0]=this[1]=this[2]=this[3]=0}module.exports=CollisionBox;\n},{}],57:[function(require,module,exports){\n\"use strict\";function CollisionFeature(o,i,t,e,r,s){var n=t.top*e-r,l=t.bottom*e+r,a=t.left*e-r,u=t.right*e+r;if(this.boxes=[],s){var h=l-n,x=u-a;if(0>=h)return;h=Math.max(10*e,h),this._addLineCollisionBoxes(o,i,x,h)}else this.boxes.push(new CollisionBox(new Point(i.x,i.y),a,n,u,l,1/0))}var CollisionBox=require(\"./collision_box\"),Point=require(\"point-geometry\");module.exports=CollisionFeature,CollisionFeature.prototype._addLineCollisionBoxes=function(o,i,t,e){var r=e/2,s=Math.floor(t/r),n=-e/2,l=this.boxes,a=i,u=i.segment+1,h=n;do{if(u--,0>u)return l;h-=o[u].dist(a),a=o[u]}while(h>-t/2);for(var x=o[u].dist(o[u+1]),d=0;s>d;d++){for(var f=-t/2+d*r;f>h+x;){if(h+=x,u++,u+1>=o.length)return l;x=o[u].dist(o[u+1])}var C=f-h,b=o[u],m=o[u+1],p=m.sub(b)._unit()._mult(C)._add(b),v=Math.max(Math.abs(f-n)-r/2,0),_=t/2/v;l.push(new CollisionBox(p,-e/2,-e/2,e/2,e/2,_))}return l};\n},{\"./collision_box\":56,\"point-geometry\":128}],58:[function(require,module,exports){\n\"use strict\";function CollisionTile(t,a){this.tree=rbush(),this.angle=t;var e=Math.sin(t),i=Math.cos(t);this.rotationMatrix=[i,-e,e,i],this.yStretch=1/Math.cos(a/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3)}var rbush=require(\"rbush\");module.exports=CollisionTile,CollisionTile.prototype.minScale=.25,CollisionTile.prototype.maxScale=2,CollisionTile.prototype.placeCollisionFeature=function(t){for(var a=this.minScale,e=this.rotationMatrix,i=this.yStretch,o=0;o<t.boxes.length;o++){var l=t.boxes[o],r=l.anchorPoint.matMult(e),s=r.x,h=r.y;l[0]=s+l.x1,l[1]=h+l.y1*i,l[2]=s+l.x2,l[3]=h+l.y2*i;for(var n=this.tree.search(l),c=0;c<n.length;c++){var x=n[c],m=x.anchorPoint.matMult(e),y=(x.x1-l.x2)/(s-m.x),u=(x.x2-l.x1)/(s-m.x),S=(x.y1-l.y2)*i/(h-m.y),p=(x.y2-l.y1)*i/(h-m.y);(isNaN(y)||isNaN(u))&&(y=u=1),(isNaN(S)||isNaN(p))&&(S=p=1);var M=Math.min(Math.max(y,u),Math.max(S,p));if(M>x.maxScale&&(M=x.maxScale),M>l.maxScale&&(M=l.maxScale),M>a&&M>=x.placementScale&&(a=M),a>=this.maxScale)return a}}return a},CollisionTile.prototype.insertCollisionFeature=function(t,a){for(var e=t.boxes,i=0;i<e.length;i++)e[i].placementScale=a;a<this.maxScale&&this.tree.load(e)};\n},{\"rbush\":130}],59:[function(require,module,exports){\n\"use strict\";function getAnchors(e,r,t,a,n,o,l,h){var i=a?.6*o*l:0,c=Math.max(a?a.right-a.left:0,n?n.right-n.left:0);if(0===e[0].x||4096===e[0].x||0===e[0].y||4096===e[0].y)var u=!0;r/4>r-c*l&&(r=c*l+r/4);var s=2*o,g=u?r/2*h%r:(c/2+s)*l*h%r;return resample(e,g,r,i,t,c*l,u,!1)}function resample(e,r,t,a,n,o,l,h){for(var i=0,c=r-t,u=[],s=0;s<e.length-1;s++){for(var g=e[s],p=e[s+1],x=g.dist(p),f=p.angleTo(g);i+x>c+t;){c+=t;var v=(c-i)/x,m=interpolate(g.x,p.x,v),A=interpolate(g.y,p.y,v);if(m>=0&&4096>m&&A>=0&&4096>A){m=Math.round(m),A=Math.round(A);var y=new Anchor(m,A,f,s);(!a||checkMaxAngle(e,y,o,a,n))&&u.push(y)}}i+=x}return h||u.length||l||(u=resample(e,i/2,t,a,n,o,l,!0)),u}var interpolate=require(\"../util/interpolate\"),Anchor=require(\"../symbol/anchor\"),checkMaxAngle=require(\"./check_max_angle\");module.exports=getAnchors;\n},{\"../symbol/anchor\":52,\"../util/interpolate\":91,\"./check_max_angle\":54}],60:[function(require,module,exports){\n\"use strict\";function GlyphAtlas(t,i){this.width=t,this.height=i,this.bin=new BinPack(t,i),this.index={},this.ids={},this.data=new Uint8Array(t*i)}var BinPack=require(\"./bin_pack\");module.exports=GlyphAtlas,GlyphAtlas.prototype={get debug(){return\"canvas\"in this},set debug(t){t&&!this.canvas?(this.canvas=document.createElement(\"canvas\"),this.canvas.width=this.width,this.canvas.height=this.height,document.body.appendChild(this.canvas),this.ctx=this.canvas.getContext(\"2d\")):!t&&this.canvas&&(this.canvas.parentNode.removeChild(this.canvas),delete this.ctx,delete this.canvas)}},GlyphAtlas.prototype.getGlyphs=function(){var t,i,e,s={};for(var h in this.ids)t=h.split(\"#\"),i=t[0],e=t[1],s[i]||(s[i]=[]),s[i].push(e);return s},GlyphAtlas.prototype.getRects=function(){var t,i,e,s={};for(var h in this.ids)t=h.split(\"#\"),i=t[0],e=t[1],s[i]||(s[i]={}),s[i][e]=this.index[h];return s},GlyphAtlas.prototype.removeGlyphs=function(t){for(var i in this.ids){var e=this.ids[i],s=e.indexOf(t);if(s>=0&&e.splice(s,1),this.ids[i]=e,!e.length){for(var h=this.index[i],a=this.data,r=0;r<h.h;r++)for(var n=this.width*(h.y+r)+h.x,d=0;d<h.w;d++)a[n+d]=0;this.dirty=!0,this.bin.release(h),delete this.index[i],delete this.ids[i]}}this.updateTexture(this.gl)},GlyphAtlas.prototype.addGlyph=function(t,i,e,s){if(!e)return null;var h=i+\"#\"+e.id;if(this.index[h])return this.ids[h].indexOf(t)<0&&this.ids[h].push(t),this.index[h];if(!e.bitmap)return null;var a=e.width+2*s,r=e.height+2*s,n=1,d=a+2*n,l=r+2*n;d+=4-d%4,l+=4-l%4;var o=this.bin.allocate(d,l);if(o.x<0)return console.warn(\"glyph bitmap overflow\"),{glyph:e,rect:null};this.index[h]=o,this.ids[h]=[t];for(var c=this.data,p=e.bitmap,u=0;r>u;u++)for(var x=this.width*(o.y+u+n)+o.x+n,E=a*u,T=0;a>T;T++)c[x+T]=p[E+T];return this.dirty=!0,o},GlyphAtlas.prototype.bind=function(t){this.gl=t,this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,null))},GlyphAtlas.prototype.updateTexture=function(t){if(this.bind(t),this.dirty){if(t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data),this.ctx){for(var i=this.ctx.getImageData(0,0,this.width,this.height),e=0,s=0;e<this.data.length;e++,s+=4)i.data[s]=this.data[e],i.data[s+1]=this.data[e],i.data[s+2]=this.data[e],i.data[s+3]=255;this.ctx.putImageData(i,0,0),this.ctx.strokeStyle=\"red\";for(var h=0;h<this.bin.free.length;h++){var a=this.bin.free[h];this.ctx.strokeRect(a.x,a.y,a.w,a.h)}}this.dirty=!1}};\n},{\"./bin_pack\":53}],61:[function(require,module,exports){\n\"use strict\";function GlyphSource(t,e){this.url=t&&normalizeURL(t),this.glyphAtlas=e,this.stacks=[],this.loading={}}function SimpleGlyph(t,e,r){var l=1;this.advance=t.advance,this.left=t.left-r-l,this.top=t.top+r+l,this.rect=e}function glyphUrl(t,e,r,l){return l=l||\"abc\",r.replace(\"{s}\",l[t.length%l.length]).replace(\"{fontstack}\",t).replace(\"{range}\",e)}var normalizeURL=require(\"../util/mapbox\").normalizeGlyphsURL,getArrayBuffer=require(\"../util/ajax\").getArrayBuffer,Glyphs=require(\"../util/glyphs\"),Protobuf=require(\"pbf\");module.exports=GlyphSource,GlyphSource.prototype.getSimpleGlyphs=function(t,e,r,l){void 0===this.stacks[t]&&(this.stacks[t]={});for(var i,a={},s=this.stacks[t],h=this.glyphAtlas,o=3,n={},p=0,u=0;u<e.length;u++){var f=e[u];if(i=Math.floor(f/256),s[i]){var y=s[i].glyphs[f],c=h.addGlyph(r,t,y,o);y&&(a[f]=new SimpleGlyph(y,c,o))}else void 0===n[i]&&(n[i]=[],p++),n[i].push(f)}p||l(void 0,a,t);var g=function(e,i,s){if(!e)for(var u=this.stacks[t][i]=s.stacks[0],f=0;f<n[i].length;f++){var y=n[i][f],c=u.glyphs[y],g=h.addGlyph(r,t,c,o);c&&(a[y]=new SimpleGlyph(c,g,o))}p--,p||l(void 0,a,t)}.bind(this);for(var d in n)this.loadRange(t,d,g)},GlyphSource.prototype.loadRange=function(t,e,r){if(256*e>65535)return r(\"glyphs > 65535 not supported\");void 0===this.loading[t]&&(this.loading[t]={});var l=this.loading[t];if(l[e])l[e].push(r);else{l[e]=[r];var i=256*e+\"-\"+(256*e+255),a=glyphUrl(t,i,this.url);getArrayBuffer(a,function(t,r){for(var i=!t&&new Glyphs(new Protobuf(new Uint8Array(r))),a=0;a<l[e].length;a++)l[e][a](t,e,i);delete l[e]})}};\n},{\"../util/ajax\":83,\"../util/glyphs\":90,\"../util/mapbox\":92,\"pbf\":127}],62:[function(require,module,exports){\n\"use strict\";module.exports=function(e,t,n){function r(r){c.push(e[r]),f.push(n[r]),v.push(t[r]),h++}function u(e,t,n){var r=l[e];return delete l[e],l[t]=r,f[r][0].pop(),f[r][0]=f[r][0].concat(n[0]),r}function i(e,t,n){var r=a[t];return delete a[t],a[e]=r,f[r][0].shift(),f[r][0]=n[0].concat(f[r][0]),r}function o(e,t,n){var r=n?t[0][t[0].length-1]:t[0][0];return e+\":\"+r.x+\":\"+r.y}var s,a={},l={},c=[],f=[],v=[],h=0;for(s=0;s<e.length;s++){var p=n[s],d=t[s];if(d){var g=o(d,p),x=o(d,p,!0);if(g in l&&x in a&&l[g]!==a[x]){var m=i(g,x,p),y=u(g,x,f[m]);delete a[g],delete l[x],l[o(d,f[y],!0)]=y,f[m]=null}else g in l?u(g,x,p):x in a?i(g,x,p):(r(s),a[g]=h-1,l[x]=h-1)}else r(s)}return{features:c,textFeatures:v,geometries:f}};\n},{}],63:[function(require,module,exports){\n\"use strict\";function SymbolQuad(t,a,e,n,i,o,h,l,r){this.anchorPoint=t,this.tl=a,this.tr=e,this.bl=n,this.br=i,this.tex=o,this.angle=h,this.minScale=l,this.maxScale=r}function getIconQuads(t,a,e,n,i,o){var h=a.image.rect,l=1,r=a.left-l,s=r+h.w,m=a.top-l,u=m+h.h,c=new Point(r,m),g=new Point(s,m),M=new Point(s,u),P=new Point(r,u),y=i[\"icon-rotate\"]*Math.PI/180;if(o){var f=n[t.segment];if(t.y===f.y&&t.x===f.x&&t.segment+1<n.length){var x=n[t.segment+1];y+=Math.atan2(t.y-x.y,t.x-x.x)+Math.PI}else y+=Math.atan2(t.y-f.y,t.x-f.x)}if(y){var v=Math.sin(y),S=Math.cos(y),p=[S,-v,v,S];c=c.matMult(p),g=g.matMult(p),P=P.matMult(p),M=M.matMult(p)}return[new SymbolQuad(new Point(t.x,t.y),c,g,P,M,a.image.rect,0,minScale,1/0)]}function getGlyphQuads(t,a,e,n,i,o){for(var h=i[\"text-rotate\"]*Math.PI/180,l=i[\"text-keep-upright\"],r=a.positionedGlyphs,s=[],m=0;m<r.length;m++){var u=r[m],c=u.glyph,g=c.rect;if(g){var M,P=(u.x+c.advance/2)*e,y=minScale;o?(M=[],y=getSegmentGlyphs(M,t,P,n,t.segment,!0),l&&(y=Math.min(y,getSegmentGlyphs(M,t,P,n,t.segment,!1)))):M=[{anchorPoint:new Point(t.x,t.y),offset:0,angle:0,maxScale:1/0,minScale:minScale}];for(var f=u.x+c.left,x=u.y-c.top,v=f+g.w,S=x+g.h,p=new Point(f,x),w=new Point(v,x),d=new Point(f,S),I=new Point(v,S),b=0;b<M.length;b++){var Q=M[b],G=p,k=w,q=d,_=I,j=Q.angle+h;if(j){var z=Math.sin(j),A=Math.cos(j),B=[A,-z,z,A];G=G.matMult(B),k=k.matMult(B),q=q.matMult(B),_=_.matMult(B)}var C=Math.max(Q.minScale,y),D=(t.angle+h+Q.offset+2*Math.PI)%(2*Math.PI);s.push(new SymbolQuad(Q.anchorPoint,G,k,q,_,g,D,C,Q.maxScale))}}}return s}function getSegmentGlyphs(t,a,e,n,i,o){var h=!o;0>e&&(o=!o),o&&i++;var l=new Point(a.x,a.y),r=n[i],s=1/0;e=Math.abs(e);for(var m=minScale;;){var u=l.dist(r),c=e/u,g=Math.atan2(r.y-l.y,r.x-l.x);if(o||(g+=Math.PI),h&&(g+=Math.PI),t.push({anchorPoint:l,offset:h?Math.PI:0,minScale:c,maxScale:s,angle:(g+2*Math.PI)%(2*Math.PI)}),m>=c)break;for(l=r;l.equals(r);)if(i+=o?1:-1,r=n[i],!r)return c;var M=r.sub(l)._unit();l=l.sub(M._mult(u)),s=c}return m}var Point=require(\"point-geometry\");module.exports={getIconQuads:getIconQuads,getGlyphQuads:getGlyphQuads};var minScale=.5;\n},{\"point-geometry\":128}],64:[function(require,module,exports){\n\"use strict\";function resolveText(e,r,o){for(var t=[],s=0,l=e.length;l>s;s++){var a=resolveTokens(e[s].properties,r[\"text-field\"]);if(a){a=a.toString();var n=r[\"text-transform\"];\"uppercase\"===n?a=a.toLocaleUpperCase():\"lowercase\"===n&&(a=a.toLocaleLowerCase());for(var v=0;v<a.length;v++)o[a.charCodeAt(v)]=!0;t[s]=a}else t[s]=null}return t}var resolveTokens=require(\"../util/token\");module.exports=resolveText;\n},{\"../util/token\":94}],65:[function(require,module,exports){\n\"use strict\";function PositionedGlyph(t,i,n,e){this.codePoint=t,this.x=i,this.y=n,this.glyph=e}function Shaping(t,i,n,e,o,h){this.positionedGlyphs=t,this.text=i,this.top=n,this.bottom=e,this.left=o,this.right=h}function shapeText(t,i,n,e,o,h,a,s,r){for(var l=[],f=new Shaping(l,t,r[1],r[1],r[0],r[0]),c=-17,p=r[0],u=r[1]+c,v=0;v<t.length;v++){var d=t.charCodeAt(v),g=i[d];g&&(l.push(new PositionedGlyph(d,p,u,g)),p+=g.advance+s)}return l.length?(linewrap(f,i,e,n,o,h,a),f):!1}function linewrap(t,i,n,e,o,h,a){var s=null,r=0,l=0,f=0,c=0,p=t.positionedGlyphs;if(e)for(var u=0;u<p.length;u++){var v=p[u];if(v.x-=r,v.y+=n*f,v.x>e&&null!==s){var d=p[s+1].x;c=Math.max(d,c);for(var g=s+1;u>=g;g++)p[g].y+=n,p[g].x-=d;if(a){var x=s;invisible[p[s].codePoint]&&x--,justifyLine(p,i,l,x,a)}l=s+1,s=null,r+=d,f++}breakable[v.codePoint]&&(s=u)}var y=p[p.length-1],b=y.x+i[y.codePoint].advance;c=Math.max(c,b);var P=(f+1)*n;justifyLine(p,i,l,p.length-1,a),align(p,a,o,h,c,n,f),t.top+=-h*P,t.bottom=t.top+P,t.left+=-o*c,t.right=t.left+c}function justifyLine(t,i,n,e,o){for(var h=i[t[e].codePoint].advance,a=(t[e].x+h)*o,s=n;e>=s;s++)t[s].x-=a}function align(t,i,n,e,o,h,a){for(var s=(i-n)*o,r=(-e*(a+1)+.5)*h,l=0;l<t.length;l++)t[l].x+=s,t[l].y+=r}function shapeIcon(t,i){if(!t||!t.rect)return null;var n=i[\"icon-offset\"][0],e=i[\"icon-offset\"][1],o=n-t.width/2,h=o+t.width,a=e-t.height/2,s=a+t.height;return new PositionedIcon(t,a,s,o,h)}function PositionedIcon(t,i,n,e,o){this.image=t,this.top=i,this.bottom=n,this.left=e,this.right=o}module.exports={shapeText:shapeText,shapeIcon:shapeIcon};var invisible={32:!0,8203:!0},breakable={32:!0,38:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0};\n},{}],66:[function(require,module,exports){\n\"use strict\";function SpriteAtlas(t,i){this.width=t,this.height=i,this.bin=new BinPack(t,i),this.images={},this.data=!1,this.texture=0,this.filter=0,this.pixelRatio=1,this.dirty=!0}function copyBitmap(t,i,e,h,a,s,r,o,n,l,p){var d,c,x=h*i+e,f=o*s+r;if(p)for(f-=s,c=-1;l>=c;c++,x=((c+l)%l+h)*i+e,f+=s)for(d=-1;n>=d;d++)a[f+d]=t[x+(d+n)%n];else for(c=0;l>c;c++,x+=i,f+=s)for(d=0;n>d;d++)a[f+d]=t[x+d]}function AtlasImage(t,i,e,h){this.rect=t,this.width=i,this.height=e,this.sdf=h}var BinPack=require(\"./bin_pack\");module.exports=SpriteAtlas,SpriteAtlas.prototype={get debug(){return\"canvas\"in this},set debug(t){t&&!this.canvas?(this.canvas=document.createElement(\"canvas\"),this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio,this.canvas.style.width=this.width+\"px\",this.canvas.style.width=this.width+\"px\",document.body.appendChild(this.canvas),this.ctx=this.canvas.getContext(\"2d\")):!t&&this.canvas&&(this.canvas.parentNode.removeChild(this.canvas),delete this.ctx,delete this.canvas)}},SpriteAtlas.prototype.resize=function(t){if(t=t>1?2:1,this.pixelRatio===t)return!1;var i=this.pixelRatio;if(this.pixelRatio=t,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio),this.data){var e=this.data;this.data=!1,this.allocate(),this.texture=!1;for(var h=this.width*i,a=this.height*i,s=this.width*t,r=this.height*t,o=this.data,n=e,l=0;r>l;l++)for(var p=Math.floor(l*a/r)*h,d=l*s,c=0;s>c;c++){var x=Math.floor(c*h/s);o[d+c]=n[p+x]}e=null,this.dirty=!0}return this.dirty},SpriteAtlas.prototype.allocateImage=function(t,i){var e=2,h=t+e+(4-(t+e)%4),a=i+e+(4-(i+e)%4),s=this.bin.allocate(h,a);return 0===s.w?s:(s.originalWidth=t,s.originalHeight=i,s)},SpriteAtlas.prototype.getImage=function(t,i){if(this.images[t])return this.images[t];if(!this.sprite)return null;var e=this.sprite.getSpritePosition(t);if(!e.width||!e.height)return null;var h=e.width/e.pixelRatio,a=e.height/e.pixelRatio,s=this.allocateImage(h,a);if(0===s.w)return s;var r=new AtlasImage(s,h,a,e.sdf);return this.images[t]=r,this.copy(s,e,i),r},SpriteAtlas.prototype.getPosition=function(t,i){var e=this.getImage(t,i),h=e&&e.rect;if(!h)return null;var a=i?e.width:h.w,s=i?e.height:h.h,r=1;return{size:[a,s],tl:[(h.x+r)/this.width,(h.y+r)/this.height],br:[(h.x+r+a)/this.width,(h.y+r+s)/this.height]}},SpriteAtlas.prototype.allocate=function(){if(!this.data){var t=Math.floor(this.width*this.pixelRatio),i=Math.floor(this.height*this.pixelRatio);this.data=new Uint32Array(t*i);for(var e=0;e<this.data.length;e++)this.data[e]=0}},SpriteAtlas.prototype.copy=function(t,i,e){if(this.sprite.img.data){var h=new Uint32Array(this.sprite.img.data.buffer);this.allocate();var a=this.data,s=1;copyBitmap(h,this.sprite.img.width,i.x,i.y,a,this.width*this.pixelRatio,(t.x+s)*this.pixelRatio,(t.y+s)*this.pixelRatio,i.width,i.height,e),this.dirty=!0}},SpriteAtlas.prototype.setSprite=function(t){this.sprite=t},SpriteAtlas.prototype.addIcons=function(t,i){for(var e=0;e<t.length;e++)this.getImage(t[e]);i(null,this.images)},SpriteAtlas.prototype.bind=function(t,i){var e=!1;this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e=!0);var h=i?t.LINEAR:t.NEAREST;if(h!==this.filter&&(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,h),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,h),this.filter=h),this.dirty&&(this.allocate(),e?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width*this.pixelRatio,this.height*this.pixelRatio,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width*this.pixelRatio,this.height*this.pixelRatio,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)),this.dirty=!1,this.ctx)){var a=this.ctx.getImageData(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio);a.data.set(new Uint8ClampedArray(this.data.buffer)),this.ctx.putImageData(a,0,0),this.ctx.strokeStyle=\"red\";for(var s=0;s<this.bin.free.length;s++){var r=this.bin.free[s];this.ctx.strokeRect(r.x*this.pixelRatio,r.y*this.pixelRatio,r.w*this.pixelRatio,r.h*this.pixelRatio)}}};\n},{\"./bin_pack\":53}],67:[function(require,module,exports){\n\"use strict\";var util=require(\"../util/util\"),interpolate=require(\"../util/interpolate\"),browser=require(\"../util/browser\"),LngLat=require(\"../geo/lng_lat\"),LngLatBounds=require(\"../geo/lng_lat_bounds\"),Point=require(\"point-geometry\"),Camera=module.exports=function(){};util.extend(Camera.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t){return this.jumpTo({center:t}),this},panBy:function(t,i){return this.panTo(this.transform.center,util.extend({offset:Point.convert(t).mult(-1)},i)),this},panTo:function(t,i){this.stop(),t=LngLat.convert(t),i=util.extend({duration:500,easing:util.ease,offset:[0,0]},i);var e=this.transform,n=Point.convert(i.offset).rotate(-e.angle),o=e.point,r=e.project(t).sub(n);return i.noMoveStart||this.fire(\"movestart\"),this._ease(function(t){e.center=e.unproject(o.add(r.sub(o).mult(t))),this.fire(\"move\")},function(){this.fire(\"moveend\")},i),this},getZoom:function(){return this.transform.zoom},setZoom:function(t){return this.jumpTo({zoom:t}),this},zoomTo:function(t,i){this.stop(),i=util.extend({duration:500},i),i.easing=this._updateEasing(i.duration,t,i.easing);var e=this.transform,n=e.center,o=e.zoom;return i.around?n=LngLat.convert(i.around):i.offset&&(n=e.pointLocation(e.centerPoint.add(Point.convert(i.offset)))),i.animate===!1&&(i.duration=0),this.zooming||(this.zooming=!0,this.fire(\"movestart\")),this._ease(function(i){e.setZoomAround(interpolate(o,t,i),n),this.fire(\"move\").fire(\"zoom\")},function(){this.ease=null,i.duration>=200&&(this.zooming=!1,this.fire(\"moveend\"))},i),i.duration<200&&(clearTimeout(this._onZoomEnd),this._onZoomEnd=setTimeout(function(){this.zooming=!1,this.fire(\"moveend\")}.bind(this),200)),this},zoomIn:function(t){return this.zoomTo(this.getZoom()+1,t),this},zoomOut:function(t){return this.zoomTo(this.getZoom()-1,t),this},getBearing:function(){return this.transform.bearing},setBearing:function(t){return this.jumpTo({bearing:t}),this},rotateTo:function(t,i){this.stop(),i=util.extend({duration:500,easing:util.ease},i);var e=this.transform,n=this.getBearing(),o=e.center;return i.around?o=LngLat.convert(i.around):i.offset&&(o=e.pointLocation(e.centerPoint.add(Point.convert(i.offset)))),t=this._normalizeBearing(t,n),this.rotating=!0,i.noMoveStart||this.fire(\"movestart\"),this._ease(function(i){e.setBearingAround(interpolate(n,t,i),o),this.fire(\"move\").fire(\"rotate\")},function(){this.rotating=!1,this.fire(\"moveend\")},i),this},resetNorth:function(t){return this.rotateTo(0,util.extend({duration:1e3},t)),this},snapToNorth:function(t){return Math.abs(this.getBearing())<this.options.bearingSnap?this.resetNorth(t):this},getPitch:function(){return this.transform.pitch},setPitch:function(t){return this.jumpTo({pitch:t}),this},fitBounds:function(t,i){i=util.extend({padding:0,offset:[0,0],maxZoom:1/0},i),t=LngLatBounds.convert(t);var e=Point.convert(i.offset),n=this.transform,o=n.project(t.getNorthWest()),r=n.project(t.getSouthEast()),s=r.sub(o),a=(n.width-2*i.padding-2*Math.abs(e.x))/s.x,h=(n.height-2*i.padding-2*Math.abs(e.y))/s.y;return i.center=n.unproject(o.add(r).div(2)),i.zoom=Math.min(n.scaleZoom(n.scale*Math.min(a,h)),i.maxZoom),i.bearing=0,i.linear?this.easeTo(i):this.flyTo(i)},jumpTo:function(t){this.stop();var i=this.transform,e=!1,n=!1,o=!1;return\"zoom\"in t&&i.zoom!==+t.zoom&&(e=!0,i.zoom=+t.zoom),\"center\"in t&&(i.center=LngLat.convert(t.center)),\"bearing\"in t&&i.bearing!==+t.bearing&&(n=!0,i.bearing=+t.bearing),\"pitch\"in t&&i.pitch!==+t.pitch&&(o=!0,i.pitch=+t.pitch),this.fire(\"movestart\").fire(\"move\"),e&&this.fire(\"zoom\"),n&&this.fire(\"rotate\"),o&&this.fire(\"pitch\"),this.fire(\"moveend\")},easeTo:function(t){this.stop(),t=util.extend({offset:[0,0],duration:500,easing:util.ease},t);var i=this.transform,e=Point.convert(t.offset).rotate(-i.angle),n=i.point,o=i.worldSize,r=this.getZoom(),s=this.getBearing(),a=this.getPitch(),h=\"zoom\"in t?+t.zoom:r,u=\"bearing\"in t?this._normalizeBearing(t.bearing,s):s,c=\"pitch\"in t?+t.pitch:a,f=i.zoomScale(h-r),g=\"center\"in t?i.project(LngLat.convert(t.center)).sub(e.div(f)):n,m=\"center\"in t?null:LngLat.convert(t.around);return h!==r&&(this.zooming=!0),s!==u&&(this.rotating=!0),c!==a&&(this.pitching=!0),this.zooming&&!m&&(m=i.pointLocation(i.centerPoint.add(g.sub(n).div(1-1/f)))),this.fire(\"movestart\"),this._ease(function(t){this.zooming&&m?i.setZoomAround(interpolate(r,h,t),m):(this.zooming&&(i.zoom=interpolate(r,h,t)),i.center=i.unproject(n.add(g.sub(n).mult(t)),o)),this.rotating&&(i.bearing=interpolate(s,u,t)),this.pitching&&(i.pitch=interpolate(a,c,t)),this.fire(\"move\"),this.zooming&&this.fire(\"zoom\"),this.rotating&&this.fire(\"rotate\"),this.pitching&&this.fire(\"pitch\")},function(){this.zooming=!1,this.rotating=!1,this.pitching=!1,this.fire(\"moveend\")},t),this},flyTo:function(t){function i(t){var i=(M*M-_*_+(t?-1:1)*T*T*L*L)/(2*(t?M:_)*T*L);return Math.log(Math.sqrt(i*i+1)-i)}function e(t){return(Math.exp(t)-Math.exp(-t))/2}function n(t){return(Math.exp(t)+Math.exp(-t))/2}function o(t){return e(t)/n(t)}this.stop(),t=util.extend({offset:[0,0],speed:1.2,curve:1.42,easing:util.ease},t);var r=this.transform,s=Point.convert(t.offset),a=this.getZoom(),h=this.getBearing(),u=this.getPitch(),c=\"center\"in t?LngLat.convert(t.center):this.getCenter(),f=\"zoom\"in t?+t.zoom:a,g=\"bearing\"in t?this._normalizeBearing(t.bearing,h):h,m=\"pitch\"in t?+t.pitch:u;Math.abs(r.center.lng)+Math.abs(c.lng)>180&&(r.center.lng>0&&c.lng<0?c.lng+=360:r.center.lng<0&&c.lng>0&&(c.lng-=360));var p=r.zoomScale(f-a),l=r.point,d=\"center\"in t?r.project(c).sub(s.div(p)):l,v=r.worldSize,b=t.curve,z=t.speed,_=Math.max(r.width,r.height),M=_/p,L=d.sub(l).mag(),T=b*b,x=i(0),B=function(t){return n(x)/n(x+b*t)},P=function(t){return _*((n(x)*o(x+b*t)-e(x))/T)/L},j=(i(1)-x)/b;if(Math.abs(L)<1e-6){if(Math.abs(_-M)<1e-6)return this.easeTo(t);var Z=_>M?-1:1;j=Math.abs(Math.log(M/_))/b,P=function(){return 0},B=function(t){return Math.exp(Z*b*t)}}return t.duration=1e3*j/z,this.zooming=!0,h!==g&&(this.rotating=!0),u!==m&&(this.pitching=!0),this.fire(\"movestart\"),this._ease(function(t){var i=t*j,e=P(i);r.zoom=a+r.scaleZoom(1/B(i)),r.center=r.unproject(l.add(d.sub(l).mult(e)),v),this.rotating&&(r.bearing=interpolate(h,g,t)),this.pitching&&(r.pitch=interpolate(u,m,t)),this.fire(\"move\").fire(\"zoom\"),this.rotating&&this.fire(\"rotate\"),this.pitching&&this.fire(\"pitch\")},function(){this.zooming=!1,this.rotating=!1,this.pitching=!1,this.fire(\"moveend\")},t),this},isEasing:function(){return!!this._abortFn},stop:function(){return this._abortFn&&(this._abortFn(),this._finishEase()),this},_ease:function(t,i,e){this._finishFn=i,this._abortFn=browser.timed(function(i){t.call(this,e.easing(i)),1===i&&this._finishEase()},e.animate===!1?0:e.duration,this)},_finishEase:function(){delete this._abortFn;var t=this._finishFn;delete this._finishFn,t.call(this)},_normalizeBearing:function(t,i){t=util.wrap(t,-180,180);var e=Math.abs(t-i);return Math.abs(t-360-i)<e&&(t-=360),Math.abs(t+360-i)<e&&(t+=360),t},_updateEasing:function(t,i,e){var n;if(this.ease){var o=this.ease,r=(Date.now()-o.start)/o.duration,s=o.easing(r+.01)-o.easing(r),a=.27/Math.sqrt(s*s+1e-4)*.01,h=Math.sqrt(.0729-a*a);n=util.bezier(a,h,.25,1)}else n=e?util.bezier.apply(util,e):util.ease;return this.ease={start:(new Date).getTime(),to:Math.pow(2,i),duration:t,easing:n},n}});\n},{\"../geo/lng_lat\":10,\"../geo/lng_lat_bounds\":11,\"../util/browser\":84,\"../util/interpolate\":91,\"../util/util\":95,\"point-geometry\":128}],68:[function(require,module,exports){\n\"use strict\";function Attribution(t){util.setOptions(this,t)}var Control=require(\"./control\"),DOM=require(\"../../util/dom\"),util=require(\"../../util/util\");module.exports=Attribution,Attribution.prototype=util.inherit(Control,{options:{position:\"bottom-right\"},onAdd:function(t){var i=\"mapboxgl-ctrl-attrib\",e=this._container=DOM.create(\"div\",i,t.getContainer());return this._update(),t.on(\"source.load\",this._update.bind(this)),t.on(\"source.change\",this._update.bind(this)),t.on(\"source.remove\",this._update.bind(this)),t.on(\"moveend\",this._updateEditLink.bind(this)),e},_update:function(){var t=[];if(this._map.style)for(var i in this._map.style.sources){var e=this._map.style.sources[i];e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}this._container.innerHTML=t.join(\" | \"),this._editLink=this._container.getElementsByClassName(\"mapbox-improve-map\")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href=\"https://www.mapbox.com/map-feedback/#/\"+t.lng+\"/\"+t.lat+\"/\"+Math.round(this._map.getZoom()+1)}}});\n},{\"../../util/dom\":87,\"../../util/util\":95,\"./control\":69}],69:[function(require,module,exports){\n\"use strict\";function Control(){}module.exports=Control,Control.prototype={addTo:function(o){this._map=o;var t=this._container=this.onAdd(o);if(this.options&&this.options.position){var i=this.options.position,n=o._controlCorners[i];t.className+=\" mapboxgl-ctrl\",-1!==i.indexOf(\"bottom\")?n.insertBefore(t,n.firstChild):n.appendChild(t)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}};\n},{}],70:[function(require,module,exports){\n\"use strict\";function Navigation(t){util.setOptions(this,t)}function copyMouseEvent(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var Control=require(\"./control\"),DOM=require(\"../../util/dom\"),util=require(\"../../util/util\");module.exports=Navigation,Navigation.prototype=util.inherit(Control,{options:{position:\"top-right\"},onAdd:function(t){var o=\"mapboxgl-ctrl\",e=this._container=DOM.create(\"div\",o+\"-group\",t.getContainer());return this._container.addEventListener(\"contextmenu\",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(o+\"-icon \"+o+\"-zoom-in\",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(o+\"-icon \"+o+\"-zoom-out\",t.zoomOut.bind(t)),this._compass=this._createButton(o+\"-icon \"+o+\"-compass\",t.resetNorth.bind(t)),this._compassArrow=DOM.create(\"div\",\"arrow\",this._compass),this._compass.addEventListener(\"mousedown\",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on(\"rotate\",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),e},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(DOM.disableDrag(),document.addEventListener(\"mousemove\",this._onCompassMove),document.addEventListener(\"mouseup\",this._onCompassUp),this._el.dispatchEvent(copyMouseEvent(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(copyMouseEvent(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener(\"mousemove\",this._onCompassMove),document.removeEventListener(\"mouseup\",this._onCompassUp),DOM.enableDrag(),this._el.dispatchEvent(copyMouseEvent(t)),t.stopPropagation())},_createButton:function(t,o){var e=DOM.create(\"button\",t,this._container);return e.addEventListener(\"click\",function(){o()}),e},_rotateCompassArrow:function(){var t=\"rotate(\"+this._map.transform.angle*(180/Math.PI)+\"deg)\";this._compassArrow.style.transform=t}});\n},{\"../../util/dom\":87,\"../../util/util\":95,\"./control\":69}],71:[function(require,module,exports){\n\"use strict\";function BoxZoom(o){this._map=o,this._el=o.getCanvasContainer(),this._container=o.getContainer(),util.bindHandlers(this)}var DOM=require(\"../../util/dom\"),LngLatBounds=require(\"../../geo/lng_lat_bounds\"),util=require(\"../../util/util\");module.exports=BoxZoom,BoxZoom.prototype={enable:function(){this._el.addEventListener(\"mousedown\",this._onMouseDown,!1)},disable:function(){this._el.removeEventListener(\"mousedown\",this._onMouseDown)},_onMouseDown:function(o){o.shiftKey&&0===o.button&&(document.addEventListener(\"mousemove\",this._onMouseMove,!1),document.addEventListener(\"keydown\",this._onKeyDown,!1),document.addEventListener(\"mouseup\",this._onMouseUp,!1),this._startPos=DOM.mousePos(this._el,o),this.active=!0)},_onMouseMove:function(o){var e=this._startPos,t=DOM.mousePos(this._el,o);this._box||(this._box=DOM.create(\"div\",\"mapboxgl-boxzoom\",this._container),this._container.classList.add(\"mapboxgl-crosshair\"),DOM.disableDrag(),this._fireEvent(\"boxzoomstart\",o));var n=Math.min(e.x,t.x),i=Math.max(e.x,t.x),s=Math.min(e.y,t.y),r=Math.max(e.y,t.y);DOM.setTransform(this._box,\"translate(\"+n+\"px,\"+s+\"px)\"),this._box.style.width=i-n+\"px\",this._box.style.height=r-s+\"px\"},_onMouseUp:function(o){if(0===o.button){var e=this._startPos,t=DOM.mousePos(this._el,o),n=new LngLatBounds(this._map.unproject(e),this._map.unproject(t));this._finish(),e.x===t.x&&e.y===t.y?this._fireEvent(\"boxzoomcancel\",o):this._map.fitBounds(n,{linear:!0}).fire(\"boxzoomend\",{originalEvent:o,boxZoomBounds:n})}},_onKeyDown:function(o){27===o.keyCode&&(this._finish(),this._fireEvent(\"boxzoomcancel\",o))},_finish:function(){this.active=!1,document.removeEventListener(\"mousemove\",this._onMouseMove,!1),document.removeEventListener(\"keydown\",this._onKeyDown,!1),document.removeEventListener(\"mouseup\",this._onMouseUp,!1),this._container.classList.remove(\"mapboxgl-crosshair\"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),DOM.enableDrag()},_fireEvent:function(o,e){return this._map.fire(o,{originalEvent:e})}};\n},{\"../../geo/lng_lat_bounds\":11,\"../../util/dom\":87,\"../../util/util\":95}],72:[function(require,module,exports){\n\"use strict\";function DoubleClickZoom(o){this._map=o,this._onDblClick=this._onDblClick.bind(this)}module.exports=DoubleClickZoom,DoubleClickZoom.prototype={enable:function(){this._map.on(\"dblclick\",this._onDblClick)},disable:function(){this._map.off(\"dblclick\",this._onDblClick)},_onDblClick:function(o){this._map.zoomTo(this._map.getZoom()+(o.originalEvent.shiftKey?-1:1),{around:o.lngLat})}};\n},{}],73:[function(require,module,exports){\n\"use strict\";function DragPan(t){this._map=t,this._el=t.getCanvasContainer(),util.bindHandlers(this)}var DOM=require(\"../../util/dom\"),util=require(\"../../util/util\");module.exports=DragPan;var inertiaLinearity=.25,inertiaEasing=util.bezier(0,0,inertiaLinearity,1),inertiaMaxSpeed=3e3,inertiaDeceleration=4e3;DragPan.prototype={enable:function(){this._el.addEventListener(\"mousedown\",this._onDown),this._el.addEventListener(\"touchstart\",this._onDown)},disable:function(){this._el.removeEventListener(\"mousedown\",this._onDown),this._el.removeEventListener(\"touchstart\",this._onDown)},_onDown:function(t){this._ignoreEvent(t)||this.active||(t.touches?(document.addEventListener(\"touchmove\",this._onMove),document.addEventListener(\"touchend\",this._onTouchEnd)):(document.addEventListener(\"mousemove\",this._onMove),document.addEventListener(\"mouseup\",this._onMouseUp)),this.active=!1,this._startPos=this._pos=DOM.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.active||(this.active=!0,this._fireEvent(\"dragstart\",t),this._fireEvent(\"movestart\",t));var e=DOM.mousePos(this._el,t),i=this._map;i.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),i.transform.setLocationAtPoint(i.transform.pointLocation(this._pos),e),this._fireEvent(\"drag\",t),this._fireEvent(\"move\",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.active){this.active=!1,this._fireEvent(\"dragend\",t),this._drainInertiaBuffer();var e=function(){this._fireEvent(\"moveend\",t)}.bind(this),i=this._inertia;if(i.length<2)return void e();var n=i[i.length-1],o=i[0],r=n[1].sub(o[1]),s=(n[0]-o[0])/1e3;if(0===s||n[1].equals(o[1]))return void e();var a=r.mult(inertiaLinearity/s),u=a.mag();u>inertiaMaxSpeed&&(u=inertiaMaxSpeed,a._unit()._mult(u));var h=u/(inertiaDeceleration*inertiaLinearity),v=a.mult(-h/2);this._map.panBy(v,{duration:1e3*h,easing:inertiaEasing,noMoveStart:!0})}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener(\"mousemove\",this._onMove),document.removeEventListener(\"mouseup\",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener(\"touchmove\",this._onMove),document.removeEventListener(\"touchend\",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.active)return!0;if(e.dragRotate&&e.dragRotate.active)return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;var i=1,n=0;return\"mousemove\"===t.type?t.buttons&0===i:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),i=50;t.length>0&&e-t[0][0]>i;)t.shift()}};\n},{\"../../util/dom\":87,\"../../util/util\":95}],74:[function(require,module,exports){\n\"use strict\";function DragRotate(t){this._map=t,this._el=t.getCanvasContainer(),util.bindHandlers(this)}var DOM=require(\"../../util/dom\"),Point=require(\"point-geometry\"),util=require(\"../../util/util\");module.exports=DragRotate;var inertiaLinearity=.25,inertiaEasing=util.bezier(0,0,inertiaLinearity,1),inertiaMaxSpeed=180,inertiaDeceleration=720;DragRotate.prototype={enable:function(){this._el.addEventListener(\"mousedown\",this._onDown)},disable:function(){this._el.removeEventListener(\"mousedown\",this._onDown)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.active){document.addEventListener(\"mousemove\",this._onMove),document.addEventListener(\"mouseup\",this._onUp),this.active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=DOM.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center),i=e.mag();200>i&&(this._center=this._startPos.add(new Point(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.active||(this.active=!0,this._fireEvent(\"rotatestart\",t),this._fireEvent(\"movestart\",t));var e=this._map;e.stop();var i=this._pos,n=DOM.mousePos(this._el,t),r=this._center,a=i.sub(r).angleWith(n.sub(r))/Math.PI*180,o=e.getBearing()-a,s=this._inertia,h=s[s.length-1];this._drainInertiaBuffer(),s.push([Date.now(),e._normalizeBearing(o,h[1])]),e.transform.bearing=o,this._fireEvent(\"rotate\",t),this._fireEvent(\"move\",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener(\"mousemove\",this._onMove),document.removeEventListener(\"mouseup\",this._onUp),this.active)){this.active=!1,this._fireEvent(\"rotateend\",t),this._drainInertiaBuffer();var e=this._map,i=e.getBearing(),n=this._inertia,r=function(){Math.abs(i)<e.options.bearingSnap?e.resetNorth({noMoveStart:!0}):this._fireEvent(\"moveend\",t)}.bind(this);if(n.length<2)return void r();var a=n[0],o=n[n.length-1],s=n[n.length-2],h=e._normalizeBearing(i,s[1]),u=o[1]-a[1],v=0>u?-1:1,_=(o[0]-a[0])/1e3;if(0===u||0===_)return void r();var m=Math.abs(u*(inertiaLinearity/_));m>inertiaMaxSpeed&&(m=inertiaMaxSpeed);var f=m/(inertiaDeceleration*inertiaLinearity),g=v*m*(f/2);h+=g,Math.abs(e._normalizeBearing(h,0))<e.options.bearingSnap&&(h=e._normalizeBearing(0,h)),e.rotateTo(h,{duration:1e3*f,easing:inertiaEasing,noMoveStart:!0})}},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.active)return!0;if(e.dragPan&&e.dragPan.active)return!0;if(t.touches)return t.touches.length>1;var i=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return\"mousemove\"===t.type?t.buttons&0===i:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),i=50;t.length>0&&e-t[0][0]>i;)t.shift()}};\n},{\"../../util/dom\":87,\"../../util/util\":95,\"point-geometry\":128}],75:[function(require,module,exports){\n\"use strict\";function Keyboard(e){this._map=e,this._el=e.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}module.exports=Keyboard;var panDelta=80,rotateDelta=2,pitchDelta=5;Keyboard.prototype={enable:function(){this._el.addEventListener(\"keydown\",this._onKeyDown,!1)},disable:function(){this._el.removeEventListener(\"keydown\",this._onKeyDown)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t=this._map;switch(e.keyCode){case 61:case 107:case 171:case 187:t.zoomTo(Math.round(t.getZoom())+(e.shiftKey?2:1));break;case 189:case 109:case 173:t.zoomTo(Math.round(t.getZoom())-(e.shiftKey?2:1));break;case 37:e.shiftKey?t.easeTo({bearing:t.getBearing()-rotateDelta}):t.panBy([-panDelta,0]);break;case 39:e.shiftKey?t.easeTo({bearing:t.getBearing()+rotateDelta}):t.panBy([panDelta,0]);break;case 38:e.shiftKey?t.easeTo({pitch:t.getPitch()+pitchDelta}):t.panBy([0,-panDelta]);break;case 40:e.shiftKey?t.easeTo({pitch:Math.max(t.getPitch()-pitchDelta,0)}):t.panBy([0,panDelta])}}}};\n},{}],76:[function(require,module,exports){\n\"use strict\";function ScrollZoom(e){this._map=e,this._el=e.getCanvasContainer(),util.bindHandlers(this)}var DOM=require(\"../../util/dom\"),browser=require(\"../../util/browser\"),util=require(\"../../util/util\");module.exports=ScrollZoom;var ua=\"undefined\"!=typeof navigator?navigator.userAgent.toLowerCase():\"\",firefox=-1!==ua.indexOf(\"firefox\"),safari=-1!==ua.indexOf(\"safari\")&&-1===ua.indexOf(\"chrom\");ScrollZoom.prototype={enable:function(){this._el.addEventListener(\"wheel\",this._onWheel,!1),this._el.addEventListener(\"mousewheel\",this._onWheel,!1)},disable:function(){this._el.removeEventListener(\"wheel\",this._onWheel),this._el.removeEventListener(\"mousewheel\",this._onWheel)},_onWheel:function(e){var t;\"wheel\"===e.type?(t=e.deltaY,firefox&&e.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(t/=browser.devicePixelRatio),e.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(t*=40)):\"mousewheel\"===e.type&&(t=-e.wheelDeltaY,safari&&(t/=3));var i=(window.performance||Date).now(),o=i-(this._time||0);this._pos=DOM.mousePos(this._el,e),this._time=i,0!==t&&t%4.000244140625===0?(this._type=\"wheel\",t=Math.floor(t/4)):0!==t&&Math.abs(t)<4?this._type=\"trackpad\":o>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(o*t)<200?\"trackpad\":\"wheel\",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&this._zoom(-t),e.preventDefault()},_onTimeout:function(){this._type=\"wheel\",this._zoom(-this._lastValue)},_zoom:function(e){var t=this._map,i=2/(1+Math.exp(-Math.abs(e/100)));0>e&&0!==i&&(i=1/i);var o=t.ease?t.ease.to:t.transform.scale,s=t.transform.scaleZoom(o*i);t.zoomTo(s,{duration:0,around:t.unproject(this._pos)})}};\n},{\"../../util/browser\":84,\"../../util/dom\":87,\"../../util/util\":95}],77:[function(require,module,exports){\n\"use strict\";function TouchZoomRotate(t){this._map=t,this._el=t.getCanvasContainer(),util.bindHandlers(this)}var DOM=require(\"../../util/dom\"),util=require(\"../../util/util\");module.exports=TouchZoomRotate,TouchZoomRotate.prototype={enable:function(){this._el.addEventListener(\"touchstart\",this._onStart,!1)},disable:function(){this._el.removeEventListener(\"touchstart\",this._onStart)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=DOM.mousePos(this._el,t.touches[0]),o=DOM.mousePos(this._el,t.touches[1]);this._startVec=e.sub(o),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,document.addEventListener(\"touchmove\",this._onMove,!1),document.addEventListener(\"touchend\",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=DOM.mousePos(this._el,t.touches[0]),o=DOM.mousePos(this._el,t.touches[1]),s=e.add(o).div(2),n=e.sub(o),i=n.mag()/this._startVec.mag(),a=this._rotationDisabled?0:180*n.angleWith(this._startVec)/Math.PI,r=this._map;r.easeTo({zoom:r.transform.scaleZoom(this._startScale*i),bearing:this._startBearing+a,duration:0,around:r.unproject(s)}),t.preventDefault()}},_onEnd:function(){this._map.snapToNorth(),document.removeEventListener(\"touchmove\",this._onMove),document.removeEventListener(\"touchend\",this._onEnd)}};\n},{\"../../util/dom\":87,\"../../util/util\":95}],78:[function(require,module,exports){\n\"use strict\";function Hash(){util.bindAll([\"_onHashChange\",\"_updateHash\"],this)}module.exports=Hash;var util=require(\"../util/util\");Hash.prototype={addTo:function(t){return this._map=t,window.addEventListener(\"hashchange\",this._onHashChange,!1),this._map.on(\"moveend\",this._updateHash),this},remove:function(){return window.removeEventListener(\"hashchange\",this._onHashChange,!1),this._map.off(\"moveend\",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace(\"#\",\"\").split(\"/\");return t.length>=3?(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0):!1},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),a=this._map.getBearing(),h=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),n=\"#\"+Math.round(100*e)/100+\"/\"+t.lat.toFixed(h)+\"/\"+t.lng.toFixed(h)+(a?\"/\"+Math.round(10*a)/10:\"\");window.history.replaceState(\"\",\"\",n)}};\n},{\"../util/util\":95}],79:[function(require,module,exports){\n\"use strict\";function Interaction(e){this._map=e,this._el=e.getCanvasContainer();for(var t in handlers)e[t]=new handlers[t](e);util.bindHandlers(this)}var handlers={scrollZoom:require(\"./handler/scroll_zoom\"),boxZoom:require(\"./handler/box_zoom\"),dragRotate:require(\"./handler/drag_rotate\"),dragPan:require(\"./handler/drag_pan\"),keyboard:require(\"./handler/keyboard\"),doubleClickZoom:require(\"./handler/dblclick_zoom\"),touchZoomRotate:require(\"./handler/touch_zoom_rotate\")},DOM=require(\"../util/dom\"),util=require(\"../util/util\");module.exports=Interaction,Interaction.prototype={enable:function(){var e=this._map.options,t=this._el;for(var n in handlers)e[n]&&this._map[n].enable();t.addEventListener(\"mousedown\",this._onMouseDown,!1),t.addEventListener(\"mouseup\",this._onMouseUp,!1),t.addEventListener(\"touchstart\",this._onTouchStart,!1),t.addEventListener(\"click\",this._onClick,!1),t.addEventListener(\"mousemove\",this._onMouseMove,!1),t.addEventListener(\"dblclick\",this._onDblClick,!1),t.addEventListener(\"contextmenu\",this._onContextMenu,!1)},disable:function(){var e=this._map.options,t=this._el;for(var n in handlers)e[n]&&this._map[n].disable();t.removeEventListener(\"mousedown\",this._onMouseDown),t.removeEventListener(\"mouseup\",this._onMouseUp),t.removeEventListener(\"touchstart\",this._onTouchStart),t.removeEventListener(\"click\",this._onClick),t.removeEventListener(\"mousemove\",this._onMouseMove),t.removeEventListener(\"dblclick\",this._onDblClick),t.removeEventListener(\"contextmenu\",this._onContextMenu)},_onMouseDown:function(e){this._map.stop(),this._startPos=DOM.mousePos(this._el,e),this._fireEvent(\"mousedown\",e)},_onMouseUp:function(e){var t=this._map,n=t.dragRotate&&t.dragRotate.active;this._contextMenuEvent&&!n&&this._fireEvent(\"contextmenu\",this._contextMenuEvent),this._contextMenuEvent=null,this._fireEvent(\"mouseup\",e)},_onTouchStart:function(e){!e.touches||e.touches.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._fireEvent(\"dblclick\",e)):this._tapped=setTimeout(this._onTimeout,300))},_onTimeout:function(){this._tapped=null},_onMouseMove:function(e){var t=this._map,n=this._el;if(!(t.dragPan&&t.dragPan.active||t.dragRotate&&t.dragRotate.active)){for(var o=e.toElement||e.target;o&&o!==n;)o=o.parentNode;o===n&&this._fireEvent(\"mousemove\",e)}},_onClick:function(e){var t=DOM.mousePos(this._el,e);t.equals(this._startPos)&&this._fireEvent(\"click\",e)},_onDblClick:function(e){this._fireEvent(\"dblclick\",e),e.preventDefault()},_onContextMenu:function(e){this._contextMenuEvent=e,e.preventDefault()},_fireEvent:function(e,t){var n=DOM.mousePos(this._el,t);return this._map.fire(e,{lngLat:this._map.unproject(n),point:n,originalEvent:t})}};\n},{\"../util/dom\":87,\"../util/util\":95,\"./handler/box_zoom\":71,\"./handler/dblclick_zoom\":72,\"./handler/drag_pan\":73,\"./handler/drag_rotate\":74,\"./handler/keyboard\":75,\"./handler/scroll_zoom\":76,\"./handler/touch_zoom_rotate\":77}],80:[function(require,module,exports){\n\"use strict\";var Canvas=require(\"../util/canvas\"),util=require(\"../util/util\"),browser=require(\"../util/browser\"),Evented=require(\"../util/evented\"),DOM=require(\"../util/dom\"),Style=require(\"../style/style\"),AnimationLoop=require(\"../style/animation_loop\"),Painter=require(\"../render/painter\"),Transform=require(\"../geo/transform\"),Hash=require(\"./hash\"),Interaction=require(\"./interaction\"),Camera=require(\"./camera\"),LngLat=require(\"../geo/lng_lat\"),LngLatBounds=require(\"../geo/lng_lat_bounds\"),Point=require(\"point-geometry\"),Attribution=require(\"./control/attribution\"),Map=module.exports=function(t){if(t=this.options=util.inherit(this.options,t),this.animationLoop=new AnimationLoop,this.transform=new Transform(t.minZoom,t.maxZoom),t.maxBounds){var e=LngLatBounds.convert(t.maxBounds);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()]}util.bindAll([\"_forwardStyleEvent\",\"_forwardSourceEvent\",\"_forwardLayerEvent\",\"_forwardTileEvent\",\"_onStyleLoad\",\"_onStyleChange\",\"_onSourceAdd\",\"_onSourceRemove\",\"_onSourceUpdate\",\"_onWindowResize\",\"onError\",\"_update\",\"_render\"],this),this._setupContainer(),this._setupPainter(),this.on(\"move\",this._update.bind(this,!1)),this.on(\"zoom\",this._update.bind(this,!0)),this.on(\"moveend\",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),\"undefined\"!=typeof window&&window.addEventListener(\"resize\",this._onWindowResize,!1),this.interaction=new Interaction(this),t.interactive&&this.interaction.enable(),this._hash=t.hash&&(new Hash).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo(t),this.sources={},this.stacks={},this._classes={},this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new Attribution),this.on(\"style.error\",this.onError),this.on(\"source.error\",this.onError),this.on(\"tile.error\",this.onError)};util.extend(Map.prototype,Evented),util.extend(Map.prototype,Camera.prototype),util.extend(Map.prototype,{options:{center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1},addControl:function(t){return t.addTo(this),this},addClass:function(t,e){this._classes[t]||(this._classes[t]=!0,this.style&&this.style._cascade(this._classes,e))},removeClass:function(t,e){this._classes[t]&&(delete this._classes[t],this.style&&this.style._cascade(this._classes,e))},setClasses:function(t,e){this._classes={};for(var i=0;i<t.length;i++)this._classes[t[i]]=!0;this.style&&this.style._cascade(this._classes,e)},hasClass:function(t){return!!this._classes[t]},getClasses:function(){return Object.keys(this._classes)},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire(\"movestart\").fire(\"move\").fire(\"resize\").fire(\"moveend\")},getBounds:function(){return new LngLatBounds(this.transform.pointLocation(new Point(0,0)),this.transform.pointLocation(this.transform.size))},project:function(t){return this.transform.locationPoint(LngLat.convert(t))},unproject:function(t){return this.transform.pointLocation(Point.convert(t))},featuresAt:function(t,e,i){var s=this.unproject(t).wrap(),r=this.transform.locationCoordinate(s);return this.style.featuresAt(r,e,i),this},featuresIn:function(t,e,i){return\"undefined\"==typeof i&&(i=e,e=t,t=[Point.convert([0,0]),Point.convert([this.transform.width,this.transform.height])]),t=t.map(Point.convert.bind(Point)),t=[new Point(Math.min(t[0].x,t[1].x),Math.min(t[0].y,t[1].y)),new Point(Math.max(t[0].x,t[1].x),Math.max(t[0].y,t[1].y))].map(this.transform.pointCoordinate.bind(this.transform)),this.style.featuresIn(t,e,i),this},batch:function(t){this.style.batch(t),this.style._cascade(this._classes),this._update(!0)},setStyle:function(t){return this.style&&(this.style.off(\"load\",this._onStyleLoad).off(\"error\",this._forwardStyleEvent).off(\"change\",this._onStyleChange).off(\"source.add\",this._onSourceAdd).off(\"source.remove\",this._onSourceRemove).off(\"source.load\",this._onSourceUpdate).off(\"source.error\",this._forwardSourceEvent).off(\"source.change\",this._onSourceUpdate).off(\"layer.add\",this._forwardLayerEvent).off(\"layer.remove\",this._forwardLayerEvent).off(\"tile.add\",this._forwardTileEvent).off(\"tile.remove\",this._forwardTileEvent).off(\"tile.load\",this._update).off(\"tile.error\",this._forwardTileEvent).off(\"tile.stats\",this._forwardTileEvent)._remove(),this.off(\"rotate\",this.style._redoPlacement),this.off(\"pitch\",this.style._redoPlacement)),t?(t instanceof Style?this.style=t:this.style=new Style(t,this.animationLoop),this.style.on(\"load\",this._onStyleLoad).on(\"error\",this._forwardStyleEvent).on(\"change\",this._onStyleChange).on(\"source.add\",this._onSourceAdd).on(\"source.remove\",this._onSourceRemove).on(\"source.load\",this._onSourceUpdate).on(\"source.error\",this._forwardSourceEvent).on(\"source.change\",this._onSourceUpdate).on(\"layer.add\",this._forwardLayerEvent).on(\"layer.remove\",this._forwardLayerEvent).on(\"tile.add\",this._forwardTileEvent).on(\"tile.remove\",this._forwardTileEvent).on(\"tile.load\",this._update).on(\"tile.error\",this._forwardTileEvent).on(\"tile.stats\",this._forwardTileEvent),this.on(\"rotate\",this.style._redoPlacement),this.on(\"pitch\",this.style._redoPlacement),this):(this.style=null,this)},addSource:function(t,e){return this.style.addSource(t,e),this},removeSource:function(t){return this.style.removeSource(t),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this.style._cascade(this._classes),this},removeLayer:function(t){return this.style.removeLayer(t),this.style._cascade(this._classes),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this},setLayerZoomRange:function(t,e,i){return this.style.setLayerZoomRange(t,e,i),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,i,s){return this.batch(function(r){r.setPaintProperty(t,e,i,s)}),this},getPaintProperty:function(t,e,i){return this.style.getPaintProperty(t,e,i)},setLayoutProperty:function(t,e,i){return this.batch(function(s){s.setLayoutProperty(t,e,i)}),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this.options.container,e=this._container=\"string\"==typeof t?document.getElementById(t):t;e.classList.add(\"mapboxgl-map\");var i=this._canvasContainer=DOM.create(\"div\",\"mapboxgl-canvas-container\",e);this.options.interactive&&i.classList.add(\"mapboxgl-interactive\"),this._canvas=new Canvas(this,i);var s=this._controlContainer=DOM.create(\"div\",\"mapboxgl-control-container\",e),r=this._controlCorners={};[\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"].forEach(function(t){r[t]=DOM.create(\"div\",\"mapboxgl-ctrl-\"+t,s)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this.options.failIfMajorPerformanceCaveat,preserveDrawingBuffer:this.options.preserveDrawingBuffer});return t?void(this.painter=new Painter(t,this.transform)):void console.error(\"Failed to initialize WebGL\")},_contextLost:function(t){t.preventDefault(),this._frameId&&browser.cancelFrame(this._frameId),this.fire(\"webglcontextlost\",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire(\"webglcontextrestored\",{originalEvent:t})},loaded:function(){return this._styleDirty||this._sourcesDirty?!1:this.style&&!this.style.loaded()?!1:!0},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){return this.style&&this._styleDirty&&(this._styleDirty=!1,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&!this._sourcesDirtyTimeout&&(this._sourcesDirty=!1,this._sourcesDirtyTimeout=setTimeout(function(){this._sourcesDirtyTimeout=null}.bind(this),50),this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.debug,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire(\"render\"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(\"load\")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||!this.animationLoop.stopped())&&this._rerender(),this},remove:function(){this._hash&&this._hash.remove(),browser.cancelFrame(this._frameId),clearTimeout(this._sourcesDirtyTimeout),this.setStyle(null),\"undefined\"!=typeof window&&window.removeEventListener(\"resize\",this._onWindowResize,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.classList.remove(\"mapboxgl-map\")},onError:function(t){console.error(t.error)},_rerender:function(){this.style&&!this._frameId&&(this._frameId=browser.frame(this._render))},_forwardStyleEvent:function(t){this.fire(\"style.\"+t.type,util.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,util.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,util.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,util.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style._cascade(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowResize:function(){this.stop().resize()._update()}}),util.extendAll(Map.prototype,{_debug:!1,get debug(){return this._debug},set debug(t){this._debug=t,this._update()},_collisionDebug:!1,get collisionDebug(){return this._collisionDebug},set collisionDebug(t){this._collisionDebug=t,this.style._redoPlacement()},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}});\n},{\"../geo/lng_lat\":10,\"../geo/lng_lat_bounds\":11,\"../geo/transform\":12,\"../render/painter\":27,\"../style/animation_loop\":41,\"../style/style\":46,\"../util/browser\":84,\"../util/canvas\":85,\"../util/dom\":87,\"../util/evented\":89,\"../util/util\":95,\"./camera\":67,\"./control/attribution\":68,\"./hash\":78,\"./interaction\":79,\"point-geometry\":128}],81:[function(require,module,exports){\n\"use strict\";function Popup(t){util.setOptions(this,t),util.bindAll([\"_update\",\"_onClickClose\"],this)}module.exports=Popup;var util=require(\"../util/util\"),Evented=require(\"../util/evented\"),DOM=require(\"../util/dom\"),LngLat=require(\"../geo/lng_lat\");Popup.prototype=util.inherit(Evented,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on(\"move\",this._update),this.options.closeOnClick&&this._map.on(\"click\",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off(\"move\",this._update),this._map.off(\"click\",this._onClickClose),delete this._map),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=LngLat.convert(t),this._update(),this},setText:function(t){return this._createContent(),this._content.appendChild(document.createTextNode(t)),this._update(),this},setHTML:function(t){this._createContent();var e,n=document.createElement(\"body\");for(n.innerHTML=t;;){if(e=n.firstChild,!e)break;this._content.appendChild(e)}return this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=DOM.create(\"div\",\"mapboxgl-popup-content\",this._container),this.options.closeButton&&(this._closeButton=DOM.create(\"button\",\"mapboxgl-popup-close-button\",this._content),this._closeButton.innerHTML=\"×\",this._closeButton.addEventListener(\"click\",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=DOM.create(\"div\",\"mapboxgl-popup\",this._map.getContainer()),this._tip=DOM.create(\"div\",\"mapboxgl-popup-tip\",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var n=this._container.offsetWidth,i=this._container.offsetHeight;e=t.y<i?[\"top\"]:t.y>this._map.transform.height-i?[\"bottom\"]:[],t.x<n/2?e.push(\"left\"):t.x>this._map.transform.width-n/2&&e.push(\"right\"),e=0===e.length?\"bottom\":e.join(\"-\"),this.options.anchor=e}var o={top:\"translate(-50%,0)\",\"top-left\":\"translate(0,0)\",\"top-right\":\"translate(-100%,0)\",bottom:\"translate(-50%,-100%)\",\"bottom-left\":\"translate(0,-100%)\",\"bottom-right\":\"translate(-100%,-100%)\",left:\"translate(0,-50%)\",right:\"translate(-100%,-50%)\"},s=this._container.classList;for(var a in o)s.remove(\"mapboxgl-popup-anchor-\"+a);s.add(\"mapboxgl-popup-anchor-\"+e),DOM.setTransform(this._container,o[e]+\" translate(\"+t.x+\"px,\"+t.y+\"px)\")}},_onClickClose:function(){this.remove()}});\n},{\"../geo/lng_lat\":10,\"../util/dom\":87,\"../util/evented\":89,\"../util/util\":95}],82:[function(require,module,exports){\n\"use strict\";function Actor(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener(\"message\",this.receive,!1)}module.exports=Actor,Actor.prototype.receive=function(t){var e,s=t.data;if(\"<response>\"===s.type)e=this.callbacks[s.id],delete this.callbacks[s.id],e(s.error||null,s.data);else if(\"undefined\"!=typeof s.id){var i=s.id;this.parent[s.type](s.data,function(t,e,s){this.postMessage({type:\"<response>\",id:String(i),error:t?String(t):null,data:e},s)}.bind(this))}else this.parent[s.type](s.data)},Actor.prototype.send=function(t,e,s,i){var a=null;s&&(this.callbacks[a=this.callbackID++]=s),this.postMessage({type:t,id:String(a),data:e},i)},Actor.prototype.postMessage=function(t,e){try{this.target.postMessage(t,e)}catch(s){this.target.postMessage(t)}};\n},{}],83:[function(require,module,exports){\n\"use strict\";function sameOrigin(e){var t=document.createElement(\"a\");return t.href=e,t.protocol===document.location.protocol&&t.host===document.location.host}exports.getJSON=function(e,t){var n=new XMLHttpRequest;return n.open(\"GET\",e,!0),n.setRequestHeader(\"Accept\",\"application/json\"),n.onerror=function(e){t(e)},n.onload=function(){if(n.status>=200&&n.status<300&&n.response){var e;try{e=JSON.parse(n.response)}catch(r){return t(r)}t(null,e)}else t(new Error(n.statusText))},n.send(),n},exports.getArrayBuffer=function(e,t){var n=new XMLHttpRequest;return n.open(\"GET\",e,!0),n.responseType=\"arraybuffer\",n.onerror=function(e){t(e)},n.onload=function(){n.status>=200&&n.status<300&&n.response?t(null,n.response):t(new Error(n.statusText))},n.send(),n},exports.getImage=function(e,t){return exports.getArrayBuffer(e,function(e,n){if(e)return t(e);var r=new Image;r.onload=function(){t(null,r),(window.URL||window.webkitURL).revokeObjectURL(r.src)};var o=new Blob([new Uint8Array(n)],{type:\"image/png\"});return r.src=(window.URL||window.webkitURL).createObjectURL(o),r.getData=function(){var e=document.createElement(\"canvas\"),t=e.getContext(\"2d\");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height).data},r})},exports.getVideo=function(e,t){var n=document.createElement(\"video\");n.onloadstart=function(){t(null,n)};for(var r=0;r<e.length;r++){var o=document.createElement(\"source\");sameOrigin(e[r])||(n.crossOrigin=\"Anonymous\"),o.src=e[r],n.appendChild(o)}return n.getData=function(){return n},n};\n},{}],84:[function(require,module,exports){\n\"use strict\";var Canvas=require(\"./canvas\"),frame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;exports.frame=function(e){return frame(e)};var cancel=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;exports.cancelFrame=function(e){cancel(e)},exports.timed=function(e,r,t){function n(a){o||(window.performance||(a=Date.now()),a>=i+r?e.call(t,1):(e.call(t,(a-i)/r),exports.frame(n)))}if(!r)return e.call(t,1),null;var o=!1,i=window.performance?window.performance.now():Date.now();return exports.frame(n),function(){o=!0}},exports.supported=function(e){for(var r=([function(){return\"undefined\"!=typeof window},function(){return\"undefined\"!=typeof document},function(){return!!(Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray)},function(){return!(!Function.prototype||!Function.prototype.bind||!(Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions))},function(){return\"JSON\"in window&&\"parse\"in JSON&&\"stringify\"in JSON},function(){return(new Canvas).supportsWebGLContext(e&&e.failIfMajorPerformanceCaveat||!1)},function(){return\"Worker\"in window}]),t=0;t<r.length;t++)if(!r[t]())return!1;return!0},exports.hardwareConcurrency=navigator.hardwareConcurrency||8,Object.defineProperty(exports,\"devicePixelRatio\",{get:function(){return window.devicePixelRatio}}),exports.supportsWebp=!1;var webpImgTest=document.createElement(\"img\");webpImgTest.onload=function(){exports.supportsWebp=!0},webpImgTest.src=\"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=\";\n},{\"./canvas\":85}],85:[function(require,module,exports){\n\"use strict\";function Canvas(t,e){this.canvas=document.createElement(\"canvas\"),t&&e&&(this.canvas.style.position=\"absolute\",this.canvas.classList.add(\"mapboxgl-canvas\"),this.canvas.addEventListener(\"webglcontextlost\",t._contextLost.bind(t),!1),this.canvas.addEventListener(\"webglcontextrestored\",t._contextRestored.bind(t),!1),this.canvas.setAttribute(\"tabindex\",0),e.appendChild(this.canvas))}var util=require(\"../util\");module.exports=Canvas,Canvas.prototype.resize=function(t,e){var a=window.devicePixelRatio||1;this.canvas.width=a*t,this.canvas.height=a*e,this.canvas.style.width=t+\"px\",this.canvas.style.height=e+\"px\"};var requiredContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!1};Canvas.prototype.getWebGLContext=function(t){return t=util.extend({},t,requiredContextAttributes),this.canvas.getContext(\"webgl\",t)||this.canvas.getContext(\"experimental-webgl\",t)},Canvas.prototype.supportsWebGLContext=function(t){var e=util.extend({failIfMajorPerformanceCaveat:t},requiredContextAttributes);return\"probablySupportsContext\"in this.canvas?this.canvas.probablySupportsContext(\"webgl\",e)||this.canvas.probablySupportsContext(\"experimental-webgl\",e):\"supportsContext\"in this.canvas?this.canvas.supportsContext(\"webgl\",e)||this.canvas.supportsContext(\"experimental-webgl\",e):!!window.WebGLRenderingContext&&!!this.getWebGLContext(t)},Canvas.prototype.getElement=function(){return this.canvas};\n},{\"../util\":95}],86:[function(require,module,exports){\n\"use strict\";function Dispatcher(r,t){this.actors=[],this.currentActor=0;for(var e=0;r>e;e++){var o=new WebWorkify(require(\"../../source/worker\")),s=new Actor(o,t);s.name=\"Worker \"+e,this.actors.push(s)}}var Actor=require(\"../actor\"),WebWorkify=require(\"webworkify\");module.exports=Dispatcher,Dispatcher.prototype={broadcast:function(r,t){for(var e=0;e<this.actors.length;e++)this.actors[e].send(r,t)},send:function(r,t,e,o,s){return(\"number\"!=typeof o||isNaN(o))&&(o=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[o].send(r,t,e,s),o},remove:function(){for(var r=0;r<this.actors.length;r++)this.actors[r].target.terminate();this.actors=[]}};\n},{\"../../source/worker\":39,\"../actor\":82,\"webworkify\":140}],87:[function(require,module,exports){\n\"use strict\";function testProp(e){for(var t=0;t<e.length;t++)if(e[t]in docStyle)return e[t]}function suppressClick(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener(\"click\",suppressClick,!0)}var Point=require(\"point-geometry\");exports.create=function(e,t,r){var o=document.createElement(e);return t&&(o.className=t),r&&r.appendChild(o),o};var docStyle=document.documentElement.style,selectProp=testProp([\"userSelect\",\"MozUserSelect\",\"WebkitUserSelect\",\"msUserSelect\"]),userSelect;exports.disableDrag=function(){selectProp&&(userSelect=docStyle[selectProp],docStyle[selectProp]=\"none\")},exports.enableDrag=function(){selectProp&&(docStyle[selectProp]=userSelect)};var transformProp=testProp([\"transform\",\"WebkitTransform\"]);exports.setTransform=function(e,t){e.style[transformProp]=t},exports.suppressClick=function(){window.addEventListener(\"click\",suppressClick,!0),window.setTimeout(function(){window.removeEventListener(\"click\",suppressClick,!0)},0)},exports.mousePos=function(e,t){var r=e.getBoundingClientRect();return t=t.touches?t.touches[0]:t,new Point(t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop)};\n},{\"point-geometry\":128}],88:[function(require,module,exports){\n\"use strict\";module.exports={API_URL:\"https://api.mapbox.com\",REQUIRE_ACCESS_TOKEN:!0};\n},{}],89:[function(require,module,exports){\n\"use strict\";var util=require(\"./util\"),Evented={on:function(t,e){return this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e),this},off:function(t,e){if(!t)return delete this._events,this;if(!this.listens(t))return this;if(e){var s=this._events[t].indexOf(e);s>=0&&this._events[t].splice(s,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var s=function(i){this.off(t,s),e.call(this,i)}.bind(this);return this.on(t,s),this},fire:function(t,e){if(!this.listens(t))return this;e=util.extend({},e),util.extend(e,{type:t,target:this});for(var s=this._events[t].slice(),i=0;i<s.length;i++)s[i].call(this,e);return this},listens:function(t){return!(!this._events||!this._events[t])}};module.exports=Evented;\n},{\"./util\":95}],90:[function(require,module,exports){\n\"use strict\";function Glyphs(a,e){this.stacks=a.readFields(readFontstacks,[],e)}function readFontstacks(a,e,r){if(1===a){var t=r.readMessage(readFontstack,{glyphs:{}});e.push(t)}}function readFontstack(a,e,r){if(1===a)e.name=r.readString();else if(2===a)e.range=r.readString();else if(3===a){var t=r.readMessage(readGlyph,{});e.glyphs[t.id]=t}}function readGlyph(a,e,r){1===a?e.id=r.readVarint():2===a?e.bitmap=r.readBytes():3===a?e.width=r.readVarint():4===a?e.height=r.readVarint():5===a?e.left=r.readSVarint():6===a?e.top=r.readSVarint():7===a&&(e.advance=r.readVarint())}module.exports=Glyphs;\n},{}],91:[function(require,module,exports){\n\"use strict\";function interpolate(t,e,n){return t*(1-n)+e*n}module.exports=interpolate,interpolate.number=interpolate,interpolate.vec2=function(t,e,n){return[interpolate(t[0],e[0],n),interpolate(t[1],e[1],n)]},interpolate.color=function(t,e,n){return[interpolate(t[0],e[0],n),interpolate(t[1],e[1],n),interpolate(t[2],e[2],n),interpolate(t[3],e[3],n)]},interpolate.array=function(t,e,n){return t.map(function(t,r){return interpolate(t,e[r],n)})};\n},{}],92:[function(require,module,exports){\n\"use strict\";function normalizeURL(e,r,o){if(o=o||config.ACCESS_TOKEN,!o&&config.REQUIRE_ACCESS_TOKEN)throw new Error(\"An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens\");if(e=e.replace(/^mapbox:\\/\\//,config.API_URL+r),e+=-1!==e.indexOf(\"?\")?\"&access_token=\":\"?access_token=\",config.REQUIRE_ACCESS_TOKEN){if(\"s\"===o[0])throw new Error(\"Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens\");e+=o}return e}var config=require(\"./config\"),browser=require(\"./browser\");module.exports.normalizeStyleURL=function(e,r){if(!e.match(/^mapbox:\\/\\/styles\\//))return e;var o=e.split(\"/\"),t=o[3],s=o[4],n=o[5]?\"/draft\":\"\";return normalizeURL(\"mapbox://\"+t+\"/\"+s+n,\"/styles/v1/\",r)},module.exports.normalizeSourceURL=function(e,r){return e.match(/^mapbox:\\/\\//)?normalizeURL(e+\".json\",\"/v4/\",r)+\"&secure\":e},module.exports.normalizeGlyphsURL=function(e,r){if(!e.match(/^mapbox:\\/\\//))return e;var o=e.split(\"/\")[3];return normalizeURL(\"mapbox://\"+o+\"/{fontstack}/{range}.pbf\",\"/fonts/v1/\",r)},module.exports.normalizeSpriteURL=function(e,r,o,t){if(!e.match(/^mapbox:\\/\\/sprites\\//))return e+r+o;var s=e.split(\"/\"),n=s[3],a=s[4],i=s[5]?\"/draft\":\"\";return normalizeURL(\"mapbox://\"+n+\"/\"+a+i+\"/sprite\"+r+o,\"/styles/v1/\",t)},module.exports.normalizeTileURL=function(e,r){if(!r||!r.match(/^mapbox:\\/\\//))return e;e=e.replace(/([?&]access_token=)tk\\.[^&]+/,\"$1\"+config.ACCESS_TOKEN);var o=browser.supportsWebp?\"webp\":\"$1\";return e.replace(/\\.((?:png|jpg)\\d*)(?=$|\\?)/,browser.devicePixelRatio>=2?\"@2x.\"+o:\".\"+o)};\n},{\"./browser\":84,\"./config\":88}],93:[function(require,module,exports){\n\"use strict\";function MRUCache(t,e){this.max=t,this.onRemove=e,this.reset()}module.exports=MRUCache,MRUCache.prototype.reset=function(){for(var t in this.list)this.onRemove(this.list[t]);return this.list={},this.order=[],this},MRUCache.prototype.add=function(t,e){if(this.list[t]=e,this.order.push(t),this.order.length>this.max){var i=this.get(this.order[0]);i&&this.onRemove(i)}return this},MRUCache.prototype.has=function(t){return t in this.list},MRUCache.prototype.keys=function(){return this.order},MRUCache.prototype.get=function(t){if(!this.has(t))return null;var e=this.list[t];return delete this.list[t],this.order.splice(this.order.indexOf(t),1),e};\n},{}],94:[function(require,module,exports){\n\"use strict\";function resolveTokens(e,n){return n.replace(/{([^{}()\\[\\]<>$=:;.,^]+)}/g,function(n,r){return r in e?e[r]:\"\"})}module.exports=resolveTokens;\n},{}],95:[function(require,module,exports){\n\"use strict\";var UnitBezier=require(\"unitbezier\"),Coordinate=require(\"../geo/coordinate\");exports.easeCubicInOut=function(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,r=t*n;return 4*(.5>n?r:3*(n-t)+r-.75)},exports.bezier=function(n,t,r,e){var o=new UnitBezier(n,t,r,e);return function(n){return o.solve(n)}},exports.ease=exports.bezier(.25,.1,.25,1),exports.premultiply=function(n){return n[0]*=n[3],n[1]*=n[3],n[2]*=n[3],n},exports.clamp=function(n,t,r){return Math.min(r,Math.max(t,n))},exports.wrap=function(n,t,r){var e=r-t,o=((n-t)%e+e)%e+t;return o===t?r:o},exports.coalesce=function(){for(var n=0;n<arguments.length;n++){var t=arguments[n];if(null!==t&&void 0!==t)return t}},exports.asyncAll=function(n,t,r){if(!n.length)return r(null,[]);var e=n.length,o=new Array(n.length),i=null;n.forEach(function(n,u){t(n,function(n,t){n&&(i=n),o[u]=t,0===--e&&r(i,o)})})},exports.keysDifference=function(n,t){var r=[];for(var e in n)e in t||r.push(e);return r},exports.extend=function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)n[e]=r[e]}return n},exports.extendAll=function(n,t){for(var r in t)Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r));return n},exports.inherit=function(n,t){var r=\"function\"==typeof n?n.prototype:n,e=Object.create(r);return exports.extendAll(e,t),e},exports.pick=function(n,t){for(var r={},e=0;e<t.length;e++){var o=t[e];o in n&&(r[o]=n[o])}return r};var id=1;exports.uniqueId=function(){return id++},exports.throttle=function(n,t,r){var e,o,i,u;return u=function(){e=!1,o&&(i.apply(r,o),o=!1)},i=function(){e?o=arguments:(n.apply(r,arguments),setTimeout(u,t),e=!0)}},exports.debounce=function(n,t){var r,e;return function(){e=arguments,clearTimeout(r),r=setTimeout(function(){n.apply(null,e)},t)}},exports.bindAll=function(n,t){n.forEach(function(n){t[n]=t[n].bind(t)})},exports.bindHandlers=function(n){for(var t in n)\"function\"==typeof n[t]&&0===t.indexOf(\"_on\")&&(n[t]=n[t].bind(n))},exports.setOptions=function(n,t){n.hasOwnProperty(\"options\")||(n.options=n.options?Object.create(n.options):{});for(var r in t)n.options[r]=t[r];return n.options},exports.getCoordinatesCenter=function(n){for(var t=1/0,r=1/0,e=-(1/0),o=-(1/0),i=0;i<n.length;i++)t=Math.min(t,n[i].column),r=Math.min(r,n[i].row),e=Math.max(e,n[i].column),o=Math.max(o,n[i].row);var u=e-t,a=o-r,s=Math.max(u,a);return new Coordinate((t+e)/2,(r+o)/2,0).zoomTo(Math.floor(-Math.log(s)/Math.LN2))};\n},{\"../geo/coordinate\":9,\"unitbezier\":132}],96:[function(require,module,exports){\nfunction clamp_css_byte(e){return e=Math.round(e),0>e?0:e>255?255:e}function clamp_css_float(e){return 0>e?0:e>1?1:e}function parse_css_int(e){return clamp_css_byte(\"%\"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function parse_css_float(e){return clamp_css_float(\"%\"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))}function css_hue_to_rgb(e,r,l){return 0>l?l+=1:l>1&&(l-=1),1>6*l?e+(r-e)*l*6:1>2*l?r:2>3*l?e+(r-e)*(2/3-l)*6:e}function parseCSSColor(e){var r=e.replace(/ /g,\"\").toLowerCase();if(r in kCSSColorTable)return kCSSColorTable[r].slice();if(\"#\"===r[0]){if(4===r.length){var l=parseInt(r.substr(1),16);return l>=0&&4095>=l?[(3840&l)>>4|(3840&l)>>8,240&l|(240&l)>>4,15&l|(15&l)<<4,1]:null}if(7===r.length){var l=parseInt(r.substr(1),16);return l>=0&&16777215>=l?[(16711680&l)>>16,(65280&l)>>8,255&l,1]:null}return null}var a=r.indexOf(\"(\"),t=r.indexOf(\")\");if(-1!==a&&t+1===r.length){var n=r.substr(0,a),s=r.substr(a+1,t-(a+1)).split(\",\"),o=1;switch(n){case\"rgba\":if(4!==s.length)return null;o=parse_css_float(s.pop());case\"rgb\":return 3!==s.length?null:[parse_css_int(s[0]),parse_css_int(s[1]),parse_css_int(s[2]),o];case\"hsla\":if(4!==s.length)return null;o=parse_css_float(s.pop());case\"hsl\":if(3!==s.length)return null;var i=(parseFloat(s[0])%360+360)%360/360,u=parse_css_float(s[1]),g=parse_css_float(s[2]),d=.5>=g?g*(u+1):g+u-g*u,c=2*g-d;return[clamp_css_byte(255*css_hue_to_rgb(c,d,i+1/3)),clamp_css_byte(255*css_hue_to_rgb(c,d,i)),clamp_css_byte(255*css_hue_to_rgb(c,d,i-1/3)),o];default:return null}}return null}var kCSSColorTable={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{exports.parseCSSColor=parseCSSColor}catch(e){}\n},{}],97:[function(require,module,exports){\n\"use strict\";function infix(t){return function(n,r,i){return\"$type\"===r?\"t\"+t+VectorTileFeatureTypes.indexOf(i):\"p[\"+JSON.stringify(r)+\"]\"+t+JSON.stringify(i)}}function strictInfix(t){var n=infix(t);return function(t,r,i){return\"$type\"===r?n(t,r,i):\"typeof(p[\"+JSON.stringify(r)+\"]) === typeof(\"+JSON.stringify(i)+\") && \"+n(t,r,i)}}function compile(t){return operators[t[0]].apply(t,t)}function truth(){return!0}var VectorTileFeatureTypes=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"],operators={\"==\":infix(\"===\"),\"!=\":infix(\"!==\"),\">\":strictInfix(\">\"),\"<\":strictInfix(\"<\"),\"<=\":strictInfix(\"<=\"),\">=\":strictInfix(\">=\"),\"in\":function(t,n){return Array.prototype.slice.call(arguments,2).map(function(r){return\"(\"+operators[\"==\"](t,n,r)+\")\"}).join(\"||\")||\"false\"},\"!in\":function(){return\"!(\"+operators[\"in\"].apply(this,arguments)+\")\"},any:function(){return Array.prototype.slice.call(arguments,1).map(function(t){return\"(\"+compile(t)+\")\"}).join(\"||\")||\"false\"},all:function(){return Array.prototype.slice.call(arguments,1).map(function(t){return\"(\"+compile(t)+\")\"}).join(\"&&\")||\"true\"},none:function(){return\"!(\"+operators.any.apply(this,arguments)+\")\"}};module.exports=function(t){if(!t)return truth;var n=\"var p = f.properties || f.tags || {}, t = f.type; return \"+compile(t)+\";\";return new Function(\"f\",n)};\n},{}],98:[function(require,module,exports){\n\"use strict\";function clip(e,n,t,r,l,u,i,s){if(t/=n,r/=n,i>=t&&r>=s)return e;if(i>r||t>s)return null;for(var p=[],h=0;h<e.length;h++){var c,a,o=e[h],f=o.geometry,g=o.type;if(c=o.min[l],a=o.max[l],c>=t&&r>=a)p.push(o);else if(!(c>r||t>a)){var m=1===g?clipPoints(f,t,r,l):clipGeometry(f,t,r,l,u,3===g);m.length&&p.push({geometry:m,type:g,tags:e[h].tags||null,min:o.min,max:o.max})}}return p.length?p:null}function clipPoints(e,n,t,r){for(var l=[],u=0;u<e.length;u++){var i=e[u],s=i[r];s>=n&&t>=s&&l.push(i)}return l}function clipGeometry(e,n,t,r,l,u){for(var i=[],s=0;s<e.length;s++){var p,h,c,a=0,o=0,f=null,g=e[s],m=g.area,v=g.dist,w=g.length,y=[];for(h=0;w-1>h;h++)p=f||g[h],f=g[h+1],a=o||p[r],o=f[r],n>a?o>t?(y.push(l(p,f,n),l(p,f,t)),u||(y=newSlice(i,y,m,v))):o>=n&&y.push(l(p,f,n)):a>t?n>o?(y.push(l(p,f,t),l(p,f,n)),u||(y=newSlice(i,y,m,v))):t>=o&&y.push(l(p,f,t)):(y.push(p),n>o?(y.push(l(p,f,n)),u||(y=newSlice(i,y,m,v))):o>t&&(y.push(l(p,f,t)),u||(y=newSlice(i,y,m,v))));p=g[w-1],a=p[r],a>=n&&t>=a&&y.push(p),c=y[y.length-1],u&&c&&(y[0][0]!==c[0]||y[0][1]!==c[1])&&y.push(y[0]),newSlice(i,y,m,v)}return i}function newSlice(e,n,t,r){return n.length&&(n.area=t,n.dist=r,e.push(n)),[]}module.exports=clip;\n},{}],99:[function(require,module,exports){\n\"use strict\";function convert(e,t){var r=[];if(\"FeatureCollection\"===e.type)for(var o=0;o<e.features.length;o++)convertFeature(r,e.features[o],t);else\"Feature\"===e.type?convertFeature(r,e,t):convertFeature(r,{geometry:e},t);return r}function convertFeature(e,t,r){var o,n,a,i=t.geometry,c=i.type,l=i.coordinates,u=t.properties;if(\"Point\"===c)e.push(create(u,1,[projectPoint(l)]));else if(\"MultiPoint\"===c)e.push(create(u,1,project(l)));else if(\"LineString\"===c)e.push(create(u,2,[project(l,r)]));else if(\"MultiLineString\"===c||\"Polygon\"===c){for(a=[],o=0;o<l.length;o++)a.push(project(l[o],r));e.push(create(u,\"Polygon\"===c?3:2,a))}else if(\"MultiPolygon\"===c){for(a=[],o=0;o<l.length;o++)for(n=0;n<l[o].length;n++)a.push(project(l[o][n],r));e.push(create(u,3,a))}else{if(\"GeometryCollection\"!==c)throw new Error(\"Input data is not a valid GeoJSON object.\");for(o=0;o<i.geometries.length;o++)convertFeature(e,{geometry:i.geometries[o],properties:u},r)}}function create(e,t,r){var o={geometry:r,type:t,tags:e||null,min:[2,1],max:[-1,0]};return calcBBox(o),o}function project(e,t){for(var r=[],o=0;o<e.length;o++)r.push(projectPoint(e[o]));return t&&(simplify(r,t),calcSize(r)),r}function projectPoint(e){var t=Math.sin(e[1]*Math.PI/180),r=e[0]/360+.5,o=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return o=-1>o?-1:o>1?1:o,[r,o,0]}function calcSize(e){for(var t,r,o=0,n=0,a=0;a<e.length-1;a++)t=r||e[a],r=e[a+1],o+=t[0]*r[1]-r[0]*t[1],n+=Math.abs(r[0]-t[0])+Math.abs(r[1]-t[1]);e.area=Math.abs(o/2),e.dist=n}function calcBBox(e){var t=e.geometry,r=e.min,o=e.max;if(1===e.type)calcRingBBox(r,o,t);else for(var n=0;n<t.length;n++)calcRingBBox(r,o,t[n]);return e}function calcRingBBox(e,t,r){for(var o,n=0;n<r.length;n++)o=r[n],e[0]=Math.min(o[0],e[0]),t[0]=Math.max(o[0],t[0]),e[1]=Math.min(o[1],e[1]),t[1]=Math.max(o[1],t[1])}module.exports=convert;var simplify=require(\"./simplify\");\n},{\"./simplify\":101}],100:[function(require,module,exports){\n\"use strict\";function geojsonvt(e,t){return new GeoJSONVT(e,t)}function GeoJSONVT(e,t){t=this.options=extend(Object.create(this.options),t);var i=t.debug;i&&console.time(\"preprocess data\");var o=1<<t.maxZoom,n=convert(e,t.tolerance/(o*t.extent));this.tiles={},this.tileCoords=[],i&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",t.indexMaxZoom,t.indexMaxPoints),console.time(\"generate tiles\"),this.stats={},this.total=0),n=wrap(n,t.buffer/t.extent,intersectX),n.length&&this.splitTile(n,0,0,0),i&&(n.length&&console.log(\"features: %d, points: %d\",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd(\"generate tiles\"),console.log(\"tiles generated:\",this.total,JSON.stringify(this.stats)))}function toID(e,t,i){return 32*((1<<e)*i+t)+e}function intersectX(e,t,i){return[i,(i-e[0])*(t[1]-e[1])/(t[0]-e[0])+e[1],1]}function intersectY(e,t,i){return[(i-e[1])*(t[0]-e[0])/(t[1]-e[1])+e[0],i,1]}function extend(e,t){for(var i in t)e[i]=t[i];return e}function isClippedSquare(e,t,i){var o=e.source;if(1!==o.length)return!1;var n=o[0];if(3!==n.type||n.geometry.length>1)return!1;var r=n.geometry[0].length;if(5!==r)return!1;for(var s=0;r>s;s++){var l=transform.point(n.geometry[0][s],t,e.z2,e.x,e.y);if(l[0]!==-i&&l[0]!==t+i||l[1]!==-i&&l[1]!==t+i)return!1}return!0}module.exports=geojsonvt;var convert=require(\"./convert\"),transform=require(\"./transform\"),clip=require(\"./clip\"),wrap=require(\"./wrap\"),createTile=require(\"./tile\");GeoJSONVT.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},GeoJSONVT.prototype.splitTile=function(e,t,i,o,n,r,s){for(var l=[e,t,i,o],a=this.options,u=a.debug,c=null;l.length;){o=l.pop(),i=l.pop(),t=l.pop(),e=l.pop();var p=1<<t,d=toID(t,i,o),m=this.tiles[d],f=t===a.maxZoom?0:a.tolerance/(p*a.extent);if(!m&&(u>1&&console.time(\"creation\"),m=this.tiles[d]=createTile(e,p,i,o,f,t===a.maxZoom),this.tileCoords.push({z:t,x:i,y:o}),u)){u>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",t,i,o,m.numFeatures,m.numPoints,m.numSimplified),console.timeEnd(\"creation\"));var h=\"z\"+t;this.stats[h]=(this.stats[h]||0)+1,this.total++}if(m.source=e,n){if(t===a.maxZoom||t===n)continue;var x=1<<n-t;if(i!==Math.floor(r/x)||o!==Math.floor(s/x))continue}else if(t===a.indexMaxZoom||m.numPoints<=a.indexMaxPoints)continue;if(a.solidChildren||!isClippedSquare(m,a.extent,a.buffer)){m.source=null,u>1&&console.time(\"clipping\");var g,v,M,T,b,y,S=.5*a.buffer/a.extent,Z=.5-S,q=.5+S,w=1+S;g=v=M=T=null,b=clip(e,p,i-S,i+q,0,intersectX,m.min[0],m.max[0]),y=clip(e,p,i+Z,i+w,0,intersectX,m.min[0],m.max[0]),b&&(g=clip(b,p,o-S,o+q,1,intersectY,m.min[1],m.max[1]),v=clip(b,p,o+Z,o+w,1,intersectY,m.min[1],m.max[1])),y&&(M=clip(y,p,o-S,o+q,1,intersectY,m.min[1],m.max[1]),T=clip(y,p,o+Z,o+w,1,intersectY,m.min[1],m.max[1])),u>1&&console.timeEnd(\"clipping\"),g&&l.push(g,t+1,2*i,2*o),v&&l.push(v,t+1,2*i,2*o+1),M&&l.push(M,t+1,2*i+1,2*o),T&&l.push(T,t+1,2*i+1,2*o+1)}else n&&(c=t)}return c},GeoJSONVT.prototype.getTile=function(e,t,i){var o=this.options,n=o.extent,r=o.debug,s=1<<e;t=(t%s+s)%s;var l=toID(e,t,i);if(this.tiles[l])return transform.tile(this.tiles[l],n);r>1&&console.log(\"drilling down to z%d-%d-%d\",e,t,i);for(var a,u=e,c=t,p=i;!a&&u>0;)u--,c=Math.floor(c/2),p=Math.floor(p/2),a=this.tiles[toID(u,c,p)];if(!a||!a.source)return null;if(r>1&&console.log(\"found parent tile z%d-%d-%d\",u,c,p),isClippedSquare(a,n,o.buffer))return transform.tile(a,n);r>1&&console.time(\"drilling down\");var d=this.splitTile(a.source,u,c,p,e,t,i);if(r>1&&console.timeEnd(\"drilling down\"),null!==d){var m=1<<e-d;l=toID(d,Math.floor(t/m),Math.floor(i/m))}return this.tiles[l]?transform.tile(this.tiles[l],n):null};\n},{\"./clip\":98,\"./convert\":99,\"./tile\":102,\"./transform\":103,\"./wrap\":104}],101:[function(require,module,exports){\n\"use strict\";function simplify(t,i){var e,p,r,s,o=i*i,f=t.length,u=0,n=f-1,g=[];for(t[u][2]=1,t[n][2]=1;n;){for(p=0,e=u+1;n>e;e++)r=getSqSegDist(t[e],t[u],t[n]),r>p&&(s=e,p=r);p>o?(t[s][2]=p,g.push(u),g.push(s),u=s):(n=g.pop(),u=g.pop())}}function getSqSegDist(t,i,e){var p=i[0],r=i[1],s=e[0],o=e[1],f=t[0],u=t[1],n=s-p,g=o-r;if(0!==n||0!==g){var l=((f-p)*n+(u-r)*g)/(n*n+g*g);l>1?(p=s,r=o):l>0&&(p+=n*l,r+=g*l)}return n=f-p,g=u-r,n*n+g*g}module.exports=simplify;\n},{}],102:[function(require,module,exports){\n\"use strict\";function createTile(e,n,t,m,i,u){for(var r={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:t,y:m,z2:n,transformed:!1,min:[2,1],max:[-1,0]},a=0;a<e.length;a++){r.numFeatures++,addFeature(r,e[a],i,u);var s=e[a].min,l=e[a].max;s[0]<r.min[0]&&(r.min[0]=s[0]),s[1]<r.min[1]&&(r.min[1]=s[1]),l[0]>r.max[0]&&(r.max[0]=l[0]),l[1]>r.max[1]&&(r.max[1]=l[1])}return r}function addFeature(e,n,t,m){var i,u,r,a,s=n.geometry,l=n.type,o=[],f=t*t;if(1===l)for(i=0;i<s.length;i++)o.push(s[i]),e.numPoints++,e.numSimplified++;else for(i=0;i<s.length;i++)if(r=s[i],m||!(2===l&&r.dist<t||3===l&&r.area<f)){var d=[];for(u=0;u<r.length;u++)a=r[u],(m||a[2]>f)&&(d.push(a),e.numSimplified++),e.numPoints++;o.push(d)}else e.numPoints+=r.length;o.length&&e.features.push({geometry:o,type:l,tags:n.tags||null})}module.exports=createTile;\n},{}],103:[function(require,module,exports){\n\"use strict\";function transformTile(r,t){if(r.transformed)return r;var n,e,o,f=r.z2,a=r.x,s=r.y;for(n=0;n<r.features.length;n++){var i=r.features[n],u=i.geometry,m=i.type;if(1===m)for(e=0;e<u.length;e++)u[e]=transformPoint(u[e],t,f,a,s);else for(e=0;e<u.length;e++){var l=u[e];for(o=0;o<l.length;o++)l[o]=transformPoint(l[o],t,f,a,s)}}return r.transformed=!0,r}function transformPoint(r,t,n,e,o){var f=Math.round(t*(r[0]*n-e)),a=Math.round(t*(r[1]*n-o));return[f,a]}exports.tile=transformTile,exports.point=transformPoint;\n},{}],104:[function(require,module,exports){\n\"use strict\";function wrap(r,t,e){var o=r,a=clip(r,1,-1-t,t,0,e,-1,2),s=clip(r,1,1-t,2+t,0,e,-1,2);return(a||s)&&(o=clip(r,1,-t,1+t,0,e,-1,2),a&&(o=shiftFeatureCoords(a,1).concat(o)),s&&(o=o.concat(shiftFeatureCoords(s,-1)))),o}function shiftFeatureCoords(r,t){for(var e=[],o=0;o<r.length;o++){var a,s=r[o],i=s.type;if(1===i)a=shiftCoords(s.geometry,t);else{a=[];for(var n=0;n<s.geometry.length;n++)a.push(shiftCoords(s.geometry[n],t))}e.push({geometry:a,type:i,tags:s.tags,min:[s.min[0]+t,s.min[1]],max:[s.max[0]+t,s.max[1]]})}return e}function shiftCoords(r,t){var e=[];e.area=r.area,e.dist=r.dist;for(var o=0;o<r.length;o++)e.push([r[o][0]+t,r[o][1],r[o][2]]);return e}var clip=require(\"./clip\");module.exports=wrap;\n},{\"./clip\":98}],105:[function(require,module,exports){\nexports.glMatrix=require(\"./gl-matrix/common.js\"),exports.mat2=require(\"./gl-matrix/mat2.js\"),exports.mat2d=require(\"./gl-matrix/mat2d.js\"),exports.mat3=require(\"./gl-matrix/mat3.js\"),exports.mat4=require(\"./gl-matrix/mat4.js\"),exports.quat=require(\"./gl-matrix/quat.js\"),exports.vec2=require(\"./gl-matrix/vec2.js\"),exports.vec3=require(\"./gl-matrix/vec3.js\"),exports.vec4=require(\"./gl-matrix/vec4.js\");\n},{\"./gl-matrix/common.js\":106,\"./gl-matrix/mat2.js\":107,\"./gl-matrix/mat2d.js\":108,\"./gl-matrix/mat3.js\":109,\"./gl-matrix/mat4.js\":110,\"./gl-matrix/quat.js\":111,\"./gl-matrix/vec2.js\":112,\"./gl-matrix/vec3.js\":113,\"./gl-matrix/vec4.js\":114}],106:[function(require,module,exports){\nvar glMatrix={};glMatrix.EPSILON=1e-6,glMatrix.ARRAY_TYPE=\"undefined\"!=typeof Float32Array?Float32Array:Array,glMatrix.RANDOM=Math.random,glMatrix.setMatrixArrayType=function(r){GLMAT_ARRAY_TYPE=r};var degree=Math.PI/180;glMatrix.toRadian=function(r){return r*degree},module.exports=glMatrix;\n},{}],107:[function(require,module,exports){\nvar glMatrix=require(\"./common.js\"),mat2={};mat2.create=function(){var t=new glMatrix.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},mat2.clone=function(t){var n=new glMatrix.ARRAY_TYPE(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},mat2.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},mat2.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},mat2.transpose=function(t,n){if(t===n){var r=n[1];t[1]=n[2],t[2]=r}else t[0]=n[0],t[1]=n[2],t[2]=n[1],t[3]=n[3];return t},mat2.invert=function(t,n){var r=n[0],a=n[1],u=n[2],o=n[3],e=r*o-u*a;return e?(e=1/e,t[0]=o*e,t[1]=-a*e,t[2]=-u*e,t[3]=r*e,t):null},mat2.adjoint=function(t,n){var r=n[0];return t[0]=n[3],t[1]=-n[1],t[2]=-n[2],t[3]=r,t},mat2.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},mat2.multiply=function(t,n,r){var a=n[0],u=n[1],o=n[2],e=n[3],i=r[0],m=r[1],c=r[2],f=r[3];return t[0]=a*i+o*m,t[1]=u*i+e*m,t[2]=a*c+o*f,t[3]=u*c+e*f,t},mat2.mul=mat2.multiply,mat2.rotate=function(t,n,r){var a=n[0],u=n[1],o=n[2],e=n[3],i=Math.sin(r),m=Math.cos(r);return t[0]=a*m+o*i,t[1]=u*m+e*i,t[2]=a*-i+o*m,t[3]=u*-i+e*m,t},mat2.scale=function(t,n,r){var a=n[0],u=n[1],o=n[2],e=n[3],i=r[0],m=r[1];return t[0]=a*i,t[1]=u*i,t[2]=o*m,t[3]=e*m,t},mat2.fromRotation=function(t,n){var r=Math.sin(n),a=Math.cos(n);return t[0]=a,t[1]=r,t[2]=-r,t[3]=a,t},mat2.fromScaling=function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t},mat2.str=function(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"},mat2.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},mat2.LDU=function(t,n,r,a){return t[2]=a[2]/a[0],r[0]=a[0],r[1]=a[1],r[3]=a[3]-t[2]*r[1],[t,n,r]},module.exports=mat2;\n},{\"./common.js\":106}],108:[function(require,module,exports){\nvar glMatrix=require(\"./common.js\"),mat2d={};mat2d.create=function(){var t=new glMatrix.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},mat2d.clone=function(t){var n=new glMatrix.ARRAY_TYPE(6);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n},mat2d.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t},mat2d.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},mat2d.invert=function(t,n){var r=n[0],a=n[1],o=n[2],u=n[3],e=n[4],i=n[5],m=r*u-a*o;return m?(m=1/m,t[0]=u*m,t[1]=-a*m,t[2]=-o*m,t[3]=r*m,t[4]=(o*i-u*e)*m,t[5]=(a*e-r*i)*m,t):null},mat2d.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},mat2d.multiply=function(t,n,r){var a=n[0],o=n[1],u=n[2],e=n[3],i=n[4],m=n[5],c=r[0],d=r[1],f=r[2],l=r[3],M=r[4],h=r[5];return t[0]=a*c+u*d,t[1]=o*c+e*d,t[2]=a*f+u*l,t[3]=o*f+e*l,t[4]=a*M+u*h+i,t[5]=o*M+e*h+m,t},mat2d.mul=mat2d.multiply,mat2d.rotate=function(t,n,r){var a=n[0],o=n[1],u=n[2],e=n[3],i=n[4],m=n[5],c=Math.sin(r),d=Math.cos(r);return t[0]=a*d+u*c,t[1]=o*d+e*c,t[2]=a*-c+u*d,t[3]=o*-c+e*d,t[4]=i,t[5]=m,t},mat2d.scale=function(t,n,r){var a=n[0],o=n[1],u=n[2],e=n[3],i=n[4],m=n[5],c=r[0],d=r[1];return t[0]=a*c,t[1]=o*c,t[2]=u*d,t[3]=e*d,t[4]=i,t[5]=m,t},mat2d.translate=function(t,n,r){var a=n[0],o=n[1],u=n[2],e=n[3],i=n[4],m=n[5],c=r[0],d=r[1];return t[0]=a,t[1]=o,t[2]=u,t[3]=e,t[4]=a*c+u*d+i,t[5]=o*c+e*d+m,t},mat2d.fromRotation=function(t,n){var r=Math.sin(n),a=Math.cos(n);return t[0]=a,t[1]=r,t[2]=-r,t[3]=a,t[4]=0,t[5]=0,t},mat2d.fromScaling=function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t[4]=0,t[5]=0,t},mat2d.fromTranslation=function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=n[0],t[5]=n[1],t},mat2d.str=function(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"},mat2d.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},module.exports=mat2d;\n},{\"./common.js\":106}],109:[function(require,module,exports){\nvar glMatrix=require(\"./common.js\"),mat3={};mat3.create=function(){var t=new glMatrix.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},mat3.fromMat4=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t},mat3.clone=function(t){var n=new glMatrix.ARRAY_TYPE(9);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n},mat3.copy=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},mat3.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},mat3.transpose=function(t,n){if(t===n){var r=n[1],a=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=r,t[5]=n[7],t[6]=a,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t},mat3.invert=function(t,n){var r=n[0],a=n[1],o=n[2],u=n[3],m=n[4],e=n[5],i=n[6],c=n[7],f=n[8],l=f*m-e*c,M=-f*u+e*i,v=c*u-m*i,h=r*l+a*M+o*v;return h?(h=1/h,t[0]=l*h,t[1]=(-f*a+o*c)*h,t[2]=(e*a-o*m)*h,t[3]=M*h,t[4]=(f*r-o*i)*h,t[5]=(-e*r+o*u)*h,t[6]=v*h,t[7]=(-c*r+a*i)*h,t[8]=(m*r-a*u)*h,t):null},mat3.adjoint=function(t,n){var r=n[0],a=n[1],o=n[2],u=n[3],m=n[4],e=n[5],i=n[6],c=n[7],f=n[8];return t[0]=m*f-e*c,t[1]=o*c-a*f,t[2]=a*e-o*m,t[3]=e*i-u*f,t[4]=r*f-o*i,t[5]=o*u-r*e,t[6]=u*c-m*i,t[7]=a*i-r*c,t[8]=r*m-a*u,t},mat3.determinant=function(t){var n=t[0],r=t[1],a=t[2],o=t[3],u=t[4],m=t[5],e=t[6],i=t[7],c=t[8];return n*(c*u-m*i)+r*(-c*o+m*e)+a*(i*o-u*e)},mat3.multiply=function(t,n,r){var a=n[0],o=n[1],u=n[2],m=n[3],e=n[4],i=n[5],c=n[6],f=n[7],l=n[8],M=r[0],v=r[1],h=r[2],p=r[3],s=r[4],w=r[5],d=r[6],R=r[7],g=r[8];return t[0]=M*a+v*m+h*c,t[1]=M*o+v*e+h*f,t[2]=M*u+v*i+h*l,t[3]=p*a+s*m+w*c,t[4]=p*o+s*e+w*f,t[5]=p*u+s*i+w*l,t[6]=d*a+R*m+g*c,t[7]=d*o+R*e+g*f,t[8]=d*u+R*i+g*l,t},mat3.mul=mat3.multiply,mat3.translate=function(t,n,r){var a=n[0],o=n[1],u=n[2],m=n[3],e=n[4],i=n[5],c=n[6],f=n[7],l=n[8],M=r[0],v=r[1];return t[0]=a,t[1]=o,t[2]=u,t[3]=m,t[4]=e,t[5]=i,t[6]=M*a+v*m+c,t[7]=M*o+v*e+f,t[8]=M*u+v*i+l,t},mat3.rotate=function(t,n,r){var a=n[0],o=n[1],u=n[2],m=n[3],e=n[4],i=n[5],c=n[6],f=n[7],l=n[8],M=Math.sin(r),v=Math.cos(r);return t[0]=v*a+M*m,t[1]=v*o+M*e,t[2]=v*u+M*i,t[3]=v*m-M*a,t[4]=v*e-M*o,t[5]=v*i-M*u,t[6]=c,t[7]=f,t[8]=l,t},mat3.scale=function(t,n,r){var a=r[0],o=r[1];return t[0]=a*n[0],t[1]=a*n[1],t[2]=a*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},mat3.fromTranslation=function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},mat3.fromRotation=function(t,n){var r=Math.sin(n),a=Math.cos(n);return t[0]=a,t[1]=r,t[2]=0,t[3]=-r,t[4]=a,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},mat3.fromScaling=function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},mat3.fromMat2d=function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},mat3.fromQuat=function(t,n){var r=n[0],a=n[1],o=n[2],u=n[3],m=r+r,e=a+a,i=o+o,c=r*m,f=a*m,l=a*e,M=o*m,v=o*e,h=o*i,p=u*m,s=u*e,w=u*i;return t[0]=1-l-h,t[3]=f-w,t[6]=M+s,t[1]=f+w,t[4]=1-c-h,t[7]=v-p,t[2]=M-s,t[5]=v+p,t[8]=1-c-l,t},mat3.normalFromMat4=function(t,n){var r=n[0],a=n[1],o=n[2],u=n[3],m=n[4],e=n[5],i=n[6],c=n[7],f=n[8],l=n[9],M=n[10],v=n[11],h=n[12],p=n[13],s=n[14],w=n[15],d=r*e-a*m,R=r*i-o*m,g=r*c-u*m,x=a*i-o*e,y=a*c-u*e,A=o*c-u*i,Y=f*p-l*h,T=f*s-M*h,j=f*w-v*h,q=l*s-M*p,E=l*w-v*p,P=M*w-v*s,_=d*P-R*E+g*q+x*j-y*T+A*Y;return _?(_=1/_,t[0]=(e*P-i*E+c*q)*_,t[1]=(i*j-m*P-c*T)*_,t[2]=(m*E-e*j+c*Y)*_,t[3]=(o*E-a*P-u*q)*_,t[4]=(r*P-o*j+u*T)*_,t[5]=(a*j-r*E-u*Y)*_,t[6]=(p*A-s*y+w*x)*_,t[7]=(s*g-h*A-w*R)*_,t[8]=(h*y-p*g+w*d)*_,t):null},mat3.str=function(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"},mat3.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},module.exports=mat3;\n},{\"./common.js\":106}],110:[function(require,module,exports){\nvar glMatrix=require(\"./common.js\"),mat4={};mat4.create=function(){var t=new glMatrix.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4.clone=function(t){var a=new glMatrix.ARRAY_TYPE(16);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a[4]=t[4],a[5]=t[5],a[6]=t[6],a[7]=t[7],a[8]=t[8],a[9]=t[9],a[10]=t[10],a[11]=t[11],a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15],a},mat4.copy=function(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t},mat4.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4.transpose=function(t,a){if(t===a){var r=a[1],n=a[2],o=a[3],e=a[6],i=a[7],u=a[11];t[1]=a[4],t[2]=a[8],t[3]=a[12],t[4]=r,t[6]=a[9],t[7]=a[13],t[8]=n,t[9]=e,t[11]=a[14],t[12]=o,t[13]=i,t[14]=u}else t[0]=a[0],t[1]=a[4],t[2]=a[8],t[3]=a[12],t[4]=a[1],t[5]=a[5],t[6]=a[9],t[7]=a[13],t[8]=a[2],t[9]=a[6],t[10]=a[10],t[11]=a[14],t[12]=a[3],t[13]=a[7],t[14]=a[11],t[15]=a[15];return t},mat4.invert=function(t,a){var r=a[0],n=a[1],o=a[2],e=a[3],i=a[4],u=a[5],M=a[6],m=a[7],h=a[8],c=a[9],f=a[10],s=a[11],l=a[12],v=a[13],p=a[14],w=a[15],g=r*u-n*i,P=r*M-o*i,R=r*m-e*i,x=n*M-o*u,I=n*m-e*u,S=o*m-e*M,d=h*v-c*l,q=h*p-f*l,E=h*w-s*l,O=c*p-f*v,b=c*w-s*v,T=f*w-s*p,Y=g*T-P*b+R*O+x*E-I*q+S*d;return Y?(Y=1/Y,t[0]=(u*T-M*b+m*O)*Y,t[1]=(o*b-n*T-e*O)*Y,t[2]=(v*S-p*I+w*x)*Y,t[3]=(f*I-c*S-s*x)*Y,t[4]=(M*E-i*T-m*q)*Y,t[5]=(r*T-o*E+e*q)*Y,t[6]=(p*R-l*S-w*P)*Y,t[7]=(h*S-f*R+s*P)*Y,t[8]=(i*b-u*E+m*d)*Y,t[9]=(n*E-r*b-e*d)*Y,t[10]=(l*I-v*R+w*g)*Y,t[11]=(c*R-h*I-s*g)*Y,t[12]=(u*q-i*O-M*d)*Y,t[13]=(r*O-n*q+o*d)*Y,t[14]=(v*P-l*x-p*g)*Y,t[15]=(h*x-c*P+f*g)*Y,t):null},mat4.adjoint=function(t,a){var r=a[0],n=a[1],o=a[2],e=a[3],i=a[4],u=a[5],M=a[6],m=a[7],h=a[8],c=a[9],f=a[10],s=a[11],l=a[12],v=a[13],p=a[14],w=a[15];return t[0]=u*(f*w-s*p)-c*(M*w-m*p)+v*(M*s-m*f),t[1]=-(n*(f*w-s*p)-c*(o*w-e*p)+v*(o*s-e*f)),t[2]=n*(M*w-m*p)-u*(o*w-e*p)+v*(o*m-e*M),t[3]=-(n*(M*s-m*f)-u*(o*s-e*f)+c*(o*m-e*M)),t[4]=-(i*(f*w-s*p)-h*(M*w-m*p)+l*(M*s-m*f)),t[5]=r*(f*w-s*p)-h*(o*w-e*p)+l*(o*s-e*f),t[6]=-(r*(M*w-m*p)-i*(o*w-e*p)+l*(o*m-e*M)),t[7]=r*(M*s-m*f)-i*(o*s-e*f)+h*(o*m-e*M),t[8]=i*(c*w-s*v)-h*(u*w-m*v)+l*(u*s-m*c),t[9]=-(r*(c*w-s*v)-h*(n*w-e*v)+l*(n*s-e*c)),t[10]=r*(u*w-m*v)-i*(n*w-e*v)+l*(n*m-e*u),t[11]=-(r*(u*s-m*c)-i*(n*s-e*c)+h*(n*m-e*u)),t[12]=-(i*(c*p-f*v)-h*(u*p-M*v)+l*(u*f-M*c)),t[13]=r*(c*p-f*v)-h*(n*p-o*v)+l*(n*f-o*c),t[14]=-(r*(u*p-M*v)-i*(n*p-o*v)+l*(n*M-o*u)),t[15]=r*(u*f-M*c)-i*(n*f-o*c)+h*(n*M-o*u),t},mat4.determinant=function(t){var a=t[0],r=t[1],n=t[2],o=t[3],e=t[4],i=t[5],u=t[6],M=t[7],m=t[8],h=t[9],c=t[10],f=t[11],s=t[12],l=t[13],v=t[14],p=t[15],w=a*i-r*e,g=a*u-n*e,P=a*M-o*e,R=r*u-n*i,x=r*M-o*i,I=n*M-o*u,S=m*l-h*s,d=m*v-c*s,q=m*p-f*s,E=h*v-c*l,O=h*p-f*l,b=c*p-f*v;return w*b-g*O+P*E+R*q-x*d+I*S},mat4.multiply=function(t,a,r){var n=a[0],o=a[1],e=a[2],i=a[3],u=a[4],M=a[5],m=a[6],h=a[7],c=a[8],f=a[9],s=a[10],l=a[11],v=a[12],p=a[13],w=a[14],g=a[15],P=r[0],R=r[1],x=r[2],I=r[3];return t[0]=P*n+R*u+x*c+I*v,t[1]=P*o+R*M+x*f+I*p,t[2]=P*e+R*m+x*s+I*w,t[3]=P*i+R*h+x*l+I*g,P=r[4],R=r[5],x=r[6],I=r[7],t[4]=P*n+R*u+x*c+I*v,t[5]=P*o+R*M+x*f+I*p,t[6]=P*e+R*m+x*s+I*w,t[7]=P*i+R*h+x*l+I*g,P=r[8],R=r[9],x=r[10],I=r[11],t[8]=P*n+R*u+x*c+I*v,t[9]=P*o+R*M+x*f+I*p,t[10]=P*e+R*m+x*s+I*w,t[11]=P*i+R*h+x*l+I*g,P=r[12],R=r[13],x=r[14],I=r[15],t[12]=P*n+R*u+x*c+I*v,t[13]=P*o+R*M+x*f+I*p,t[14]=P*e+R*m+x*s+I*w,t[15]=P*i+R*h+x*l+I*g,t},mat4.mul=mat4.multiply,mat4.translate=function(t,a,r){var n,o,e,i,u,M,m,h,c,f,s,l,v=r[0],p=r[1],w=r[2];return a===t?(t[12]=a[0]*v+a[4]*p+a[8]*w+a[12],t[13]=a[1]*v+a[5]*p+a[9]*w+a[13],t[14]=a[2]*v+a[6]*p+a[10]*w+a[14],t[15]=a[3]*v+a[7]*p+a[11]*w+a[15]):(n=a[0],o=a[1],e=a[2],i=a[3],u=a[4],M=a[5],m=a[6],h=a[7],c=a[8],f=a[9],s=a[10],l=a[11],t[0]=n,t[1]=o,t[2]=e,t[3]=i,t[4]=u,t[5]=M,t[6]=m,t[7]=h,t[8]=c,t[9]=f,t[10]=s,t[11]=l,t[12]=n*v+u*p+c*w+a[12],t[13]=o*v+M*p+f*w+a[13],t[14]=e*v+m*p+s*w+a[14],t[15]=i*v+h*p+l*w+a[15]),t},mat4.scale=function(t,a,r){var n=r[0],o=r[1],e=r[2];return t[0]=a[0]*n,t[1]=a[1]*n,t[2]=a[2]*n,t[3]=a[3]*n,t[4]=a[4]*o,t[5]=a[5]*o,t[6]=a[6]*o,t[7]=a[7]*o,t[8]=a[8]*e,t[9]=a[9]*e,t[10]=a[10]*e,t[11]=a[11]*e,t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t},mat4.rotate=function(t,a,r,n){var o,e,i,u,M,m,h,c,f,s,l,v,p,w,g,P,R,x,I,S,d,q,E,O,b=n[0],T=n[1],Y=n[2],y=Math.sqrt(b*b+T*T+Y*Y);return Math.abs(y)<glMatrix.EPSILON?null:(y=1/y,b*=y,T*=y,Y*=y,o=Math.sin(r),e=Math.cos(r),i=1-e,u=a[0],M=a[1],m=a[2],h=a[3],c=a[4],f=a[5],s=a[6],l=a[7],v=a[8],p=a[9],w=a[10],g=a[11],P=b*b*i+e,R=T*b*i+Y*o,x=Y*b*i-T*o,I=b*T*i-Y*o,S=T*T*i+e,d=Y*T*i+b*o,q=b*Y*i+T*o,E=T*Y*i-b*o,O=Y*Y*i+e,t[0]=u*P+c*R+v*x,t[1]=M*P+f*R+p*x,t[2]=m*P+s*R+w*x,t[3]=h*P+l*R+g*x,t[4]=u*I+c*S+v*d,t[5]=M*I+f*S+p*d,t[6]=m*I+s*S+w*d,t[7]=h*I+l*S+g*d,t[8]=u*q+c*E+v*O,t[9]=M*q+f*E+p*O,t[10]=m*q+s*E+w*O,t[11]=h*q+l*E+g*O,a!==t&&(t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t)},mat4.rotateX=function(t,a,r){var n=Math.sin(r),o=Math.cos(r),e=a[4],i=a[5],u=a[6],M=a[7],m=a[8],h=a[9],c=a[10],f=a[11];return a!==t&&(t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[4]=e*o+m*n,t[5]=i*o+h*n,t[6]=u*o+c*n,t[7]=M*o+f*n,t[8]=m*o-e*n,t[9]=h*o-i*n,t[10]=c*o-u*n,t[11]=f*o-M*n,t},mat4.rotateY=function(t,a,r){var n=Math.sin(r),o=Math.cos(r),e=a[0],i=a[1],u=a[2],M=a[3],m=a[8],h=a[9],c=a[10],f=a[11];return a!==t&&(t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[0]=e*o-m*n,t[1]=i*o-h*n,t[2]=u*o-c*n,t[3]=M*o-f*n,t[8]=e*n+m*o,t[9]=i*n+h*o,t[10]=u*n+c*o,t[11]=M*n+f*o,t},mat4.rotateZ=function(t,a,r){var n=Math.sin(r),o=Math.cos(r),e=a[0],i=a[1],u=a[2],M=a[3],m=a[4],h=a[5],c=a[6],f=a[7];return a!==t&&(t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[0]=e*o+m*n,t[1]=i*o+h*n,t[2]=u*o+c*n,t[3]=M*o+f*n,t[4]=m*o-e*n,t[5]=h*o-i*n,t[6]=c*o-u*n,t[7]=f*o-M*n,t},mat4.fromTranslation=function(t,a){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t},mat4.fromScaling=function(t,a){return t[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=a[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4.fromRotation=function(t,a,r){var n,o,e,i=r[0],u=r[1],M=r[2],m=Math.sqrt(i*i+u*u+M*M);return Math.abs(m)<glMatrix.EPSILON?null:(m=1/m,i*=m,u*=m,M*=m,n=Math.sin(a),o=Math.cos(a),e=1-o,t[0]=i*i*e+o,t[1]=u*i*e+M*n,t[2]=M*i*e-u*n,t[3]=0,t[4]=i*u*e-M*n,t[5]=u*u*e+o,t[6]=M*u*e+i*n,t[7]=0,t[8]=i*M*e+u*n,t[9]=u*M*e-i*n,t[10]=M*M*e+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},mat4.fromXRotation=function(t,a){var r=Math.sin(a),n=Math.cos(a);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4.fromYRotation=function(t,a){var r=Math.sin(a),n=Math.cos(a);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4.fromZRotation=function(t,a){var r=Math.sin(a),n=Math.cos(a);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4.fromRotationTranslation=function(t,a,r){var n=a[0],o=a[1],e=a[2],i=a[3],u=n+n,M=o+o,m=e+e,h=n*u,c=n*M,f=n*m,s=o*M,l=o*m,v=e*m,p=i*u,w=i*M,g=i*m;return t[0]=1-(s+v),t[1]=c+g,t[2]=f-w,t[3]=0,t[4]=c-g,t[5]=1-(h+v),t[6]=l+p,t[7]=0,t[8]=f+w,t[9]=l-p,t[10]=1-(h+s),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},mat4.fromRotationTranslationScale=function(t,a,r,n){var o=a[0],e=a[1],i=a[2],u=a[3],M=o+o,m=e+e,h=i+i,c=o*M,f=o*m,s=o*h,l=e*m,v=e*h,p=i*h,w=u*M,g=u*m,P=u*h,R=n[0],x=n[1],I=n[2];return t[0]=(1-(l+p))*R,t[1]=(f+P)*R,t[2]=(s-g)*R,t[3]=0,t[4]=(f-P)*x,t[5]=(1-(c+p))*x,t[6]=(v+w)*x,t[7]=0,t[8]=(s+g)*I,t[9]=(v-w)*I,t[10]=(1-(c+l))*I,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},mat4.fromRotationTranslationScaleOrigin=function(t,a,r,n,o){var e=a[0],i=a[1],u=a[2],M=a[3],m=e+e,h=i+i,c=u+u,f=e*m,s=e*h,l=e*c,v=i*h,p=i*c,w=u*c,g=M*m,P=M*h,R=M*c,x=n[0],I=n[1],S=n[2],d=o[0],q=o[1],E=o[2];return t[0]=(1-(v+w))*x,t[1]=(s+R)*x,t[2]=(l-P)*x,t[3]=0,t[4]=(s-R)*I,t[5]=(1-(f+w))*I,t[6]=(p+g)*I,t[7]=0,t[8]=(l+P)*S,t[9]=(p-g)*S,t[10]=(1-(f+v))*S,t[11]=0,t[12]=r[0]+d-(t[0]*d+t[4]*q+t[8]*E),t[13]=r[1]+q-(t[1]*d+t[5]*q+t[9]*E),t[14]=r[2]+E-(t[2]*d+t[6]*q+t[10]*E),t[15]=1,t},mat4.fromQuat=function(t,a){var r=a[0],n=a[1],o=a[2],e=a[3],i=r+r,u=n+n,M=o+o,m=r*i,h=n*i,c=n*u,f=o*i,s=o*u,l=o*M,v=e*i,p=e*u,w=e*M;return t[0]=1-c-l,t[1]=h+w,t[2]=f-p,t[3]=0,t[4]=h-w,t[5]=1-m-l,t[6]=s+v,t[7]=0,t[8]=f+p,t[9]=s-v,t[10]=1-m-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4.frustum=function(t,a,r,n,o,e,i){var u=1/(r-a),M=1/(o-n),m=1/(e-i);return t[0]=2*e*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*e*M,t[6]=0,t[7]=0,t[8]=(r+a)*u,t[9]=(o+n)*M,t[10]=(i+e)*m,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*e*2*m,t[15]=0,t},mat4.perspective=function(t,a,r,n,o){var e=1/Math.tan(a/2),i=1/(n-o);return t[0]=e/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(o+n)*i,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*o*n*i,t[15]=0,t},mat4.perspectiveFromFieldOfView=function(t,a,r,n){var o=Math.tan(a.upDegrees*Math.PI/180),e=Math.tan(a.downDegrees*Math.PI/180),i=Math.tan(a.leftDegrees*Math.PI/180),u=Math.tan(a.rightDegrees*Math.PI/180),M=2/(i+u),m=2/(o+e);return t[0]=M,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=m,t[6]=0,t[7]=0,t[8]=-((i-u)*M*.5),t[9]=(o-e)*m*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},mat4.ortho=function(t,a,r,n,o,e,i){var u=1/(a-r),M=1/(n-o),m=1/(e-i);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*M,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*m,t[11]=0,t[12]=(a+r)*u,t[13]=(o+n)*M,t[14]=(i+e)*m,t[15]=1,t},mat4.lookAt=function(t,a,r,n){var o,e,i,u,M,m,h,c,f,s,l=a[0],v=a[1],p=a[2],w=n[0],g=n[1],P=n[2],R=r[0],x=r[1],I=r[2];return Math.abs(l-R)<glMatrix.EPSILON&&Math.abs(v-x)<glMatrix.EPSILON&&Math.abs(p-I)<glMatrix.EPSILON?mat4.identity(t):(h=l-R,c=v-x,f=p-I,s=1/Math.sqrt(h*h+c*c+f*f),h*=s,c*=s,f*=s,o=g*f-P*c,e=P*h-w*f,i=w*c-g*h,s=Math.sqrt(o*o+e*e+i*i),s?(s=1/s,o*=s,e*=s,i*=s):(o=0,e=0,i=0),u=c*i-f*e,M=f*o-h*i,m=h*e-c*o,s=Math.sqrt(u*u+M*M+m*m),s?(s=1/s,u*=s,M*=s,m*=s):(u=0,M=0,m=0),t[0]=o,t[1]=u,t[2]=h,t[3]=0,t[4]=e,t[5]=M,t[6]=c,t[7]=0,t[8]=i,t[9]=m,t[10]=f,t[11]=0,t[12]=-(o*l+e*v+i*p),t[13]=-(u*l+M*v+m*p),t[14]=-(h*l+c*v+f*p),t[15]=1,t)},mat4.str=function(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"},mat4.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},module.exports=mat4;\n},{\"./common.js\":106}],111:[function(require,module,exports){\nvar glMatrix=require(\"./common.js\"),mat3=require(\"./mat3.js\"),vec3=require(\"./vec3.js\"),vec4=require(\"./vec4.js\"),quat={};quat.create=function(){var t=new glMatrix.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},quat.rotationTo=function(){var t=vec3.create(),a=vec3.fromValues(1,0,0),e=vec3.fromValues(0,1,0);return function(r,u,n){var c=vec3.dot(u,n);return-.999999>c?(vec3.cross(t,a,u),vec3.length(t)<1e-6&&vec3.cross(t,e,u),vec3.normalize(t,t),quat.setAxisAngle(r,t,Math.PI),r):c>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(vec3.cross(t,u,n),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+c,quat.normalize(r,r))}}(),quat.setAxes=function(){var t=mat3.create();return function(a,e,r,u){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=u[0],t[4]=u[1],t[7]=u[2],t[2]=-e[0],t[5]=-e[1],t[8]=-e[2],quat.normalize(a,quat.fromMat3(a,t))}}(),quat.clone=vec4.clone,quat.fromValues=vec4.fromValues,quat.copy=vec4.copy,quat.set=vec4.set,quat.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},quat.setAxisAngle=function(t,a,e){e=.5*e;var r=Math.sin(e);return t[0]=r*a[0],t[1]=r*a[1],t[2]=r*a[2],t[3]=Math.cos(e),t},quat.add=vec4.add,quat.multiply=function(t,a,e){var r=a[0],u=a[1],n=a[2],c=a[3],q=e[0],o=e[1],s=e[2],i=e[3];return t[0]=r*i+c*q+u*s-n*o,t[1]=u*i+c*o+n*q-r*s,t[2]=n*i+c*s+r*o-u*q,t[3]=c*i-r*q-u*o-n*s,t},quat.mul=quat.multiply,quat.scale=vec4.scale,quat.rotateX=function(t,a,e){e*=.5;var r=a[0],u=a[1],n=a[2],c=a[3],q=Math.sin(e),o=Math.cos(e);return t[0]=r*o+c*q,t[1]=u*o+n*q,t[2]=n*o-u*q,t[3]=c*o-r*q,t},quat.rotateY=function(t,a,e){e*=.5;var r=a[0],u=a[1],n=a[2],c=a[3],q=Math.sin(e),o=Math.cos(e);return t[0]=r*o-n*q,t[1]=u*o+c*q,t[2]=n*o+r*q,t[3]=c*o-u*q,t},quat.rotateZ=function(t,a,e){e*=.5;var r=a[0],u=a[1],n=a[2],c=a[3],q=Math.sin(e),o=Math.cos(e);return t[0]=r*o+u*q,t[1]=u*o-r*q,t[2]=n*o+c*q,t[3]=c*o-n*q,t},quat.calculateW=function(t,a){var e=a[0],r=a[1],u=a[2];return t[0]=e,t[1]=r,t[2]=u,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-u*u)),t},quat.dot=vec4.dot,quat.lerp=vec4.lerp,quat.slerp=function(t,a,e,r){var u,n,c,q,o,s=a[0],i=a[1],v=a[2],l=a[3],f=e[0],h=e[1],M=e[2],m=e[3];return n=s*f+i*h+v*M+l*m,0>n&&(n=-n,f=-f,h=-h,M=-M,m=-m),1-n>1e-6?(u=Math.acos(n),c=Math.sin(u),q=Math.sin((1-r)*u)/c,o=Math.sin(r*u)/c):(q=1-r,o=r),t[0]=q*s+o*f,t[1]=q*i+o*h,t[2]=q*v+o*M,t[3]=q*l+o*m,t},quat.sqlerp=function(){var t=quat.create(),a=quat.create();return function(e,r,u,n,c,q){return quat.slerp(t,r,c,q),quat.slerp(a,u,n,q),quat.slerp(e,t,a,2*q*(1-q)),e}}(),quat.invert=function(t,a){var e=a[0],r=a[1],u=a[2],n=a[3],c=e*e+r*r+u*u+n*n,q=c?1/c:0;return t[0]=-e*q,t[1]=-r*q,t[2]=-u*q,t[3]=n*q,t},quat.conjugate=function(t,a){return t[0]=-a[0],t[1]=-a[1],t[2]=-a[2],t[3]=a[3],t},quat.length=vec4.length,quat.len=quat.length,quat.squaredLength=vec4.squaredLength,quat.sqrLen=quat.squaredLength,quat.normalize=vec4.normalize,quat.fromMat3=function(t,a){var e,r=a[0]+a[4]+a[8];if(r>0)e=Math.sqrt(r+1),t[3]=.5*e,e=.5/e,t[0]=(a[5]-a[7])*e,t[1]=(a[6]-a[2])*e,t[2]=(a[1]-a[3])*e;else{var u=0;a[4]>a[0]&&(u=1),a[8]>a[3*u+u]&&(u=2);var n=(u+1)%3,c=(u+2)%3;e=Math.sqrt(a[3*u+u]-a[3*n+n]-a[3*c+c]+1),t[u]=.5*e,e=.5/e,t[3]=(a[3*n+c]-a[3*c+n])*e,t[n]=(a[3*n+u]+a[3*u+n])*e,t[c]=(a[3*c+u]+a[3*u+c])*e}return t},quat.str=function(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"},module.exports=quat;\n},{\"./common.js\":106,\"./mat3.js\":109,\"./vec3.js\":113,\"./vec4.js\":114}],112:[function(require,module,exports){\nvar glMatrix=require(\"./common.js\"),vec2={};vec2.create=function(){var n=new glMatrix.ARRAY_TYPE(2);return n[0]=0,n[1]=0,n},vec2.clone=function(n){var e=new glMatrix.ARRAY_TYPE(2);return e[0]=n[0],e[1]=n[1],e},vec2.fromValues=function(n,e){var r=new glMatrix.ARRAY_TYPE(2);return r[0]=n,r[1]=e,r},vec2.copy=function(n,e){return n[0]=e[0],n[1]=e[1],n},vec2.set=function(n,e,r){return n[0]=e,n[1]=r,n},vec2.add=function(n,e,r){return n[0]=e[0]+r[0],n[1]=e[1]+r[1],n},vec2.subtract=function(n,e,r){return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n},vec2.sub=vec2.subtract,vec2.multiply=function(n,e,r){return n[0]=e[0]*r[0],n[1]=e[1]*r[1],n},vec2.mul=vec2.multiply,vec2.divide=function(n,e,r){return n[0]=e[0]/r[0],n[1]=e[1]/r[1],n},vec2.div=vec2.divide,vec2.min=function(n,e,r){return n[0]=Math.min(e[0],r[0]),n[1]=Math.min(e[1],r[1]),n},vec2.max=function(n,e,r){return n[0]=Math.max(e[0],r[0]),n[1]=Math.max(e[1],r[1]),n},vec2.scale=function(n,e,r){return n[0]=e[0]*r,n[1]=e[1]*r,n},vec2.scaleAndAdd=function(n,e,r,t){return n[0]=e[0]+r[0]*t,n[1]=e[1]+r[1]*t,n},vec2.distance=function(n,e){var r=e[0]-n[0],t=e[1]-n[1];return Math.sqrt(r*r+t*t)},vec2.dist=vec2.distance,vec2.squaredDistance=function(n,e){var r=e[0]-n[0],t=e[1]-n[1];return r*r+t*t},vec2.sqrDist=vec2.squaredDistance,vec2.length=function(n){var e=n[0],r=n[1];return Math.sqrt(e*e+r*r)},vec2.len=vec2.length,vec2.squaredLength=function(n){var e=n[0],r=n[1];return e*e+r*r},vec2.sqrLen=vec2.squaredLength,vec2.negate=function(n,e){return n[0]=-e[0],n[1]=-e[1],n},vec2.inverse=function(n,e){return n[0]=1/e[0],n[1]=1/e[1],n},vec2.normalize=function(n,e){var r=e[0],t=e[1],c=r*r+t*t;return c>0&&(c=1/Math.sqrt(c),n[0]=e[0]*c,n[1]=e[1]*c),n},vec2.dot=function(n,e){return n[0]*e[0]+n[1]*e[1]},vec2.cross=function(n,e,r){var t=e[0]*r[1]-e[1]*r[0];return n[0]=n[1]=0,n[2]=t,n},vec2.lerp=function(n,e,r,t){var c=e[0],u=e[1];return n[0]=c+t*(r[0]-c),n[1]=u+t*(r[1]-u),n},vec2.random=function(n,e){e=e||1;var r=2*glMatrix.RANDOM()*Math.PI;return n[0]=Math.cos(r)*e,n[1]=Math.sin(r)*e,n},vec2.transformMat2=function(n,e,r){var t=e[0],c=e[1];return n[0]=r[0]*t+r[2]*c,n[1]=r[1]*t+r[3]*c,n},vec2.transformMat2d=function(n,e,r){var t=e[0],c=e[1];return n[0]=r[0]*t+r[2]*c+r[4],n[1]=r[1]*t+r[3]*c+r[5],n},vec2.transformMat3=function(n,e,r){var t=e[0],c=e[1];return n[0]=r[0]*t+r[3]*c+r[6],n[1]=r[1]*t+r[4]*c+r[7],n},vec2.transformMat4=function(n,e,r){var t=e[0],c=e[1];return n[0]=r[0]*t+r[4]*c+r[12],n[1]=r[1]*t+r[5]*c+r[13],n},vec2.forEach=function(){var n=vec2.create();return function(e,r,t,c,u,v){var a,i;for(r||(r=2),t||(t=0),i=c?Math.min(c*r+t,e.length):e.length,a=t;i>a;a+=r)n[0]=e[a],n[1]=e[a+1],u(n,n,v),e[a]=n[0],e[a+1]=n[1];return e}}(),vec2.str=function(n){return\"vec2(\"+n[0]+\", \"+n[1]+\")\"},module.exports=vec2;\n},{\"./common.js\":106}],113:[function(require,module,exports){\nvar glMatrix=require(\"./common.js\"),vec3={};vec3.create=function(){var n=new glMatrix.ARRAY_TYPE(3);return n[0]=0,n[1]=0,n[2]=0,n},vec3.clone=function(n){var t=new glMatrix.ARRAY_TYPE(3);return t[0]=n[0],t[1]=n[1],t[2]=n[2],t},vec3.fromValues=function(n,t,e){var r=new glMatrix.ARRAY_TYPE(3);return r[0]=n,r[1]=t,r[2]=e,r},vec3.copy=function(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n},vec3.set=function(n,t,e,r){return n[0]=t,n[1]=e,n[2]=r,n},vec3.add=function(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n},vec3.subtract=function(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n},vec3.sub=vec3.subtract,vec3.multiply=function(n,t,e){return n[0]=t[0]*e[0],n[1]=t[1]*e[1],n[2]=t[2]*e[2],n},vec3.mul=vec3.multiply,vec3.divide=function(n,t,e){return n[0]=t[0]/e[0],n[1]=t[1]/e[1],n[2]=t[2]/e[2],n},vec3.div=vec3.divide,vec3.min=function(n,t,e){return n[0]=Math.min(t[0],e[0]),n[1]=Math.min(t[1],e[1]),n[2]=Math.min(t[2],e[2]),n},vec3.max=function(n,t,e){return n[0]=Math.max(t[0],e[0]),n[1]=Math.max(t[1],e[1]),n[2]=Math.max(t[2],e[2]),n},vec3.scale=function(n,t,e){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n},vec3.scaleAndAdd=function(n,t,e,r){return n[0]=t[0]+e[0]*r,n[1]=t[1]+e[1]*r,n[2]=t[2]+e[2]*r,n},vec3.distance=function(n,t){var e=t[0]-n[0],r=t[1]-n[1],c=t[2]-n[2];return Math.sqrt(e*e+r*r+c*c)},vec3.dist=vec3.distance,vec3.squaredDistance=function(n,t){var e=t[0]-n[0],r=t[1]-n[1],c=t[2]-n[2];return e*e+r*r+c*c},vec3.sqrDist=vec3.squaredDistance,vec3.length=function(n){var t=n[0],e=n[1],r=n[2];return Math.sqrt(t*t+e*e+r*r)},vec3.len=vec3.length,vec3.squaredLength=function(n){var t=n[0],e=n[1],r=n[2];return t*t+e*e+r*r},vec3.sqrLen=vec3.squaredLength,vec3.negate=function(n,t){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n},vec3.inverse=function(n,t){return n[0]=1/t[0],n[1]=1/t[1],n[2]=1/t[2],n},vec3.normalize=function(n,t){var e=t[0],r=t[1],c=t[2],a=e*e+r*r+c*c;return a>0&&(a=1/Math.sqrt(a),n[0]=t[0]*a,n[1]=t[1]*a,n[2]=t[2]*a),n},vec3.dot=function(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]},vec3.cross=function(n,t,e){var r=t[0],c=t[1],a=t[2],u=e[0],v=e[1],i=e[2];return n[0]=c*i-a*v,n[1]=a*u-r*i,n[2]=r*v-c*u,n},vec3.lerp=function(n,t,e,r){var c=t[0],a=t[1],u=t[2];return n[0]=c+r*(e[0]-c),n[1]=a+r*(e[1]-a),n[2]=u+r*(e[2]-u),n},vec3.hermite=function(n,t,e,r,c,a){var u=a*a,v=u*(2*a-3)+1,i=u*(a-2)+a,o=u*(a-1),s=u*(3-2*a);return n[0]=t[0]*v+e[0]*i+r[0]*o+c[0]*s,n[1]=t[1]*v+e[1]*i+r[1]*o+c[1]*s,n[2]=t[2]*v+e[2]*i+r[2]*o+c[2]*s,n},vec3.bezier=function(n,t,e,r,c,a){var u=1-a,v=u*u,i=a*a,o=v*u,s=3*a*v,f=3*i*u,M=i*a;return n[0]=t[0]*o+e[0]*s+r[0]*f+c[0]*M,n[1]=t[1]*o+e[1]*s+r[1]*f+c[1]*M,n[2]=t[2]*o+e[2]*s+r[2]*f+c[2]*M,n},vec3.random=function(n,t){t=t||1;var e=2*glMatrix.RANDOM()*Math.PI,r=2*glMatrix.RANDOM()-1,c=Math.sqrt(1-r*r)*t;return n[0]=Math.cos(e)*c,n[1]=Math.sin(e)*c,n[2]=r*t,n},vec3.transformMat4=function(n,t,e){var r=t[0],c=t[1],a=t[2],u=e[3]*r+e[7]*c+e[11]*a+e[15];return u=u||1,n[0]=(e[0]*r+e[4]*c+e[8]*a+e[12])/u,n[1]=(e[1]*r+e[5]*c+e[9]*a+e[13])/u,n[2]=(e[2]*r+e[6]*c+e[10]*a+e[14])/u,n},vec3.transformMat3=function(n,t,e){var r=t[0],c=t[1],a=t[2];return n[0]=r*e[0]+c*e[3]+a*e[6],n[1]=r*e[1]+c*e[4]+a*e[7],n[2]=r*e[2]+c*e[5]+a*e[8],n},vec3.transformQuat=function(n,t,e){var r=t[0],c=t[1],a=t[2],u=e[0],v=e[1],i=e[2],o=e[3],s=o*r+v*a-i*c,f=o*c+i*r-u*a,M=o*a+u*c-v*r,h=-u*r-v*c-i*a;return n[0]=s*o+h*-u+f*-i-M*-v,n[1]=f*o+h*-v+M*-u-s*-i,n[2]=M*o+h*-i+s*-v-f*-u,n},vec3.rotateX=function(n,t,e,r){var c=[],a=[];return c[0]=t[0]-e[0],c[1]=t[1]-e[1],c[2]=t[2]-e[2],a[0]=c[0],a[1]=c[1]*Math.cos(r)-c[2]*Math.sin(r),a[2]=c[1]*Math.sin(r)+c[2]*Math.cos(r),n[0]=a[0]+e[0],n[1]=a[1]+e[1],n[2]=a[2]+e[2],n},vec3.rotateY=function(n,t,e,r){var c=[],a=[];return c[0]=t[0]-e[0],c[1]=t[1]-e[1],c[2]=t[2]-e[2],a[0]=c[2]*Math.sin(r)+c[0]*Math.cos(r),a[1]=c[1],a[2]=c[2]*Math.cos(r)-c[0]*Math.sin(r),n[0]=a[0]+e[0],n[1]=a[1]+e[1],n[2]=a[2]+e[2],n},vec3.rotateZ=function(n,t,e,r){var c=[],a=[];return c[0]=t[0]-e[0],c[1]=t[1]-e[1],c[2]=t[2]-e[2],a[0]=c[0]*Math.cos(r)-c[1]*Math.sin(r),a[1]=c[0]*Math.sin(r)+c[1]*Math.cos(r),a[2]=c[2],n[0]=a[0]+e[0],n[1]=a[1]+e[1],n[2]=a[2]+e[2],n},vec3.forEach=function(){var n=vec3.create();return function(t,e,r,c,a,u){var v,i;for(e||(e=3),r||(r=0),i=c?Math.min(c*e+r,t.length):t.length,v=r;i>v;v+=e)n[0]=t[v],n[1]=t[v+1],n[2]=t[v+2],a(n,n,u),t[v]=n[0],t[v+1]=n[1],t[v+2]=n[2];return t}}(),vec3.angle=function(n,t){var e=vec3.fromValues(n[0],n[1],n[2]),r=vec3.fromValues(t[0],t[1],t[2]);vec3.normalize(e,e),vec3.normalize(r,r);var c=vec3.dot(e,r);return c>1?0:Math.acos(c)},vec3.str=function(n){return\"vec3(\"+n[0]+\", \"+n[1]+\", \"+n[2]+\")\"},module.exports=vec3;\n},{\"./common.js\":106}],114:[function(require,module,exports){\nvar glMatrix=require(\"./common.js\"),vec4={};vec4.create=function(){var e=new glMatrix.ARRAY_TYPE(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},vec4.clone=function(e){var n=new glMatrix.ARRAY_TYPE(4);return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n},vec4.fromValues=function(e,n,t,r){var c=new glMatrix.ARRAY_TYPE(4);return c[0]=e,c[1]=n,c[2]=t,c[3]=r,c},vec4.copy=function(e,n){return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e},vec4.set=function(e,n,t,r,c){return e[0]=n,e[1]=t,e[2]=r,e[3]=c,e},vec4.add=function(e,n,t){return e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e[3]=n[3]+t[3],e},vec4.subtract=function(e,n,t){return e[0]=n[0]-t[0],e[1]=n[1]-t[1],e[2]=n[2]-t[2],e[3]=n[3]-t[3],e},vec4.sub=vec4.subtract,vec4.multiply=function(e,n,t){return e[0]=n[0]*t[0],e[1]=n[1]*t[1],e[2]=n[2]*t[2],e[3]=n[3]*t[3],e},vec4.mul=vec4.multiply,vec4.divide=function(e,n,t){return e[0]=n[0]/t[0],e[1]=n[1]/t[1],e[2]=n[2]/t[2],e[3]=n[3]/t[3],e},vec4.div=vec4.divide,vec4.min=function(e,n,t){return e[0]=Math.min(n[0],t[0]),e[1]=Math.min(n[1],t[1]),e[2]=Math.min(n[2],t[2]),e[3]=Math.min(n[3],t[3]),e},vec4.max=function(e,n,t){return e[0]=Math.max(n[0],t[0]),e[1]=Math.max(n[1],t[1]),e[2]=Math.max(n[2],t[2]),e[3]=Math.max(n[3],t[3]),e},vec4.scale=function(e,n,t){return e[0]=n[0]*t,e[1]=n[1]*t,e[2]=n[2]*t,e[3]=n[3]*t,e},vec4.scaleAndAdd=function(e,n,t,r){return e[0]=n[0]+t[0]*r,e[1]=n[1]+t[1]*r,e[2]=n[2]+t[2]*r,e[3]=n[3]+t[3]*r,e},vec4.distance=function(e,n){var t=n[0]-e[0],r=n[1]-e[1],c=n[2]-e[2],u=n[3]-e[3];return Math.sqrt(t*t+r*r+c*c+u*u)},vec4.dist=vec4.distance,vec4.squaredDistance=function(e,n){var t=n[0]-e[0],r=n[1]-e[1],c=n[2]-e[2],u=n[3]-e[3];return t*t+r*r+c*c+u*u},vec4.sqrDist=vec4.squaredDistance,vec4.length=function(e){var n=e[0],t=e[1],r=e[2],c=e[3];return Math.sqrt(n*n+t*t+r*r+c*c)},vec4.len=vec4.length,vec4.squaredLength=function(e){var n=e[0],t=e[1],r=e[2],c=e[3];return n*n+t*t+r*r+c*c},vec4.sqrLen=vec4.squaredLength,vec4.negate=function(e,n){return e[0]=-n[0],e[1]=-n[1],e[2]=-n[2],e[3]=-n[3],e},vec4.inverse=function(e,n){return e[0]=1/n[0],e[1]=1/n[1],e[2]=1/n[2],e[3]=1/n[3],e},vec4.normalize=function(e,n){var t=n[0],r=n[1],c=n[2],u=n[3],a=t*t+r*r+c*c+u*u;return a>0&&(a=1/Math.sqrt(a),e[0]=t*a,e[1]=r*a,e[2]=c*a,e[3]=u*a),e},vec4.dot=function(e,n){return e[0]*n[0]+e[1]*n[1]+e[2]*n[2]+e[3]*n[3]},vec4.lerp=function(e,n,t,r){var c=n[0],u=n[1],a=n[2],v=n[3];return e[0]=c+r*(t[0]-c),e[1]=u+r*(t[1]-u),e[2]=a+r*(t[2]-a),e[3]=v+r*(t[3]-v),e},vec4.random=function(e,n){return n=n||1,e[0]=glMatrix.RANDOM(),e[1]=glMatrix.RANDOM(),e[2]=glMatrix.RANDOM(),e[3]=glMatrix.RANDOM(),vec4.normalize(e,e),vec4.scale(e,e,n),e},vec4.transformMat4=function(e,n,t){var r=n[0],c=n[1],u=n[2],a=n[3];return e[0]=t[0]*r+t[4]*c+t[8]*u+t[12]*a,e[1]=t[1]*r+t[5]*c+t[9]*u+t[13]*a,e[2]=t[2]*r+t[6]*c+t[10]*u+t[14]*a,e[3]=t[3]*r+t[7]*c+t[11]*u+t[15]*a,e},vec4.transformQuat=function(e,n,t){var r=n[0],c=n[1],u=n[2],a=t[0],v=t[1],i=t[2],o=t[3],f=o*r+v*u-i*c,s=o*c+i*r-a*u,l=o*u+a*c-v*r,M=-a*r-v*c-i*u;return e[0]=f*o+M*-a+s*-i-l*-v,e[1]=s*o+M*-v+l*-a-f*-i,e[2]=l*o+M*-i+f*-v-s*-a,e[3]=n[3],e},vec4.forEach=function(){var e=vec4.create();return function(n,t,r,c,u,a){var v,i;for(t||(t=4),r||(r=0),i=c?Math.min(c*t+r,n.length):n.length,v=r;i>v;v+=t)e[0]=n[v],e[1]=n[v+1],e[2]=n[v+2],e[3]=n[v+3],u(e,e,a),n[v]=e[0],n[v+1]=e[1],n[v+2]=e[2],n[v+3]=e[3];return n}}(),vec4.str=function(e){return\"vec4(\"+e[0]+\", \"+e[1]+\", \"+e[2]+\", \"+e[3]+\")\"},module.exports=vec4;\n},{\"./common.js\":106}],115:[function(require,module,exports){\nexports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:(s?-1:1)*(1/0);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=0>o||0===o&&0>1/o?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),o+=p+N>=1?n/f:n*Math.pow(2,1-N),o*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};\n},{}],116:[function(require,module,exports){\n\"function\"==typeof Object.create?module.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t};\n},{}],117:[function(require,module,exports){\n\"use strict\";function constant(r){return function(){return r}}function interpolateNumber(r,t,n){return r*(1-n)+t*n}function interpolateArray(r,t,n){for(var e=[],o=0;o<r.length;o++)e[o]=interpolateNumber(r[o],t[o],n);return e}exports.interpolated=function(r){if(!r.stops)return constant(r);var t=r.stops,n=r.base||1,e=Array.isArray(t[0][1])?interpolateArray:interpolateNumber;return function(r){for(var o,a,i=0;i<t.length;i++){var u=t[i];if(u[0]<=r&&(o=u),u[0]>r){a=u;break}}if(o&&a){var s=a[0]-o[0],f=r-o[0],p=1===n?f/s:(Math.pow(n,f)-1)/(Math.pow(n,s)-1);return e(o[1],a[1],p)}return o?o[1]:a?a[1]:void 0}},exports[\"piecewise-constant\"]=function(r){if(!r.stops)return constant(r);var t=r.stops;return function(r){for(var n=0;n<t.length;n++)if(t[n][0]>r)return t[0===n?0:n-1][1];return t[t.length-1][1]}};\n},{}],118:[function(require,module,exports){\n\"use strict\";var reference=require(\"../../reference/latest.min.js\"),validate=require(\"./parsed\");module.exports=function(e){return validate(e,reference)};\n},{\"../../reference/latest.min.js\":122,\"./parsed\":119}],119:[function(require,module,exports){\n\"use strict\";function typeof_(e){return e instanceof Number?\"number\":e instanceof String?\"string\":e instanceof Boolean?\"boolean\":Array.isArray(e)?\"array\":null===e?\"null\":typeof e}function unbundle(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}var parseCSSColor=require(\"csscolorparser\").parseCSSColor,format=require(\"util\").format;module.exports=function(e,r){function t(e,r){var t={message:(e?e+\": \":\"\")+format.apply(format,Array.prototype.slice.call(arguments,2))};null!==r&&void 0!==r&&r.__line__&&(t.line=r.__line__),s.push(t)}function n(e,o,i){var s=typeof_(o);if(\"string\"===s&&\"@\"===o[0]){if(r.$version>7)return t(e,o,\"constants have been deprecated as of v8\");if(!(o in a))return t(e,o,'constant \"%s\" not found',o);o=a[o],s=typeof_(o)}if(i[\"function\"]&&\"object\"===s)return n[\"function\"](e,o,i);if(i.type){var u=n[i.type];if(u)return u(e,o,i);i=r[i.type]}n.object(e,o,i)}function o(e){return function(r,n,o){var a=typeof_(n);a!==e&&t(r,n,\"%s expected, %s found\",e,a),\"minimum\"in o&&n<o.minimum&&t(r,n,\"%s is less than the minimum value %s\",n,o.minimum),\"maximum\"in o&&n>o.maximum&&t(r,n,\"%s is greater than the maximum value %s\",n,o.maximum)}}var a=e.constants||{},i={},s=[];return n.constants=function(e,n){if(r.$version>7){if(n)return t(e,n,\"constants have been deprecated as of v8\")}else{var o=typeof_(n);if(\"object\"!==o)return t(e,n,\"object expected, %s found\",o);for(var a in n)\"@\"!==a[0]&&t(e+\".\"+a,n[a],'constants must start with \"@\"')}},n.source=function(e,o){if(!o.type)return void t(e,o,'\"type\" is required');var a=unbundle(o.type);switch(a){case\"vector\":case\"raster\":if(n.object(e,o,r.source_tile),\"url\"in o)for(var i in o)[\"type\",\"url\",\"tileSize\"].indexOf(i)<0&&t(e+\".\"+i,o[i],'a source with a \"url\" property may not include a \"%s\" property',i);break;case\"geojson\":n.object(e,o,r.source_geojson);break;case\"video\":n.object(e,o,r.source_video);break;case\"image\":n.object(e,o,r.source_image);break;default:n[\"enum\"](e+\".type\",o.type,{values:[\"vector\",\"raster\",\"geojson\",\"video\",\"image\"]})}},n.layer=function(o,a){a.type||a.ref||t(o,a,'either \"type\" or \"ref\" is required');var s=unbundle(a.type),u=unbundle(a.ref);if(a.id&&(i[a.id]?t(o,a.id,'duplicate layer id \"%s\", previously used at line %d',a.id,i[a.id]):i[a.id]=a.id.__line__),\"ref\"in a){[\"type\",\"source\",\"source-layer\",\"filter\",\"layout\"].forEach(function(e){e in a&&t(o,a[e],'\"%s\" is prohibited for ref layers',e)});var c;e.layers.forEach(function(e){e.id==u&&(c=e)}),c?c.ref?t(o,a.ref,\"ref cannot reference another ref layer\"):s=c.type:t(o,a.ref,'ref layer \"%s\" not found',u)}else if(\"background\"!==s)if(a.source){var f=e.sources[a.source];f?\"vector\"==f.type&&\"raster\"==s?t(o,a.source,'layer \"%s\" requires a raster source',a.id):\"raster\"==f.type&&\"raster\"!=s?t(o,a.source,'layer \"%s\" requires a vector source',a.id):\"vector\"!=f.type||a[\"source-layer\"]||t(o,a,'layer \"%s\" must specify a \"source-layer\"',a.id):t(o,a.source,'source \"%s\" not found',a.source)}else t(o,a,'missing required property \"source\"');n.object(o,a,r.layer,{filter:n.filter,layout:function(e,t){var o=r[\"layout_\"+s];return s&&o&&n(e,t,o)},paint:function(e,t){var o=r[\"paint_\"+s];return s&&o&&n(e,t,o)}})},n.object=function(e,o,a,i){i=i||{};var s=typeof_(o);if(\"object\"!==s)return t(e,o,\"object expected, %s found\",s);for(var u in o){var c=u.split(\".\")[0],f=a[c]||a[\"*\"],l=c.match(/^(.*)-transition$/);f?(i[c]||n)((e?e+\".\":e)+u,o[u],f):l&&a[l[1]]&&a[l[1]].transition?n((e?e+\".\":e)+u,o[u],r.transition):\"\"!==e&&1!==e.split(\".\").length&&t(e,o[u],'unknown property \"%s\"',u)}for(var p in a)a[p].required&&void 0===a[p][\"default\"]&&void 0===o[p]&&t(e,o,'missing required property \"%s\"',p)},n.array=function(r,o,a,i){if(\"array\"!==typeof_(o))return t(r,o,\"array expected, %s found\",typeof_(o));if(a.length&&o.length!==a.length)return t(r,o,\"array length %d expected, length %d found\",a.length,o.length);if(a[\"min-length\"]&&o.length<a[\"min-length\"])return t(r,o,\"array length at least %d expected, length %d found\",a[\"min-length\"],o.length);var s={type:a.value};e.version<7&&(s[\"function\"]=a[\"function\"]),\"object\"===typeof_(a.value)&&(s=a.value);for(var u=0;u<o.length;u++)(i||n)(r+\"[\"+u+\"]\",o[u],s)},n.filter=function(e,o){var a;if(\"array\"!==typeof_(o))return t(e,o,\"array expected, %s found\",typeof_(o));if(o.length<1)return t(e,o,\"filter array must have at least 1 element\");switch(n[\"enum\"](e+\"[0]\",o[0],r.filter_operator),unbundle(o[0])){case\"<\":case\"<=\":case\">\":case\">=\":o.length>=2&&\"$type\"==o[1]&&t(e,o,'\"$type\" cannot be use with operator \"%s\"',o[0]);case\"==\":case\"!=\":3!=o.length&&t(e,o,'filter array for operator \"%s\" must have 3 elements',o[0]);case\"in\":case\"!in\":o.length>=2&&(a=typeof_(o[1]),\"string\"!==a?t(e+\"[1]\",o[1],\"string expected, %s found\",a):\"@\"===o[1][0]&&t(e+\"[1]\",o[1],\"filter key cannot be a constant\"));for(var i=2;i<o.length;i++)a=typeof_(o[i]),\"$type\"==o[1]?n[\"enum\"](e+\"[\"+i+\"]\",o[i],r.geometry_type):\"string\"===a&&\"@\"===o[i][0]?t(e+\"[\"+i+\"]\",o[i],\"filter value cannot be a constant\"):\"string\"!==a&&\"number\"!==a&&\"boolean\"!==a&&t(e+\"[\"+i+\"]\",o[i],\"string, number, or boolean expected, %s found\",a);break;case\"any\":case\"all\":case\"none\":for(i=1;i<o.length;i++)n.filter(e+\"[\"+i+\"]\",o[i])}},n[\"function\"]=function(e,o,a){n.object(e,o,r[\"function\"],{stops:function(e,r,o){var i=-(1/0);n.array(e,r,o,function(e,r){return\"array\"!==typeof_(r)?t(e,r,\"array expected, %s found\",typeof_(r)):2!==r.length?t(e,r,\"array length %d expected, length %d found\",2,r.length):(n(e+\"[0]\",r[0],{type:\"number\"}),n(e+\"[1]\",r[1],a),void(\"number\"===typeof_(r[0])&&(\"piecewise-constant\"===a[\"function\"]&&r[0]%1!==0&&t(e+\"[0]\",r[0],\"zoom level for piecewise-constant functions must be an integer\"),r[0]<i&&t(e+\"[0]\",r[0],\"array stops must appear in ascending order\"),i=r[0])))}),\"array\"===typeof_(r)&&0===r.length&&t(e,r,\"array must have at least one stop\")}})},n[\"enum\"]=function(e,r,n){-1===n.values.indexOf(unbundle(r))&&t(e,r,\"expected one of [%s], %s found\",n.values.join(\", \"),r)},n.color=function(e,r){var n=typeof_(r);return\"string\"!==n?t(e,r,\"color expected, %s found\",n):null===parseCSSColor(r)?t(e,r,'color expected, \"%s\" found',r):void 0},n.number=o(\"number\"),n.string=o(\"string\"),n[\"boolean\"]=o(\"boolean\"),n[\"*\"]=function(){},n(\"\",e,r.$root),r.$version>7&&e.constants&&n.constants(\"constants\",e.constants),s.sort(function(e,r){return e.line-r.line}),s};\n},{\"csscolorparser\":120,\"util\":134}],120:[function(require,module,exports){\narguments[4][96][0].apply(exports,arguments)\n},{\"dup\":96}],121:[function(require,module,exports){\nmodule.exports=require(\"./v8.json\");\n},{\"./v8.json\":123}],122:[function(require,module,exports){\nmodule.exports=require(\"./v8.min.json\");\n},{\"./v8.min.json\":124}],123:[function(require,module,exports){\nmodule.exports={\"$version\":8,\"$root\":{\"version\":{\"required\":true,\"type\":\"enum\",\"values\":[8],\"doc\":\"Stylesheet version number. Must be 8.\",\"example\":8},\"name\":{\"type\":\"string\",\"doc\":\"A human-readable name for the style.\",\"example\":\"Bright\"},\"metadata\":{\"type\":\"*\",\"doc\":\"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.\"},\"center\":{\"type\":\"array\",\"value\":\"number\",\"doc\":\"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\"example\":[-73.9749,40.7736]},\"zoom\":{\"type\":\"number\",\"doc\":\"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\"example\":12.5},\"bearing\":{\"type\":\"number\",\"default\":0,\"period\":360,\"units\":\"degrees\",\"doc\":\"Default bearing, in degrees. The style bearing will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\"example\":29},\"pitch\":{\"type\":\"number\",\"default\":0,\"units\":\"degrees\",\"doc\":\"Default pitch, in degrees. Zero is perpendicular to the surface. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\",\"example\":50},\"sources\":{\"required\":true,\"type\":\"sources\",\"doc\":\"Data source specifications.\",\"example\":{\"mapbox-streets\":{\"type\":\"vector\",\"url\":\"mapbox://mapbox.mapbox-streets-v6\"}}},\"sprite\":{\"type\":\"string\",\"doc\":\"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended.\",\"example\":\"mapbox://sprites/mapbox/bright-v8\"},\"glyphs\":{\"type\":\"string\",\"doc\":\"A URL template for loading signed-distance-field glyph sets in PBF format. Valid tokens are {fontstack} and {range}.\",\"example\":\"mapbox://fonts/mapbox/{fontstack}/{range}.pbf\"},\"transition\":{\"type\":\"transition\",\"doc\":\"A global transition definition to use as a default across properties.\",\"example\":{\"duration\":300,\"delay\":0}},\"layers\":{\"required\":true,\"type\":\"array\",\"value\":\"layer\",\"doc\":\"Layers will be drawn in the order of this array.\",\"example\":[{\"id\":\"water\",\"source\":\"mapbox-streets\",\"source-layer\":\"water\",\"type\":\"fill\",\"paint\":{\"fill-color\":\"#00ffff\"}}]}},\"sources\":{\"*\":{\"type\":\"source\",\"doc\":\"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For GeoJSON and video sources, a URL must be provided.\"}},\"source\":[\"source_tile\",\"source_geojson\",\"source_video\",\"source_image\"],\"source_tile\":{\"type\":{\"required\":true,\"type\":\"enum\",\"values\":[\"vector\",\"raster\"],\"doc\":\"The data type of the tile source.\"},\"url\":{\"type\":\"string\",\"doc\":\"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`.\"},\"tiles\":{\"type\":\"array\",\"value\":\"string\",\"doc\":\"An array of one or more tile source URLs, as in the TileJSON spec.\"},\"minzoom\":{\"type\":\"number\",\"default\":0,\"doc\":\"Minimum zoom level for which tiles are available, as in the TileJSON spec.\"},\"maxzoom\":{\"type\":\"number\",\"default\":22,\"doc\":\"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.\"},\"tileSize\":{\"type\":\"number\",\"default\":512,\"units\":\"pixels\",\"doc\":\"The minimum visual size to display tiles for this layer. Only configurable for raster layers.\"},\"*\":{\"type\":\"*\",\"doc\":\"Other keys to configure the data source.\"}},\"source_geojson\":{\"type\":{\"required\":true,\"type\":\"enum\",\"values\":[\"geojson\"],\"doc\":\"The data type of the GeoJSON source.\"},\"data\":{\"type\":\"*\",\"doc\":\"A URL to a GeoJSON file, or inline GeoJSON.\"},\"maxzoom\":{\"type\":\"number\",\"default\":14,\"doc\":\"Maximum zoom to preserve detail at.\"},\"buffer\":{\"type\":\"number\",\"default\":64,\"doc\":\"Tile buffer on each side.\"},\"tolerance\":{\"type\":\"number\",\"default\":3,\"doc\":\"Simplification tolerance (higher means simpler).\"}},\"source_video\":{\"type\":{\"required\":true,\"type\":\"enum\",\"values\":[\"video\"],\"doc\":\"The data type of the video source.\"},\"urls\":{\"required\":true,\"type\":\"array\",\"value\":\"string\",\"doc\":\"URLs to video content in order of preferred format.\"},\"coordinates\":{\"required\":true,\"doc\":\"Corners of video specified in longitude, latitude pairs.\",\"type\":\"array\",\"length\":4,\"value\":{\"type\":\"array\",\"length\":2,\"value\":\"number\",\"doc\":\"A single longitude, latitude pair.\"}}},\"source_image\":{\"type\":{\"required\":true,\"type\":\"enum\",\"values\":[\"image\"],\"doc\":\"The data type of the image source.\"},\"url\":{\"required\":true,\"type\":\"string\",\"doc\":\"URL that points to an image\"},\"coordinates\":{\"required\":true,\"doc\":\"Corners of image specified in longitude, latitude pairs.\",\"type\":\"array\",\"length\":4,\"value\":{\"type\":\"array\",\"length\":2,\"value\":\"number\",\"doc\":\"A single longitude, latitude pair.\"}}},\"layer\":{\"id\":{\"type\":\"string\",\"doc\":\"Unique layer name.\"},\"type\":{\"type\":\"enum\",\"values\":[\"fill\",\"line\",\"symbol\",\"circle\",\"raster\",\"background\"],\"doc\":\"Rendering type of this layer.\"},\"metadata\":{\"type\":\"*\",\"doc\":\"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.\"},\"ref\":{\"type\":\"string\",\"doc\":\"References another layer to copy `type`, `source`, `source-layer`, `minzoom`, `maxzoom`, `filter`, and `layout` properties from. This allows the layers to share processing and be more efficient.\"},\"source\":{\"type\":\"string\",\"doc\":\"Name of a source description to be used for this layer.\"},\"source-layer\":{\"type\":\"string\",\"doc\":\"Layer to use from a vector tile source. Required if the source supports multiple layers.\"},\"minzoom\":{\"type\":\"number\",\"minimum\":0,\"maximum\":22,\"doc\":\"The minimum zoom level on which the layer gets parsed and appears on.\"},\"maxzoom\":{\"type\":\"number\",\"minimum\":0,\"maximum\":22,\"doc\":\"The maximum zoom level on which the layer gets parsed and appears on.\"},\"interactive\":{\"type\":\"boolean\",\"doc\":\"Enable querying of feature data from this layer for interactivity.\",\"default\":false},\"filter\":{\"type\":\"filter\",\"doc\":\"A expression specifying conditions on source features. Only features that match the filter are displayed.\"},\"layout\":{\"type\":\"layout\",\"doc\":\"Layout properties for the layer.\"},\"paint\":{\"type\":\"paint\",\"doc\":\"Default paint properties for this layer.\"},\"paint.*\":{\"type\":\"paint\",\"doc\":\"Class-specific paint properties for this layer. The class name is the part after the first dot.\"}},\"layout\":[\"layout_fill\",\"layout_line\",\"layout_circle\",\"layout_symbol\",\"layout_raster\",\"layout_background\"],\"layout_background\":{\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\",\"doc\":\"The display of this layer. `none` hides this layer.\"}},\"layout_fill\":{\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\",\"doc\":\"The display of this layer. `none` hides this layer.\"}},\"layout_circle\":{\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\",\"doc\":\"The display of this layer. `none` hides this layer.\"}},\"layout_line\":{\"line-cap\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"butt\",\"round\",\"square\"],\"default\":\"butt\",\"doc\":\"The display of line endings.\"},\"line-join\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"bevel\",\"round\",\"miter\"],\"default\":\"miter\",\"doc\":\"The display of lines when joining.\"},\"line-miter-limit\":{\"type\":\"number\",\"default\":2,\"function\":\"interpolated\",\"doc\":\"Used to automatically convert miter joins to bevel joins for sharp angles.\",\"requires\":[{\"line-join\":\"miter\"}]},\"line-round-limit\":{\"type\":\"number\",\"default\":1.05,\"function\":\"interpolated\",\"doc\":\"Used to automatically convert round joins to miter joins for shallow angles.\",\"requires\":[{\"line-join\":\"round\"}]},\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\",\"doc\":\"The display of this layer. `none` hides this layer.\"}},\"layout_symbol\":{\"symbol-placement\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"point\",\"line\"],\"default\":\"point\",\"doc\":\"Label placement relative to its geometry. `line` can only be used on LineStrings and Polygons.\"},\"symbol-spacing\":{\"type\":\"number\",\"default\":250,\"minimum\":1,\"function\":\"interpolated\",\"units\":\"pixels\",\"doc\":\"Distance between two symbol anchors.\",\"requires\":[{\"symbol-placement\":\"line\"}]},\"symbol-avoid-edges\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"doc\":\"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.\"},\"icon-allow-overlap\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"doc\":\"If true, the icon will be visible even if it collides with other previously drawn symbols.\",\"requires\":[\"icon-image\"]},\"icon-ignore-placement\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"doc\":\"If true, other symbols can be visible even if they collide with the icon.\",\"requires\":[\"icon-image\"]},\"icon-optional\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"doc\":\"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.\",\"requires\":[\"icon-image\",\"text-field\"]},\"icon-rotation-alignment\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"default\":\"viewport\",\"doc\":\"Orientation of icon when map is rotated.\",\"requires\":[\"icon-image\"]},\"icon-size\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"function\":\"interpolated\",\"doc\":\"Scale factor for icon. 1 is original size, 3 triples the size.\",\"requires\":[\"icon-image\"]},\"icon-image\":{\"type\":\"string\",\"function\":\"piecewise-constant\",\"doc\":\"A string with {tokens} replaced, referencing the data property to pull from.\",\"tokens\":true},\"icon-rotate\":{\"type\":\"number\",\"default\":0,\"period\":360,\"function\":\"interpolated\",\"units\":\"degrees\",\"doc\":\"Rotates the icon clockwise.\",\"requires\":[\"icon-image\"]},\"icon-padding\":{\"type\":\"number\",\"default\":2,\"minimum\":0,\"function\":\"interpolated\",\"units\":\"pixels\",\"doc\":\"Size of the additional area around the icon bounding box used for detecting symbol collisions.\",\"requires\":[\"icon-image\"]},\"icon-keep-upright\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"doc\":\"If true, the icon may be flipped to prevent it from being rendered upside-down.\",\"requires\":[\"icon-image\",{\"icon-rotation-alignment\":\"map\"},{\"symbol-placement\":\"line\"}]},\"icon-offset\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"doc\":\"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up.\",\"requires\":[\"icon-image\"]},\"text-rotation-alignment\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"default\":\"viewport\",\"doc\":\"Orientation of text when map is rotated.\",\"requires\":[\"text-field\"]},\"text-field\":{\"type\":\"string\",\"function\":\"piecewise-constant\",\"default\":\"\",\"tokens\":true,\"doc\":\"Value to use for a text label. Feature properties are specified using tokens like {field_name}.\"},\"text-font\":{\"type\":\"array\",\"value\":\"string\",\"function\":\"piecewise-constant\",\"default\":[\"Open Sans Regular\",\"Arial Unicode MS Regular\"],\"doc\":\"Font stack to use for displaying text.\",\"requires\":[\"text-field\"]},\"text-size\":{\"type\":\"number\",\"default\":16,\"minimum\":0,\"units\":\"pixels\",\"function\":\"interpolated\",\"doc\":\"Font size.\",\"requires\":[\"text-field\"]},\"text-max-width\":{\"type\":\"number\",\"default\":10,\"minimum\":0,\"units\":\"em\",\"function\":\"interpolated\",\"doc\":\"The maximum line width for text wrapping.\",\"requires\":[\"text-field\"]},\"text-line-height\":{\"type\":\"number\",\"default\":1.2,\"units\":\"em\",\"function\":\"interpolated\",\"doc\":\"Text leading value for multi-line text.\",\"requires\":[\"text-field\"]},\"text-letter-spacing\":{\"type\":\"number\",\"default\":0,\"units\":\"em\",\"function\":\"interpolated\",\"doc\":\"Text tracking amount.\",\"requires\":[\"text-field\"]},\"text-justify\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"left\",\"center\",\"right\"],\"default\":\"center\",\"doc\":\"Text justification options.\",\"requires\":[\"text-field\"]},\"text-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"center\",\"left\",\"right\",\"top\",\"bottom\",\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"],\"default\":\"center\",\"doc\":\"Part of the text placed closest to the anchor.\",\"requires\":[\"text-field\"]},\"text-max-angle\":{\"type\":\"number\",\"default\":45,\"units\":\"degrees\",\"function\":\"interpolated\",\"doc\":\"Maximum angle change between adjacent characters.\",\"requires\":[\"text-field\",{\"symbol-placement\":\"line\"}]},\"text-rotate\":{\"type\":\"number\",\"default\":0,\"period\":360,\"units\":\"degrees\",\"function\":\"interpolated\",\"doc\":\"Rotates the text clockwise.\",\"requires\":[\"text-field\"]},\"text-padding\":{\"type\":\"number\",\"default\":2,\"minimum\":0,\"units\":\"pixels\",\"function\":\"interpolated\",\"doc\":\"Size of the additional area around the text bounding box used for detecting symbol collisions.\",\"requires\":[\"text-field\"]},\"text-keep-upright\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":true,\"doc\":\"If true, the text may be flipped vertically to prevent it from being rendered upside-down.\",\"requires\":[\"text-field\",{\"text-rotation-alignment\":\"map\"},{\"symbol-placement\":\"line\"}]},\"text-transform\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"none\",\"uppercase\",\"lowercase\"],\"default\":\"none\",\"doc\":\"Specifies how to capitalize text, similar to the CSS `text-transform` property.\",\"requires\":[\"text-field\"]},\"text-offset\":{\"type\":\"array\",\"doc\":\"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.\",\"value\":\"number\",\"units\":\"ems\",\"function\":\"interpolated\",\"length\":2,\"default\":[0,0],\"requires\":[\"text-field\"]},\"text-allow-overlap\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"doc\":\"If true, the text will be visible even if it collides with other previously drawn symbols.\",\"requires\":[\"text-field\"]},\"text-ignore-placement\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"doc\":\"If true, other symbols can be visible even if they collide with the text.\",\"requires\":[\"text-field\"]},\"text-optional\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"doc\":\"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.\",\"requires\":[\"text-field\",\"icon-image\"]},\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\",\"doc\":\"The display of this layer. `none` hides this layer.\"}},\"layout_raster\":{\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\",\"doc\":\"The display of this layer. `none` hides this layer.\"}},\"filter\":{\"type\":\"array\",\"value\":\"*\",\"doc\":\"A filter selects specific features from a layer.\"},\"filter_operator\":{\"type\":\"enum\",\"values\":[\"==\",\"!=\",\">\",\">=\",\"<\",\"<=\",\"in\",\"!in\",\"all\",\"any\",\"none\"],\"doc\":\"The filter operator.\"},\"geometry_type\":{\"type\":\"enum\",\"values\":[\"Point\",\"LineString\",\"Polygon\"],\"doc\":\"The geometry type for the filter to select.\"},\"color_operation\":{\"type\":\"enum\",\"values\":[\"lighten\",\"saturate\",\"spin\",\"fade\",\"mix\"],\"doc\":\"A color operation to apply.\"},\"function\":{\"stops\":{\"type\":\"array\",\"required\":true,\"doc\":\"An array of stops.\",\"value\":\"function_stop\"},\"base\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"doc\":\"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly.\"}},\"function_stop\":{\"type\":\"array\",\"minimum\":0,\"maximum\":22,\"value\":[\"number\",\"color\"],\"length\":2,\"doc\":\"Zoom level and value pair.\"},\"paint\":[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_symbol\",\"paint_raster\",\"paint_background\"],\"paint_fill\":{\"fill-antialias\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":true,\"doc\":\"Whether or not the fill should be antialiased.\"},\"fill-opacity\":{\"type\":\"number\",\"function\":\"interpolated\",\"default\":1,\"minimum\":0,\"maximum\":1,\"doc\":\"The opacity given to the fill color.\",\"transition\":true},\"fill-color\":{\"type\":\"color\",\"default\":\"#000000\",\"doc\":\"The color of the fill.\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[{\"!\":\"fill-pattern\"}]},\"fill-outline-color\":{\"type\":\"color\",\"doc\":\"The outline color of the fill. Matches the value of `fill-color` if unspecified.\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[{\"!\":\"fill-pattern\"},{\"fill-antialias\":true}]},\"fill-translate\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.\"},\"fill-translate-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"doc\":\"Control whether the translation is relative to the map (north) or viewport (screen)\",\"default\":\"map\",\"requires\":[\"fill-translate\"]},\"fill-pattern\":{\"type\":\"string\",\"function\":\"piecewise-constant\",\"transition\":true,\"doc\":\"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).\"}},\"paint_line\":{\"line-opacity\":{\"type\":\"number\",\"doc\":\"The opacity at which the line will be drawn.\",\"function\":\"interpolated\",\"default\":1,\"minimum\":0,\"maximum\":1,\"transition\":true},\"line-color\":{\"type\":\"color\",\"doc\":\"The color with which the line will be drawn.\",\"default\":\"#000000\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[{\"!\":\"line-pattern\"}]},\"line-translate\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.\"},\"line-translate-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"doc\":\"Control whether the translation is relative to the map (north) or viewport (screen)\",\"default\":\"map\",\"requires\":[\"line-translate\"]},\"line-width\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"Stroke thickness.\"},\"line-gap-width\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"doc\":\"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.\",\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\"},\"line-offset\":{\"type\":\"number\",\"default\":0,\"doc\":\"The line's offset perpendicular to its direction. Values may be positive or negative, where positive indicates \\\"leftwards\\\" (if you were moving in the direction of the line) and negative indicates \\\"rightwards.\\\"\",\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\"},\"line-blur\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"Blur applied to the line, in pixels.\"},\"line-dasharray\":{\"type\":\"array\",\"value\":\"number\",\"function\":\"piecewise-constant\",\"doc\":\"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width.\",\"minimum\":0,\"transition\":true,\"units\":\"line widths\",\"requires\":[{\"!\":\"line-pattern\"}]},\"line-pattern\":{\"type\":\"string\",\"function\":\"piecewise-constant\",\"transition\":true,\"doc\":\"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).\"}},\"paint_circle\":{\"circle-radius\":{\"type\":\"number\",\"default\":5,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"Circle radius.\"},\"circle-color\":{\"type\":\"color\",\"default\":\"#000000\",\"doc\":\"The color of the circle.\",\"function\":\"interpolated\",\"transition\":true},\"circle-blur\":{\"type\":\"number\",\"default\":0,\"doc\":\"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.\",\"function\":\"interpolated\",\"transition\":true},\"circle-opacity\":{\"type\":\"number\",\"doc\":\"The opacity at which the circle will be drawn.\",\"default\":1,\"minimum\":0,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true},\"circle-translate\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.\"},\"circle-translate-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"doc\":\"Control whether the translation is relative to the map (north) or viewport (screen)\",\"default\":\"map\",\"requires\":[\"circle-translate\"]}},\"paint_symbol\":{\"icon-opacity\":{\"doc\":\"The opacity at which the icon will be drawn.\",\"type\":\"number\",\"default\":1,\"minimum\":0,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true,\"requires\":[\"icon-image\"]},\"icon-color\":{\"type\":\"color\",\"default\":\"#000000\",\"function\":\"interpolated\",\"transition\":true,\"doc\":\"The color of the icon. This can only be used with sdf icons.\",\"requires\":[\"icon-image\"]},\"icon-halo-color\":{\"type\":\"color\",\"default\":\"rgba(0, 0, 0, 0)\",\"function\":\"interpolated\",\"transition\":true,\"doc\":\"The color of the icon's halo. Icon halos can only be used with sdf icons.\",\"requires\":[\"icon-image\"]},\"icon-halo-width\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"Distance of halo to the icon outline.\",\"requires\":[\"icon-image\"]},\"icon-halo-blur\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"Fade out the halo towards the outside.\",\"requires\":[\"icon-image\"]},\"icon-translate\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.\",\"requires\":[\"icon-image\"]},\"icon-translate-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"doc\":\"Control whether the translation is relative to the map (north) or viewport (screen).\",\"default\":\"map\",\"requires\":[\"icon-image\",\"icon-translate\"]},\"text-opacity\":{\"type\":\"number\",\"doc\":\"The opacity at which the text will be drawn.\",\"default\":1,\"minimum\":0,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true,\"requires\":[\"text-field\"]},\"text-color\":{\"type\":\"color\",\"doc\":\"The color with which the text will be drawn.\",\"default\":\"#000000\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[\"text-field\"]},\"text-halo-color\":{\"type\":\"color\",\"default\":\"rgba(0, 0, 0, 0)\",\"function\":\"interpolated\",\"transition\":true,\"doc\":\"The color of the text's halo, which helps it stand out from backgrounds.\",\"requires\":[\"text-field\"]},\"text-halo-width\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.\",\"requires\":[\"text-field\"]},\"text-halo-blur\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"The halo's fadeout distance towards the outside.\",\"requires\":[\"text-field\"]},\"text-translate\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"doc\":\"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.\",\"requires\":[\"text-field\"]},\"text-translate-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"doc\":\"Control whether the translation is relative to the map (north) or viewport (screen).\",\"default\":\"map\",\"requires\":[\"text-field\",\"text-translate\"]}},\"paint_raster\":{\"raster-opacity\":{\"type\":\"number\",\"doc\":\"The opacity at which the image will be drawn.\",\"default\":1,\"minimum\":0,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true},\"raster-hue-rotate\":{\"type\":\"number\",\"default\":0,\"period\":360,\"function\":\"interpolated\",\"transition\":true,\"units\":\"degrees\",\"doc\":\"Rotates hues around the color wheel.\"},\"raster-brightness-min\":{\"type\":\"number\",\"function\":\"interpolated\",\"doc\":\"Increase or reduce the brightness of the image. The value is the minimum brightness.\",\"default\":0,\"minimum\":0,\"maximum\":1,\"transition\":true},\"raster-brightness-max\":{\"type\":\"number\",\"function\":\"interpolated\",\"doc\":\"Increase or reduce the brightness of the image. The value is the maximum brightness.\",\"default\":1,\"minimum\":0,\"maximum\":1,\"transition\":true},\"raster-saturation\":{\"type\":\"number\",\"doc\":\"Increase or reduce the saturation of the image.\",\"default\":0,\"minimum\":-1,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true},\"raster-contrast\":{\"type\":\"number\",\"doc\":\"Increase or reduce the contrast of the image.\",\"default\":0,\"minimum\":-1,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true},\"raster-fade-duration\":{\"type\":\"number\",\"default\":300,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"milliseconds\",\"doc\":\"Fade duration when a new tile is added.\"}},\"paint_background\":{\"background-color\":{\"type\":\"color\",\"default\":\"#000000\",\"doc\":\"The color with which the background will be drawn.\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[{\"!\":\"background-pattern\"}]},\"background-pattern\":{\"type\":\"string\",\"function\":\"piecewise-constant\",\"transition\":true,\"doc\":\"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).\"},\"background-opacity\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"maximum\":1,\"doc\":\"The opacity at which the background will be drawn.\",\"function\":\"interpolated\",\"transition\":true}},\"transition\":{\"duration\":{\"type\":\"number\",\"default\":300,\"minimum\":0,\"units\":\"milliseconds\",\"doc\":\"Time allotted for transitions to complete.\"},\"delay\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"units\":\"milliseconds\",\"doc\":\"Length of time before a transition begins.\"}}}\n},{}],124:[function(require,module,exports){\nmodule.exports={\"$version\":8,\"$root\":{\"version\":{\"required\":true,\"type\":\"enum\",\"values\":[8]},\"name\":{\"type\":\"string\"},\"metadata\":{\"type\":\"*\"},\"center\":{\"type\":\"array\",\"value\":\"number\"},\"zoom\":{\"type\":\"number\"},\"bearing\":{\"type\":\"number\",\"default\":0,\"period\":360,\"units\":\"degrees\"},\"pitch\":{\"type\":\"number\",\"default\":0,\"units\":\"degrees\"},\"sources\":{\"required\":true,\"type\":\"sources\"},\"sprite\":{\"type\":\"string\"},\"glyphs\":{\"type\":\"string\"},\"transition\":{\"type\":\"transition\"},\"layers\":{\"required\":true,\"type\":\"array\",\"value\":\"layer\"}},\"sources\":{\"*\":{\"type\":\"source\"}},\"source\":[\"source_tile\",\"source_geojson\",\"source_video\",\"source_image\"],\"source_tile\":{\"type\":{\"required\":true,\"type\":\"enum\",\"values\":[\"vector\",\"raster\"]},\"url\":{\"type\":\"string\"},\"tiles\":{\"type\":\"array\",\"value\":\"string\"},\"minzoom\":{\"type\":\"number\",\"default\":0},\"maxzoom\":{\"type\":\"number\",\"default\":22},\"tileSize\":{\"type\":\"number\",\"default\":512,\"units\":\"pixels\"},\"*\":{\"type\":\"*\"}},\"source_geojson\":{\"type\":{\"required\":true,\"type\":\"enum\",\"values\":[\"geojson\"]},\"data\":{\"type\":\"*\"},\"maxzoom\":{\"type\":\"number\",\"default\":14},\"buffer\":{\"type\":\"number\",\"default\":64},\"tolerance\":{\"type\":\"number\",\"default\":3}},\"source_video\":{\"type\":{\"required\":true,\"type\":\"enum\",\"values\":[\"video\"]},\"urls\":{\"required\":true,\"type\":\"array\",\"value\":\"string\"},\"coordinates\":{\"required\":true,\"type\":\"array\",\"length\":4,\"value\":{\"type\":\"array\",\"length\":2,\"value\":\"number\"}}},\"source_image\":{\"type\":{\"required\":true,\"type\":\"enum\",\"values\":[\"image\"]},\"url\":{\"required\":true,\"type\":\"string\"},\"coordinates\":{\"required\":true,\"type\":\"array\",\"length\":4,\"value\":{\"type\":\"array\",\"length\":2,\"value\":\"number\"}}},\"layer\":{\"id\":{\"type\":\"string\"},\"type\":{\"type\":\"enum\",\"values\":[\"fill\",\"line\",\"symbol\",\"circle\",\"raster\",\"background\"]},\"metadata\":{\"type\":\"*\"},\"ref\":{\"type\":\"string\"},\"source\":{\"type\":\"string\"},\"source-layer\":{\"type\":\"string\"},\"minzoom\":{\"type\":\"number\",\"minimum\":0,\"maximum\":22},\"maxzoom\":{\"type\":\"number\",\"minimum\":0,\"maximum\":22},\"interactive\":{\"type\":\"boolean\",\"default\":false},\"filter\":{\"type\":\"filter\"},\"layout\":{\"type\":\"layout\"},\"paint\":{\"type\":\"paint\"},\"paint.*\":{\"type\":\"paint\"}},\"layout\":[\"layout_fill\",\"layout_line\",\"layout_circle\",\"layout_symbol\",\"layout_raster\",\"layout_background\"],\"layout_background\":{\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\"}},\"layout_fill\":{\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\"}},\"layout_circle\":{\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\"}},\"layout_line\":{\"line-cap\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"butt\",\"round\",\"square\"],\"default\":\"butt\"},\"line-join\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"bevel\",\"round\",\"miter\"],\"default\":\"miter\"},\"line-miter-limit\":{\"type\":\"number\",\"default\":2,\"function\":\"interpolated\",\"requires\":[{\"line-join\":\"miter\"}]},\"line-round-limit\":{\"type\":\"number\",\"default\":1.05,\"function\":\"interpolated\",\"requires\":[{\"line-join\":\"round\"}]},\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\"}},\"layout_symbol\":{\"symbol-placement\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"point\",\"line\"],\"default\":\"point\"},\"symbol-spacing\":{\"type\":\"number\",\"default\":250,\"minimum\":1,\"function\":\"interpolated\",\"units\":\"pixels\",\"requires\":[{\"symbol-placement\":\"line\"}]},\"symbol-avoid-edges\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false},\"icon-allow-overlap\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"requires\":[\"icon-image\"]},\"icon-ignore-placement\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"requires\":[\"icon-image\"]},\"icon-optional\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"requires\":[\"icon-image\",\"text-field\"]},\"icon-rotation-alignment\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"default\":\"viewport\",\"requires\":[\"icon-image\"]},\"icon-size\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"function\":\"interpolated\",\"requires\":[\"icon-image\"]},\"icon-image\":{\"type\":\"string\",\"function\":\"piecewise-constant\",\"tokens\":true},\"icon-rotate\":{\"type\":\"number\",\"default\":0,\"period\":360,\"function\":\"interpolated\",\"units\":\"degrees\",\"requires\":[\"icon-image\"]},\"icon-padding\":{\"type\":\"number\",\"default\":2,\"minimum\":0,\"function\":\"interpolated\",\"units\":\"pixels\",\"requires\":[\"icon-image\"]},\"icon-keep-upright\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"requires\":[\"icon-image\",{\"icon-rotation-alignment\":\"map\"},{\"symbol-placement\":\"line\"}]},\"icon-offset\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"requires\":[\"icon-image\"]},\"text-rotation-alignment\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"default\":\"viewport\",\"requires\":[\"text-field\"]},\"text-field\":{\"type\":\"string\",\"function\":\"piecewise-constant\",\"default\":\"\",\"tokens\":true},\"text-font\":{\"type\":\"array\",\"value\":\"string\",\"function\":\"piecewise-constant\",\"default\":[\"Open Sans Regular\",\"Arial Unicode MS Regular\"],\"requires\":[\"text-field\"]},\"text-size\":{\"type\":\"number\",\"default\":16,\"minimum\":0,\"units\":\"pixels\",\"function\":\"interpolated\",\"requires\":[\"text-field\"]},\"text-max-width\":{\"type\":\"number\",\"default\":10,\"minimum\":0,\"units\":\"em\",\"function\":\"interpolated\",\"requires\":[\"text-field\"]},\"text-line-height\":{\"type\":\"number\",\"default\":1.2,\"units\":\"em\",\"function\":\"interpolated\",\"requires\":[\"text-field\"]},\"text-letter-spacing\":{\"type\":\"number\",\"default\":0,\"units\":\"em\",\"function\":\"interpolated\",\"requires\":[\"text-field\"]},\"text-justify\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"left\",\"center\",\"right\"],\"default\":\"center\",\"requires\":[\"text-field\"]},\"text-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"center\",\"left\",\"right\",\"top\",\"bottom\",\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"],\"default\":\"center\",\"requires\":[\"text-field\"]},\"text-max-angle\":{\"type\":\"number\",\"default\":45,\"units\":\"degrees\",\"function\":\"interpolated\",\"requires\":[\"text-field\",{\"symbol-placement\":\"line\"}]},\"text-rotate\":{\"type\":\"number\",\"default\":0,\"period\":360,\"units\":\"degrees\",\"function\":\"interpolated\",\"requires\":[\"text-field\"]},\"text-padding\":{\"type\":\"number\",\"default\":2,\"minimum\":0,\"units\":\"pixels\",\"function\":\"interpolated\",\"requires\":[\"text-field\"]},\"text-keep-upright\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":true,\"requires\":[\"text-field\",{\"text-rotation-alignment\":\"map\"},{\"symbol-placement\":\"line\"}]},\"text-transform\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"none\",\"uppercase\",\"lowercase\"],\"default\":\"none\",\"requires\":[\"text-field\"]},\"text-offset\":{\"type\":\"array\",\"value\":\"number\",\"units\":\"ems\",\"function\":\"interpolated\",\"length\":2,\"default\":[0,0],\"requires\":[\"text-field\"]},\"text-allow-overlap\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"requires\":[\"text-field\"]},\"text-ignore-placement\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"requires\":[\"text-field\"]},\"text-optional\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":false,\"requires\":[\"text-field\",\"icon-image\"]},\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\"}},\"layout_raster\":{\"visibility\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"visible\",\"none\"],\"default\":\"visible\"}},\"filter\":{\"type\":\"array\",\"value\":\"*\"},\"filter_operator\":{\"type\":\"enum\",\"values\":[\"==\",\"!=\",\">\",\">=\",\"<\",\"<=\",\"in\",\"!in\",\"all\",\"any\",\"none\"]},\"geometry_type\":{\"type\":\"enum\",\"values\":[\"Point\",\"LineString\",\"Polygon\"]},\"color_operation\":{\"type\":\"enum\",\"values\":[\"lighten\",\"saturate\",\"spin\",\"fade\",\"mix\"]},\"function\":{\"stops\":{\"type\":\"array\",\"required\":true,\"value\":\"function_stop\"},\"base\":{\"type\":\"number\",\"default\":1,\"minimum\":0}},\"function_stop\":{\"type\":\"array\",\"minimum\":0,\"maximum\":22,\"value\":[\"number\",\"color\"],\"length\":2},\"paint\":[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_symbol\",\"paint_raster\",\"paint_background\"],\"paint_fill\":{\"fill-antialias\":{\"type\":\"boolean\",\"function\":\"piecewise-constant\",\"default\":true},\"fill-opacity\":{\"type\":\"number\",\"function\":\"interpolated\",\"default\":1,\"minimum\":0,\"maximum\":1,\"transition\":true},\"fill-color\":{\"type\":\"color\",\"default\":\"#000000\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[{\"!\":\"fill-pattern\"}]},\"fill-outline-color\":{\"type\":\"color\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[{\"!\":\"fill-pattern\"},{\"fill-antialias\":true}]},\"fill-translate\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\"},\"fill-translate-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"default\":\"map\",\"requires\":[\"fill-translate\"]},\"fill-pattern\":{\"type\":\"string\",\"function\":\"piecewise-constant\",\"transition\":true}},\"paint_line\":{\"line-opacity\":{\"type\":\"number\",\"function\":\"interpolated\",\"default\":1,\"minimum\":0,\"maximum\":1,\"transition\":true},\"line-color\":{\"type\":\"color\",\"default\":\"#000000\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[{\"!\":\"line-pattern\"}]},\"line-translate\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\"},\"line-translate-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"default\":\"map\",\"requires\":[\"line-translate\"]},\"line-width\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\"},\"line-gap-width\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\"},\"line-offset\":{\"type\":\"number\",\"default\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\"},\"line-blur\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\"},\"line-dasharray\":{\"type\":\"array\",\"value\":\"number\",\"function\":\"piecewise-constant\",\"minimum\":0,\"transition\":true,\"units\":\"line widths\",\"requires\":[{\"!\":\"line-pattern\"}]},\"line-pattern\":{\"type\":\"string\",\"function\":\"piecewise-constant\",\"transition\":true}},\"paint_circle\":{\"circle-radius\":{\"type\":\"number\",\"default\":5,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\"},\"circle-color\":{\"type\":\"color\",\"default\":\"#000000\",\"function\":\"interpolated\",\"transition\":true},\"circle-blur\":{\"type\":\"number\",\"default\":0,\"function\":\"interpolated\",\"transition\":true},\"circle-opacity\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true},\"circle-translate\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\"},\"circle-translate-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"default\":\"map\",\"requires\":[\"circle-translate\"]}},\"paint_symbol\":{\"icon-opacity\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true,\"requires\":[\"icon-image\"]},\"icon-color\":{\"type\":\"color\",\"default\":\"#000000\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[\"icon-image\"]},\"icon-halo-color\":{\"type\":\"color\",\"default\":\"rgba(0, 0, 0, 0)\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[\"icon-image\"]},\"icon-halo-width\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"requires\":[\"icon-image\"]},\"icon-halo-blur\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"requires\":[\"icon-image\"]},\"icon-translate\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"requires\":[\"icon-image\"]},\"icon-translate-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"default\":\"map\",\"requires\":[\"icon-image\",\"icon-translate\"]},\"text-opacity\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true,\"requires\":[\"text-field\"]},\"text-color\":{\"type\":\"color\",\"default\":\"#000000\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[\"text-field\"]},\"text-halo-color\":{\"type\":\"color\",\"default\":\"rgba(0, 0, 0, 0)\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[\"text-field\"]},\"text-halo-width\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"requires\":[\"text-field\"]},\"text-halo-blur\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"requires\":[\"text-field\"]},\"text-translate\":{\"type\":\"array\",\"value\":\"number\",\"length\":2,\"default\":[0,0],\"function\":\"interpolated\",\"transition\":true,\"units\":\"pixels\",\"requires\":[\"text-field\"]},\"text-translate-anchor\":{\"type\":\"enum\",\"function\":\"piecewise-constant\",\"values\":[\"map\",\"viewport\"],\"default\":\"map\",\"requires\":[\"text-field\",\"text-translate\"]}},\"paint_raster\":{\"raster-opacity\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true},\"raster-hue-rotate\":{\"type\":\"number\",\"default\":0,\"period\":360,\"function\":\"interpolated\",\"transition\":true,\"units\":\"degrees\"},\"raster-brightness-min\":{\"type\":\"number\",\"function\":\"interpolated\",\"default\":0,\"minimum\":0,\"maximum\":1,\"transition\":true},\"raster-brightness-max\":{\"type\":\"number\",\"function\":\"interpolated\",\"default\":1,\"minimum\":0,\"maximum\":1,\"transition\":true},\"raster-saturation\":{\"type\":\"number\",\"default\":0,\"minimum\":-1,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true},\"raster-contrast\":{\"type\":\"number\",\"default\":0,\"minimum\":-1,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true},\"raster-fade-duration\":{\"type\":\"number\",\"default\":300,\"minimum\":0,\"function\":\"interpolated\",\"transition\":true,\"units\":\"milliseconds\"}},\"paint_background\":{\"background-color\":{\"type\":\"color\",\"default\":\"#000000\",\"function\":\"interpolated\",\"transition\":true,\"requires\":[{\"!\":\"background-pattern\"}]},\"background-pattern\":{\"type\":\"string\",\"function\":\"piecewise-constant\",\"transition\":true},\"background-opacity\":{\"type\":\"number\",\"default\":1,\"minimum\":0,\"maximum\":1,\"function\":\"interpolated\",\"transition\":true}},\"transition\":{\"duration\":{\"type\":\"number\",\"default\":300,\"minimum\":0,\"units\":\"milliseconds\"},\"delay\":{\"type\":\"number\",\"default\":0,\"minimum\":0,\"units\":\"milliseconds\"}}}\n},{}],125:[function(require,module,exports){\n(function (process){\nfunction normalizeArray(r,t){for(var e=0,n=r.length-1;n>=0;n--){var s=r[n];\".\"===s?r.splice(n,1):\"..\"===s?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e--;e)r.unshift(\"..\");return r}function filter(r,t){if(r.filter)return r.filter(t);for(var e=[],n=0;n<r.length;n++)t(r[n],n,r)&&e.push(r[n]);return e}var splitPathRe=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/,splitPath=function(r){return splitPathRe.exec(r).slice(1)};exports.resolve=function(){for(var r=\"\",t=!1,e=arguments.length-1;e>=-1&&!t;e--){var n=e>=0?arguments[e]:process.cwd();if(\"string\"!=typeof n)throw new TypeError(\"Arguments to path.resolve must be strings\");n&&(r=n+\"/\"+r,t=\"/\"===n.charAt(0))}return r=normalizeArray(filter(r.split(\"/\"),function(r){return!!r}),!t).join(\"/\"),(t?\"/\":\"\")+r||\".\"},exports.normalize=function(r){var t=exports.isAbsolute(r),e=\"/\"===substr(r,-1);return r=normalizeArray(filter(r.split(\"/\"),function(r){return!!r}),!t).join(\"/\"),r||t||(r=\".\"),r&&e&&(r+=\"/\"),(t?\"/\":\"\")+r},exports.isAbsolute=function(r){return\"/\"===r.charAt(0)},exports.join=function(){var r=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(r,function(r,t){if(\"string\"!=typeof r)throw new TypeError(\"Arguments to path.join must be strings\");return r}).join(\"/\"))},exports.relative=function(r,t){function e(r){for(var t=0;t<r.length&&\"\"===r[t];t++);for(var e=r.length-1;e>=0&&\"\"===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var n=e(r.split(\"/\")),s=e(t.split(\"/\")),i=Math.min(n.length,s.length),o=i,u=0;i>u;u++)if(n[u]!==s[u]){o=u;break}for(var l=[],u=o;u<n.length;u++)l.push(\"..\");return l=l.concat(s.slice(o)),l.join(\"/\")},exports.sep=\"/\",exports.delimiter=\":\",exports.dirname=function(r){var t=splitPath(r),e=t[0],n=t[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):\".\"},exports.basename=function(r,t){var e=splitPath(r)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),e},exports.extname=function(r){return splitPath(r)[3]};var substr=\"b\"===\"ab\".substr(-1)?function(r,t,e){return r.substr(t,e)}:function(r,t,e){return 0>t&&(t=r.length+t),r.substr(t,e)};\n}).call(this,require('_process'))\n\n},{\"_process\":129}],126:[function(require,module,exports){\n\"use strict\";function Buffer(t){var e;t&&t.length&&(e=t,t=e.length);var r=new Uint8Array(t||0);return e&&r.set(e),r.readUInt32LE=BufferMethods.readUInt32LE,r.writeUInt32LE=BufferMethods.writeUInt32LE,r.readInt32LE=BufferMethods.readInt32LE,r.writeInt32LE=BufferMethods.writeInt32LE,r.readFloatLE=BufferMethods.readFloatLE,r.writeFloatLE=BufferMethods.writeFloatLE,r.readDoubleLE=BufferMethods.readDoubleLE,r.writeDoubleLE=BufferMethods.writeDoubleLE,r.toString=BufferMethods.toString,r.write=BufferMethods.write,r.slice=BufferMethods.slice,r.copy=BufferMethods.copy,r._isBuffer=!0,r}function encodeString(t){for(var e,r,n=t.length,i=[],o=0;n>o;o++){if(e=t.charCodeAt(o),e>55295&&57344>e){if(!r){e>56319||o+1===n?i.push(239,191,189):r=e;continue}if(56320>e){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);128>e?i.push(e):2048>e?i.push(e>>6|192,63&e|128):65536>e?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}module.exports=Buffer;var ieee754=require(\"ieee754\"),BufferMethods,lastStr,lastStrEncoded;BufferMethods={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return ieee754.read(this,t,!0,23,4)},readDoubleLE:function(t){return ieee754.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return ieee754.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return ieee754.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n=\"\",i=\"\";e=e||0,r=Math.min(this.length,r||this.length);for(var o=e;r>o;o++){var u=this[o];127>=u?(n+=decodeURIComponent(i)+String.fromCharCode(u),i=\"\"):i+=\"%\"+u.toString(16)}return n+=decodeURIComponent(i)},write:function(t,e){for(var r=t===lastStr?lastStrEncoded:encodeString(t),n=0;n<r.length;n++)this[e+n]=r[n]},slice:function(t,e){return this.subarray(t,e)},copy:function(t,e){e=e||0;for(var r=0;r<this.length;r++)t[e+r]=this[r]}},BufferMethods.writeInt32LE=BufferMethods.writeUInt32LE,Buffer.byteLength=function(t){return lastStr=t,lastStrEncoded=encodeString(t),lastStrEncoded.length},Buffer.isBuffer=function(t){return!(!t||!t._isBuffer)};\n},{\"ieee754\":115}],127:[function(require,module,exports){\n(function (global){\n\"use strict\";function Pbf(t){this.buf=Buffer.isBuffer(t)?t:new Buffer(t||0),this.pos=0,this.length=this.buf.length}function writePackedVarint(t,i){for(var e=0;e<t.length;e++)i.writeVarint(t[e])}function writePackedSVarint(t,i){for(var e=0;e<t.length;e++)i.writeSVarint(t[e])}function writePackedFloat(t,i){for(var e=0;e<t.length;e++)i.writeFloat(t[e])}function writePackedDouble(t,i){for(var e=0;e<t.length;e++)i.writeDouble(t[e])}function writePackedBoolean(t,i){for(var e=0;e<t.length;e++)i.writeBoolean(t[e])}function writePackedFixed32(t,i){for(var e=0;e<t.length;e++)i.writeFixed32(t[e])}function writePackedSFixed32(t,i){for(var e=0;e<t.length;e++)i.writeSFixed32(t[e])}function writePackedFixed64(t,i){for(var e=0;e<t.length;e++)i.writeFixed64(t[e])}function writePackedSFixed64(t,i){for(var e=0;e<t.length;e++)i.writeSFixed64(t[e])}module.exports=Pbf;var Buffer=global.Buffer||require(\"./buffer\");Pbf.Varint=0,Pbf.Fixed64=1,Pbf.Bytes=2,Pbf.Fixed32=5;var SHIFT_LEFT_32=4294967296,SHIFT_RIGHT_32=1/SHIFT_LEFT_32,POW_2_63=Math.pow(2,63);Pbf.prototype={destroy:function(){this.buf=null},readFields:function(t,i,e){for(e=e||this.length;this.pos<e;){var r=this.readVarint(),s=r>>3,n=this.pos;t(s,i,this),this.pos===n&&this.skip(r)}return i},readMessage:function(t,i){return this.readFields(t,i,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readUInt32LE(this.pos+4)*SHIFT_LEFT_32;return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readInt32LE(this.pos+4)*SHIFT_LEFT_32;return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,i,e,r,s,n,o=this.buf;if(e=o[this.pos++],128>e)return e;if(e=127&e,r=o[this.pos++],128>r)return e|r<<7;if(r=(127&r)<<7,s=o[this.pos++],128>s)return e|r|s<<14;if(s=(127&s)<<14,n=o[this.pos++],128>n)return e|r|s|n<<21;if(t=e|r|s|(127&n)<<21,i=o[this.pos++],t+=268435456*(127&i),128>i)return t;if(i=o[this.pos++],t+=34359738368*(127&i),128>i)return t;if(i=o[this.pos++],t+=4398046511104*(127&i),128>i)return t;if(i=o[this.pos++],t+=562949953421312*(127&i),128>i)return t;if(i=o[this.pos++],t+=72057594037927940*(127&i),128>i)return t;if(i=o[this.pos++],t+=0x8000000000000000*(127&i),128>i)return t;throw new Error(\"Expected varint not more than 10 bytes\")},readVarint64:function(){var t=this.pos,i=this.readVarint();if(POW_2_63>i)return i;for(var e=this.pos-2;255===this.buf[e];)e--;t>e&&(e=t),i=0;for(var r=0;e-t+1>r;r++){var s=127&~this.buf[t+r];i+=4>r?s<<7*r:s*Math.pow(2,7*r)}return-i-1},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,i=this.buf.toString(\"utf8\",this.pos,t);return this.pos=t,i},readBytes:function(){var t=this.readVarint()+this.pos,i=this.buf.slice(this.pos,t);return this.pos=t,i},readPackedVarint:function(){for(var t=this.readVarint()+this.pos,i=[];this.pos<t;)i.push(this.readVarint());return i},readPackedSVarint:function(){for(var t=this.readVarint()+this.pos,i=[];this.pos<t;)i.push(this.readSVarint());return i},readPackedBoolean:function(){for(var t=this.readVarint()+this.pos,i=[];this.pos<t;)i.push(this.readBoolean());return i},readPackedFloat:function(){for(var t=this.readVarint()+this.pos,i=[];this.pos<t;)i.push(this.readFloat());return i},readPackedDouble:function(){for(var t=this.readVarint()+this.pos,i=[];this.pos<t;)i.push(this.readDouble());return i},readPackedFixed32:function(){for(var t=this.readVarint()+this.pos,i=[];this.pos<t;)i.push(this.readFixed32());return i},readPackedSFixed32:function(){for(var t=this.readVarint()+this.pos,i=[];this.pos<t;)i.push(this.readSFixed32());return i},readPackedFixed64:function(){for(var t=this.readVarint()+this.pos,i=[];this.pos<t;)i.push(this.readFixed64());return i},readPackedSFixed64:function(){for(var t=this.readVarint()+this.pos,i=[];this.pos<t;)i.push(this.readSFixed64());return i},skip:function(t){var i=7&t;if(i===Pbf.Varint)for(;this.buf[this.pos++]>127;);else if(i===Pbf.Bytes)this.pos=this.readVarint()+this.pos;else if(i===Pbf.Fixed32)this.pos+=4;else{if(i!==Pbf.Fixed64)throw new Error(\"Unimplemented type: \"+i);this.pos+=8}},writeTag:function(t,i){this.writeVarint(t<<3|i)},realloc:function(t){for(var i=this.length||16;i<this.pos+t;)i*=2;if(i!==this.length){var e=new Buffer(i);this.buf.copy(e),this.buf=e,this.length=i}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.slice(0,this.length)},writeFixed32:function(t){this.realloc(4),this.buf.writeUInt32LE(t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),this.buf.writeInt32LE(t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(-1&t,this.pos),this.buf.writeUInt32LE(Math.floor(t*SHIFT_RIGHT_32),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(-1&t,this.pos),this.buf.writeInt32LE(Math.floor(t*SHIFT_RIGHT_32),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t,127>=t)this.realloc(1),this.buf[this.pos++]=t;else if(16383>=t)this.realloc(2),this.buf[this.pos++]=t>>>0&127|128,this.buf[this.pos++]=t>>>7&127;else if(2097151>=t)this.realloc(3),this.buf[this.pos++]=t>>>0&127|128,this.buf[this.pos++]=t>>>7&127|128,this.buf[this.pos++]=t>>>14&127;else if(268435455>=t)this.realloc(4),this.buf[this.pos++]=t>>>0&127|128,this.buf[this.pos++]=t>>>7&127|128,this.buf[this.pos++]=t>>>14&127|128,this.buf[this.pos++]=t>>>21&127;else{for(var i=this.pos;t>=128;)this.realloc(1),this.buf[this.pos++]=255&t|128,t/=128;if(this.realloc(1),this.buf[this.pos++]=0|t,this.pos-i>10)throw new Error(\"Given varint doesn't fit into 10 bytes\")}},writeSVarint:function(t){this.writeVarint(0>t?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var i=Buffer.byteLength(t);this.writeVarint(i),this.realloc(i),this.buf.write(t,this.pos),this.pos+=i},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var i=t.length;this.writeVarint(i),this.realloc(i);for(var e=0;i>e;e++)this.buf[this.pos++]=t[e]},writeRawMessage:function(t,i){this.pos++;var e=this.pos;t(i,this);var r=this.pos-e,s=127>=r?1:16383>=r?2:2097151>=r?3:268435455>=r?4:Math.ceil(Math.log(r)/(7*Math.LN2));if(s>1){this.realloc(s-1);for(var n=this.pos-1;n>=e;n--)this.buf[n+s-1]=this.buf[n]}this.pos=e-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,i,e){this.writeTag(t,Pbf.Bytes),this.writeRawMessage(i,e)},writePackedVarint:function(t,i){this.writeMessage(t,writePackedVarint,i)},writePackedSVarint:function(t,i){this.writeMessage(t,writePackedSVarint,i)},writePackedBoolean:function(t,i){this.writeMessage(t,writePackedBoolean,i)},writePackedFloat:function(t,i){this.writeMessage(t,writePackedFloat,i)},writePackedDouble:function(t,i){this.writeMessage(t,writePackedDouble,i)},writePackedFixed32:function(t,i){this.writeMessage(t,writePackedFixed32,i)},writePackedSFixed32:function(t,i){this.writeMessage(t,writePackedSFixed32,i)},writePackedFixed64:function(t,i){this.writeMessage(t,writePackedFixed64,i)},writePackedSFixed64:function(t,i){this.writeMessage(t,writePackedSFixed64,i)},writeBytesField:function(t,i){this.writeTag(t,Pbf.Bytes),this.writeBytes(i)},writeFixed32Field:function(t,i){this.writeTag(t,Pbf.Fixed32),this.writeFixed32(i)},writeSFixed32Field:function(t,i){this.writeTag(t,Pbf.Fixed32),this.writeSFixed32(i)},writeFixed64Field:function(t,i){this.writeTag(t,Pbf.Fixed64),this.writeFixed64(i)},writeSFixed64Field:function(t,i){this.writeTag(t,Pbf.Fixed64),this.writeSFixed64(i)},writeVarintField:function(t,i){this.writeTag(t,Pbf.Varint),this.writeVarint(i)},writeSVarintField:function(t,i){this.writeTag(t,Pbf.Varint),this.writeSVarint(i)},writeStringField:function(t,i){this.writeTag(t,Pbf.Bytes),this.writeString(i)},writeFloatField:function(t,i){this.writeTag(t,Pbf.Fixed32),this.writeFloat(i)},writeDoubleField:function(t,i){this.writeTag(t,Pbf.Fixed64),this.writeDouble(i)},writeBooleanField:function(t,i){this.writeVarintField(t,Boolean(i))}};\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"./buffer\":126}],128:[function(require,module,exports){\n\"use strict\";function Point(t,n){this.x=t,this.y=n}module.exports=Point,Point.prototype={clone:function(){return new Point(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var n=t.x-this.x,i=t.y-this.y;return n*n+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult:function(t){var n=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=i,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var n=Math.cos(t),i=Math.sin(t),s=n*this.x-i*this.y,r=i*this.x+n*this.y;return this.x=s,this.y=r,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Point.convert=function(t){return t instanceof Point?t:Array.isArray(t)?new Point(t[0],t[1]):t};\n},{}],129:[function(require,module,exports){\nfunction cleanUpNextTick(){draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue()}function drainQueue(){if(!draining){var e=setTimeout(cleanUpNextTick);draining=!0;for(var n=queue.length;n;){for(currentQueue=queue,queue=[];++queueIndex<n;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,n=queue.length}currentQueue=null,draining=!1,clearTimeout(e)}}function Item(e,n){this.fun=e,this.array=n}function noop(){}var process=module.exports={},queue=[],draining=!1,currentQueue,queueIndex=-1;process.nextTick=function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)n[r-1]=arguments[r];queue.push(new Item(e,n)),1!==queue.length||draining||setTimeout(drainQueue,0)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title=\"browser\",process.browser=!0,process.env={},process.argv=[],process.version=\"\",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.binding=function(e){throw new Error(\"process.binding is not supported\")},process.cwd=function(){return\"/\"},process.chdir=function(e){throw new Error(\"process.chdir is not supported\")},process.umask=function(){return 0};\n},{}],130:[function(require,module,exports){\n!function(){\"use strict\";function t(i,n){return this instanceof t?(this._maxEntries=Math.max(4,i||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&this._initFormat(n),void this.clear()):new t(i,n)}function i(t,i){t.bbox=n(t,0,t.children.length,i)}function n(t,i,n,r){for(var o,a=e(),s=i;n>s;s++)o=t.children[s],h(a,t.leaf?r(o):o.bbox);return a}function e(){return[1/0,1/0,-(1/0),-(1/0)]}function h(t,i){return t[0]=Math.min(t[0],i[0]),t[1]=Math.min(t[1],i[1]),t[2]=Math.max(t[2],i[2]),t[3]=Math.max(t[3],i[3]),t}function r(t,i){return t.bbox[0]-i.bbox[0]}function o(t,i){return t.bbox[1]-i.bbox[1]}function a(t){return(t[2]-t[0])*(t[3]-t[1])}function s(t){return t[2]-t[0]+(t[3]-t[1])}function l(t,i){return(Math.max(i[2],t[2])-Math.min(i[0],t[0]))*(Math.max(i[3],t[3])-Math.min(i[1],t[1]))}function u(t,i){var n=Math.max(t[0],i[0]),e=Math.max(t[1],i[1]),h=Math.min(t[2],i[2]),r=Math.min(t[3],i[3]);return Math.max(0,h-n)*Math.max(0,r-e)}function c(t,i){return t[0]<=i[0]&&t[1]<=i[1]&&i[2]<=t[2]&&i[3]<=t[3]}function f(t,i){return i[0]<=t[2]&&i[1]<=t[3]&&i[2]>=t[0]&&i[3]>=t[1]}function d(t,i,n,e,h){for(var r,o=[i,n];o.length;)n=o.pop(),i=o.pop(),e>=n-i||(r=i+Math.ceil((n-i)/e/2)*e,x(t,i,n,r,h),o.push(i,r,r,n))}function x(t,i,n,e,h){for(var r,o,a,s,l,u,c,f,d;n>i;){for(n-i>600&&(r=n-i+1,o=e-i+1,a=Math.log(r),s=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*s*(r-s)/r)*(0>o-r/2?-1:1),u=Math.max(i,Math.floor(e-o*s/r+l)),c=Math.min(n,Math.floor(e+(r-o)*s/r+l)),x(t,u,c,e,h)),f=t[e],o=i,d=n,p(t,i,e),h(t[n],f)>0&&p(t,i,n);d>o;){for(p(t,o,d),o++,d--;h(t[o],f)<0;)o++;for(;h(t[d],f)>0;)d--}0===h(t[i],f)?p(t,i,d):(d++,p(t,d,n)),e>=d&&(i=d+1),d>=e&&(n=d-1)}}function p(t,i,n){var e=t[i];t[i]=t[n],t[n]=e}t.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,n=[],e=this.toBBox;if(!f(t,i.bbox))return n;for(var h,r,o,a,s=[];i;){for(h=0,r=i.children.length;r>h;h++)o=i.children[h],a=i.leaf?e(o):o.bbox,f(t,a)&&(i.leaf?n.push(o):c(t,a)?this._all(o,n):s.push(o));i=s.pop()}return n},collides:function(t){var i=this.data,n=this.toBBox;if(!f(t,i.bbox))return!1;for(var e,h,r,o,a=[];i;){for(e=0,h=i.children.length;h>e;e++)if(r=i.children[e],o=i.leaf?n(r):r.bbox,f(t,o)){if(i.leaf||c(t,o))return!0;a.push(r)}i=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0,n=t.length;n>i;i++)this.insert(t[i]);return this}var e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){var h=this.data;this.data=e,e=h}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data={children:[],height:1,bbox:e(),leaf:!0},this},remove:function(t){if(!t)return this;for(var i,n,e,h,r=this.data,o=this.toBBox(t),a=[],s=[];r||a.length;){if(r||(r=a.pop(),n=a[a.length-1],i=s.pop(),h=!0),r.leaf&&(e=r.children.indexOf(t),-1!==e))return r.children.splice(e,1),a.push(r),this._condense(a),this;h||r.leaf||!c(r.bbox,o)?n?(i++,r=n.children[i],h=!1):r=null:(a.push(r),s.push(i),i=0,n=r,r=r.children[0])}return this},toBBox:function(t){return t},compareMinX:function(t,i){return t[0]-i[0]},compareMinY:function(t,i){return t[1]-i[1]},toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,i){for(var n=[];t;)t.leaf?i.push.apply(i,t.children):n.push.apply(n,t.children),t=n.pop();return i},_build:function(t,n,e,h){var r,o=e-n+1,a=this._maxEntries;if(a>=o)return r={children:t.slice(n,e+1),height:1,bbox:null,leaf:!0},i(r,this.toBBox),r;h||(h=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,h-1))),r={children:[],height:h,bbox:null};var s,l,u,c,f=Math.ceil(o/a),x=f*Math.ceil(Math.sqrt(a));for(d(t,n,e,x,this.compareMinX),s=n;e>=s;s+=x)for(u=Math.min(s+x-1,e),d(t,s,u,f,this.compareMinY),l=s;u>=l;l+=f)c=Math.min(l+f-1,u),r.children.push(this._build(t,l,c,h-1));return i(r,this.toBBox),r},_chooseSubtree:function(t,i,n,e){for(var h,r,o,s,u,c,f,d;;){if(e.push(i),i.leaf||e.length-1===n)break;for(f=d=1/0,h=0,r=i.children.length;r>h;h++)o=i.children[h],u=a(o.bbox),c=l(t,o.bbox)-u,d>c?(d=c,f=f>u?u:f,s=o):c===d&&f>u&&(f=u,s=o);i=s}return i},_insert:function(t,i,n){var e=this.toBBox,r=n?t.bbox:e(t),o=[],a=this._chooseSubtree(r,this.data,i,o);for(a.children.push(t),h(a.bbox,r);i>=0&&o[i].children.length>this._maxEntries;)this._split(o,i),i--;this._adjustParentBBoxes(r,o,i)},_split:function(t,n){var e=t[n],h=e.children.length,r=this._minEntries;this._chooseSplitAxis(e,r,h);var o=this._chooseSplitIndex(e,r,h),a={children:e.children.splice(o,e.children.length-o),height:e.height};e.leaf&&(a.leaf=!0),i(e,this.toBBox),i(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(e,a)},_splitRoot:function(t,n){this.data={children:[t,n],height:t.height+1},i(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,e){var h,r,o,s,l,c,f,d;for(c=f=1/0,h=i;e-i>=h;h++)r=n(t,0,h,this.toBBox),o=n(t,h,e,this.toBBox),s=u(r,o),l=a(r)+a(o),c>s?(c=s,d=h,f=f>l?l:f):s===c&&f>l&&(f=l,d=h);return d},_chooseSplitAxis:function(t,i,n){var e=t.leaf?this.compareMinX:r,h=t.leaf?this.compareMinY:o,a=this._allDistMargin(t,i,n,e),s=this._allDistMargin(t,i,n,h);s>a&&t.children.sort(e)},_allDistMargin:function(t,i,e,r){t.children.sort(r);var o,a,l=this.toBBox,u=n(t,0,i,l),c=n(t,e-i,e,l),f=s(u)+s(c);for(o=i;e-i>o;o++)a=t.children[o],h(u,t.leaf?l(a):a.bbox),f+=s(u);for(o=e-i-1;o>=i;o--)a=t.children[o],h(c,t.leaf?l(a):a.bbox),f+=s(c);return f},_adjustParentBBoxes:function(t,i,n){for(var e=n;e>=0;e--)h(i[e].bbox,t)},_condense:function(t){for(var n,e=t.length-1;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():i(t[e],this.toBBox)},_initFormat:function(t){var i=[\"return a\",\" - b\",\";\"];this.compareMinX=new Function(\"a\",\"b\",i.join(t[0])),this.compareMinY=new Function(\"a\",\"b\",i.join(t[1])),this.toBBox=new Function(\"a\",\"return [a\"+t.join(\", a\")+\"];\")}},\"function\"==typeof define&&define.amd?define(\"rbush\",function(){return t}):\"undefined\"!=typeof module?module.exports=t:\"undefined\"!=typeof self?self.rbush=t:window.rbush=t}();\n},{}],131:[function(require,module,exports){\nvoid function(e,r){\"function\"==typeof define&&define.amd?define(r):\"object\"==typeof exports?module.exports=r():e.resolveUrl=r()}(this,function(){function e(){var e=arguments.length;if(0===e)throw new Error(\"resolveUrl requires at least one argument; got none.\");var r=document.createElement(\"base\");if(r.href=arguments[0],1===e)return r.href;var t=document.getElementsByTagName(\"head\")[0];t.insertBefore(r,t.firstChild);for(var n,o=document.createElement(\"a\"),f=1;e>f;f++)o.href=arguments[f],n=o.href,r.href=n;return t.removeChild(r),n}return e});\n},{}],132:[function(require,module,exports){\nfunction UnitBezier(t,i,e,r){this.cx=3*t,this.bx=3*(e-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(r-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=e,this.p2y=r}module.exports=UnitBezier,UnitBezier.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},UnitBezier.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},UnitBezier.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},UnitBezier.prototype.solveCurveX=function(t,i){\"undefined\"==typeof i&&(i=1e-6);var e,r,s,h,n;for(s=t,n=0;8>n;n++){if(h=this.sampleCurveX(s)-t,Math.abs(h)<i)return s;var u=this.sampleCurveDerivativeX(s);if(Math.abs(u)<1e-6)break;s-=h/u}if(e=0,r=1,s=t,e>s)return e;if(s>r)return r;for(;r>e;){if(h=this.sampleCurveX(s),Math.abs(h-t)<i)return s;t>h?e=s:r=s,s=.5*(r-e)+e}return s},UnitBezier.prototype.solve=function(t,i){return this.sampleCurveY(this.solveCurveX(t,i))};\n},{}],133:[function(require,module,exports){\nmodule.exports=function(o){return o&&\"object\"==typeof o&&\"function\"==typeof o.copy&&\"function\"==typeof o.fill&&\"function\"==typeof o.readUInt8};\n},{}],134:[function(require,module,exports){\n(function (process,global){\nfunction inspect(e,r){var t={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),isBoolean(r)?t.showHidden=r:r&&exports._extend(t,r),isUndefined(t.showHidden)&&(t.showHidden=!1),isUndefined(t.depth)&&(t.depth=2),isUndefined(t.colors)&&(t.colors=!1),isUndefined(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=stylizeWithColor),formatValue(t,e,t.depth)}function stylizeWithColor(e,r){var t=inspect.styles[r];return t?\"\u001b[\"+inspect.colors[t][0]+\"m\"+e+\"\u001b[\"+inspect.colors[t][1]+\"m\":e}function stylizeNoColor(e,r){return e}function arrayToHash(e){var r={};return e.forEach(function(e,t){r[e]=!0}),r}function formatValue(e,r,t){if(e.customInspect&&r&&isFunction(r.inspect)&&r.inspect!==exports.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(t,e);return isString(n)||(n=formatValue(e,n,t)),n}var i=formatPrimitive(e,r);if(i)return i;var o=Object.keys(r),s=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),isError(r)&&(o.indexOf(\"message\")>=0||o.indexOf(\"description\")>=0))return formatError(r);if(0===o.length){if(isFunction(r)){var u=r.name?\": \"+r.name:\"\";return e.stylize(\"[Function\"+u+\"]\",\"special\")}if(isRegExp(r))return e.stylize(RegExp.prototype.toString.call(r),\"regexp\");if(isDate(r))return e.stylize(Date.prototype.toString.call(r),\"date\");if(isError(r))return formatError(r)}var a=\"\",c=!1,l=[\"{\",\"}\"];if(isArray(r)&&(c=!0,l=[\"[\",\"]\"]),isFunction(r)){var p=r.name?\": \"+r.name:\"\";a=\" [Function\"+p+\"]\"}if(isRegExp(r)&&(a=\" \"+RegExp.prototype.toString.call(r)),isDate(r)&&(a=\" \"+Date.prototype.toUTCString.call(r)),isError(r)&&(a=\" \"+formatError(r)),0===o.length&&(!c||0==r.length))return l[0]+a+l[1];if(0>t)return isRegExp(r)?e.stylize(RegExp.prototype.toString.call(r),\"regexp\"):e.stylize(\"[Object]\",\"special\");e.seen.push(r);var f;return f=c?formatArray(e,r,t,s,o):o.map(function(n){return formatProperty(e,r,t,s,n,c)}),e.seen.pop(),reduceToSingleString(f,a,l)}function formatPrimitive(e,r){if(isUndefined(r))return e.stylize(\"undefined\",\"undefined\");if(isString(r)){var t=\"'\"+JSON.stringify(r).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return e.stylize(t,\"string\")}return isNumber(r)?e.stylize(\"\"+r,\"number\"):isBoolean(r)?e.stylize(\"\"+r,\"boolean\"):isNull(r)?e.stylize(\"null\",\"null\"):void 0}function formatError(e){return\"[\"+Error.prototype.toString.call(e)+\"]\"}function formatArray(e,r,t,n,i){for(var o=[],s=0,u=r.length;u>s;++s)hasOwnProperty(r,String(s))?o.push(formatProperty(e,r,t,n,String(s),!0)):o.push(\"\");return i.forEach(function(i){i.match(/^\\d+$/)||o.push(formatProperty(e,r,t,n,i,!0))}),o}function formatProperty(e,r,t,n,i,o){var s,u,a;if(a=Object.getOwnPropertyDescriptor(r,i)||{value:r[i]},a.get?u=a.set?e.stylize(\"[Getter/Setter]\",\"special\"):e.stylize(\"[Getter]\",\"special\"):a.set&&(u=e.stylize(\"[Setter]\",\"special\")),hasOwnProperty(n,i)||(s=\"[\"+i+\"]\"),u||(e.seen.indexOf(a.value)<0?(u=isNull(t)?formatValue(e,a.value,null):formatValue(e,a.value,t-1),u.indexOf(\"\\n\")>-1&&(u=o?u.split(\"\\n\").map(function(e){return\" \"+e}).join(\"\\n\").substr(2):\"\\n\"+u.split(\"\\n\").map(function(e){return\" \"+e}).join(\"\\n\"))):u=e.stylize(\"[Circular]\",\"special\")),isUndefined(s)){if(o&&i.match(/^\\d+$/))return u;s=JSON.stringify(\"\"+i),s.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,\"name\")):(s=s.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),s=e.stylize(s,\"string\"))}return s+\": \"+u}function reduceToSingleString(e,r,t){var n=0,i=e.reduce(function(e,r){return n++,r.indexOf(\"\\n\")>=0&&n++,e+r.replace(/\\u001b\\[\\d\\d?m/g,\"\").length+1},0);return i>60?t[0]+(\"\"===r?\"\":r+\"\\n \")+\" \"+e.join(\",\\n \")+\" \"+t[1]:t[0]+r+\" \"+e.join(\", \")+\" \"+t[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return\"boolean\"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return\"number\"==typeof e}function isString(e){return\"string\"==typeof e}function isSymbol(e){return\"symbol\"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&\"[object RegExp]\"===objectToString(e)}function isObject(e){return\"object\"==typeof e&&null!==e}function isDate(e){return isObject(e)&&\"[object Date]\"===objectToString(e)}function isError(e){return isObject(e)&&(\"[object Error]\"===objectToString(e)||e instanceof Error)}function isFunction(e){return\"function\"==typeof e}function isPrimitive(e){return null===e||\"boolean\"==typeof e||\"number\"==typeof e||\"string\"==typeof e||\"symbol\"==typeof e||\"undefined\"==typeof e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return 10>e?\"0\"+e.toString(10):e.toString(10)}function timestamp(){var e=new Date,r=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(\":\");return[e.getDate(),months[e.getMonth()],r].join(\" \")}function hasOwnProperty(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var formatRegExp=/%[sdj%]/g;exports.format=function(e){if(!isString(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(inspect(arguments[t]));return r.join(\" \")}for(var t=1,n=arguments,i=n.length,o=String(e).replace(formatRegExp,function(e){if(\"%%\"===e)return\"%\";if(t>=i)return e;switch(e){case\"%s\":return String(n[t++]);case\"%d\":return Number(n[t++]);case\"%j\":try{return JSON.stringify(n[t++])}catch(r){return\"[Circular]\"}default:return e}}),s=n[t];i>t;s=n[++t])o+=isNull(s)||!isObject(s)?\" \"+s:\" \"+inspect(s);return o},exports.deprecate=function(e,r){function t(){if(!n){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),n=!0}return e.apply(this,arguments)}if(isUndefined(global.process))return function(){return exports.deprecate(e,r).apply(this,arguments)};if(process.noDeprecation===!0)return e;var n=!1;return t};var debugs={},debugEnviron;exports.debuglog=function(e){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||\"\"),e=e.toUpperCase(),!debugs[e])if(new RegExp(\"\\\\b\"+e+\"\\\\b\",\"i\").test(debugEnviron)){var r=process.pid;debugs[e]=function(){var t=exports.format.apply(exports,arguments);console.error(\"%s %d: %s\",e,r,t)}}else debugs[e]=function(){};return debugs[e]},exports.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:\"cyan\",number:\"yellow\",\"boolean\":\"yellow\",undefined:\"grey\",\"null\":\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=require(\"./support/isBuffer\");var months=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];exports.log=function(){console.log(\"%s - %s\",timestamp(),exports.format.apply(exports,arguments))},exports.inherits=require(\"inherits\"),exports._extend=function(e,r){if(!r||!isObject(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e};\n}).call(this,require('_process'),typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"./support/isBuffer\":133,\"_process\":129,\"inherits\":116}],135:[function(require,module,exports){\nmodule.exports.VectorTile=require(\"./lib/vectortile.js\"),module.exports.VectorTileFeature=require(\"./lib/vectortilefeature.js\"),module.exports.VectorTileLayer=require(\"./lib/vectortilelayer.js\");\n},{\"./lib/vectortile.js\":136,\"./lib/vectortilefeature.js\":137,\"./lib/vectortilelayer.js\":138}],136:[function(require,module,exports){\n\"use strict\";function VectorTile(e,r){this.layers=e.readFields(readTile,{},r)}function readTile(e,r,i){if(3===e){var t=new VectorTileLayer(i,i.readVarint()+i.pos);t.length&&(r[t.name]=t)}}var VectorTileLayer=require(\"./vectortilelayer\");module.exports=VectorTile;\n},{\"./vectortilelayer\":138}],137:[function(require,module,exports){\n\"use strict\";function VectorTileFeature(e,t,r,i,o){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,e.readFields(readFeature,this,t)}function readFeature(e,t,r){1==e?t._id=r.readVarint():2==e?readTag(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function readTag(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var i=t._keys[e.readVarint()],o=t._values[e.readVarint()];t.properties[i]=o}}var Point=require(\"point-geometry\");module.exports=VectorTileFeature,VectorTileFeature.types=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"],VectorTileFeature.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,i=1,o=0,a=0,n=0,s=[];e.pos<r;){if(!o){var p=e.readVarint();i=7&p,o=p>>3}if(o--,1===i||2===i)a+=e.readSVarint(),n+=e.readSVarint(),1===i&&(t&&s.push(t),t=[]),t.push(new Point(a,n));else{if(7!==i)throw new Error(\"unknown command \"+i);t&&t.push(t[0].clone())}}return t&&s.push(t),s},VectorTileFeature.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,i=0,o=0,a=0,n=1/0,s=-(1/0),p=1/0,h=-(1/0);e.pos<t;){if(!i){var u=e.readVarint();r=7&u,i=u>>3}if(i--,1===r||2===r)o+=e.readSVarint(),a+=e.readSVarint(),n>o&&(n=o),o>s&&(s=o),p>a&&(p=a),a>h&&(h=a);else if(7!==r)throw new Error(\"unknown command \"+r)}return[n,p,s,h]},VectorTileFeature.prototype.toGeoJSON=function(e,t,r){for(var i=this.extent*Math.pow(2,r),o=this.extent*e,a=this.extent*t,n=this.loadGeometry(),s=VectorTileFeature.types[this.type],p=0;p<n.length;p++)for(var h=n[p],u=0;u<h.length;u++){var d=h[u],l=180-360*(d.y+a)/i;h[u]=[360*(d.x+o)/i-180,360/Math.PI*Math.atan(Math.exp(l*Math.PI/180))-90]}\"Point\"===s&&1===n.length?n=n[0][0]:\"Point\"===s?(n=n[0],s=\"MultiPoint\"):\"LineString\"===s&&1===n.length?n=n[0]:\"LineString\"===s&&(s=\"MultiLineString\");var y={type:\"Feature\",geometry:{type:s,coordinates:n},properties:this.properties};return\"_id\"in this&&(y.id=this._id),y};\n},{\"point-geometry\":139}],138:[function(require,module,exports){\n\"use strict\";function VectorTileLayer(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(readLayer,this,t),this.length=this._features.length}function readLayer(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(readValueMessage(r))}function readValueMessage(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var a=e.readVarint()>>3;t=1===a?e.readString():2===a?e.readFloat():3===a?e.readDouble():4===a?e.readVarint64():5===a?e.readVarint():6===a?e.readSVarint():7===a?e.readBoolean():null}return t}var VectorTileFeature=require(\"./vectortilefeature.js\");module.exports=VectorTileLayer,VectorTileLayer.prototype.feature=function(e){if(0>e||e>=this._features.length)throw new Error(\"feature index out of bounds\");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new VectorTileFeature(this._pbf,t,this.extent,this._keys,this._values)};\n},{\"./vectortilefeature.js\":137}],139:[function(require,module,exports){\narguments[4][128][0].apply(exports,arguments)\n},{\"dup\":128}],140:[function(require,module,exports){\nvar bundleFn=arguments[3],sources=arguments[4],cache=arguments[5],stringify=JSON.stringify;module.exports=function(r){for(var e,t=Object.keys(cache),n=0,o=t.length;o>n;n++){var i=t[n];if(cache[i].exports===r){e=i;break}}if(!e){e=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var s={},n=0,o=t.length;o>n;n++){var i=t[n];s[i]=i}sources[e]=[Function([\"require\",\"module\",\"exports\"],\"(\"+r+\")(self)\"),s]}var a=Math.floor(Math.pow(16,8)*Math.random()).toString(16),u={};u[e]=e,sources[a]=[Function([\"require\"],\"require(\"+stringify(e)+\")(self)\"),u];var c=\"(\"+bundleFn+\")({\"+Object.keys(sources).map(function(r){return stringify(r)+\":[\"+sources[r][0]+\",\"+stringify(sources[r][1])+\"]\"}).join(\",\")+\"},{},[\"+stringify(a)+\"])\",f=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(f.createObjectURL(new Blob([c],{type:\"text/javascript\"})))};\n},{}]},{},[14])(14)\n});\n\n\n//# sourceMappingURL=mapbox-gl.js.map" + +/***/ } +/******/ ]);
\ No newline at end of file diff --git a/style.scss b/style.scss new file mode 100644 index 0000000..03ac75c --- /dev/null +++ b/style.scss @@ -0,0 +1,38 @@ +body { + margin:0; + padding:0; + #datetime { + position:fixed; + color: #ee8877; + z-index: 100; + font-family: monospace; + padding: 5px; + } + #date { + font-size: 0.7em; + } + #map { + position:absolute; + top:0; + bottom:0; + width:100%; + } + .rc-slider { + position: fixed; + bottom: 50px; + width: 80%; + margin: 0 auto; + margin-left: 10%; + .rc-slider-handle { + border: 2px solid #bababa; + background-color: #bababa; + margin-left: -12px; + margin-top: -13px; + width: 30px; + height: 30px; + } + .rc-slider-track { + background-color: #bababa; + } + } +} diff --git a/templates/index.html b/templates/index.html index 12d8129..052b318 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4,14 +4,6 @@ <meta charset='utf-8' /> <title>geshem.space</title> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> - <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.2/mapbox-gl.js'></script> - <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.2/mapbox-gl.css' rel='stylesheet' /> - <style> - body { margin:0; padding:0; } - #datetime { position:fixed; color: #ee8877; z-index: 100; font-family: monospace; padding: 5px; } - #date { font-size: 0.7em; } - #map { position:absolute; top:0; bottom:0; width:100%; } - </style> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), @@ -23,156 +15,10 @@ </script> </head> <body> - -<div id='datetime'> - <div id='date'>{{ ts.strftime('%d/%m/%Y') }}</div> - <div id='hour'>{{ ts.strftime('%H:%M') }}</div> -</div> -<div id='map'></div> -<script> - -mapboxgl.accessToken = 'pk.eyJ1IjoieXV2YWRtIiwiYSI6ImNpaWRuaWFxazAwMTJ2b2tyZGRmaWpsNWYifQ.qf_V3CFP_NZtLjk5luNM4g'; -var mapStyle = { - "version": 8, - "name": "Dark", - "sources": { - "mapbox": { - "type": "vector", - "url": "mapbox://mapbox.mapbox-streets-v6" - }, - "radar_140": { - "type": "image", - "url": "/static/{{ latest_140 }}_140.png", - "coordinates": [ - [33.35317413, 33.27232471], - [36.32243686, 33.27232471], - [36.32243686, 30.72293428], - [33.35317413, 30.72293428] - ] - }, - "radar_280": { - "type": "image", - "url": "/static/{{ latest_280 }}_280.png", - "coordinates": [ - [31.93095218, 34.5156862], - [37.86644267, 34.5156862], - [37.86644267, 29.42911589], - [31.93095218, 29.42911589] - ] - } - }, - "sprite": "mapbox://sprites/mapbox/dark-v8", - "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf", - "layers": [ - { - "id": "background", - "type": "background", - "paint": {"background-color": "#111"} - }, - { - "id": "boundaries", - "source": "mapbox", - "source-layer": "admin", - "type": "line", - "paint": {"line-color": "#797979"}, - "filter": ["all", ["<=", "admin_level", 2], ['==', 'maritime', 0]] - }, - { - "id": "water", - "source": "mapbox", - "source-layer": "water", - "type": "line", - "paint": {"line-color": "#797979"} - }, - { - "id": "water2", - "source": "mapbox", - "source-layer": "water", - "type": "fill", - "paint": {"fill-color": "#111122"} - }, - { - "id": "radar_140", - "source": "radar_140", - "type": "raster", - "paint": { - "raster-opacity": 0.85 - }, - "layout": { - "visibility": "none" - } - }, - { - "id": "radar_280", - "source": "radar_280", - "type": "raster", - "paint": { - "raster-opacity": 0.85 - } - }, - { - "id": "cities", - "source": "mapbox", - "source-layer": "place_label", - "type": "symbol", - "filter": ["all", ["<=", "localrank", 6]], - "layout": { - "text-field": "{name_en}", - "text-font": ["DIN Offc Pro Bold", "Arial Unicode MS Bold"], - "text-size": {"stops": [[4, 9], [6, 12]]} - }, - "paint": { - "text-color": "#969696", - "text-halo-width": 2, - "text-halo-color": "rgba(0, 0, 0, 0.85)" - } - }, - { - "id": "states", - "source": "mapbox", - "source-layer": "state_label", - "type": "symbol", - "layout": { - "text-transform": "uppercase", - "text-field": "{name_en}", - "text-font": ["DIN Offc Pro Bold", "Arial Unicode MS Bold"], - "text-letter-spacing": 0.15, - "text-max-width": 7, - "text-size": {"stops": [[4, 10], [6, 14]]} - }, - "filter": [">=", "area", 80000], - "paint": { - "text-color": "#969696", - "text-halo-width": 2, - "text-halo-color": "rgba(0, 0, 0, 0.85)" - } - } - ] -}; - -var map = new mapboxgl.Map({ - container: 'map', - maxZoom: 10, - minZoom: 5, - zoom: 6.3, - center: [35, 31.9], - style: mapStyle, - hash: false -}); - -map.on('zoom', function (x) { - var zoom = map.getZoom(); - if (zoom > 7) { - map.getLayer('radar_140').layout.visibility='visible'; - map.getLayer('radar_280').layout.visibility='none'; - } - else { - map.getLayer('radar_140').layout.visibility='none'; - map.getLayer('radar_280').layout.visibility='visible'; - } -}) - -</script> - + <div id='root'></div> + <script> + window.imgs = {{ imgs|safe }}; + </script> + <script src='/static/js/bundle.js'></script> </body> </html> diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..87ad43b --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,14 @@ +module.exports = { + entry: './geshem.js', + output: { + path: __dirname, + filename: 'static/js/bundle.js', + }, + module: { + loaders: [ + { test: /\.js$/, exclude: /node_modules/, loader: 'babel?presets[]=react,presets[]=es2015,presets[]=stage-0' }, + { test: /\.css$/, loader: 'style!css' }, + { test: /\.scss$/, loader: 'style!css!sass' } + ] + } +}
\ No newline at end of file |
