From 7678f99134dee405efdf7e4983ad425139996cff Mon Sep 17 00:00:00 2001 From: Rye Terrell Date: Thu, 17 Dec 2015 19:24:35 -0600 Subject: [PATCH 01/16] refactor docs - navigable and easy-to-add examples --- .../code-snippet.react.js | 9 +- markdown.js => common/markdown.js | 0 .../stamen-map-style.js | 0 .../draggable-points-overlay.md | 3 + content/draggable-points/draggable-points.js | 129 ++++++++++ content/getting-started/getting-started.js | 72 ++++++ .../getting-started/getting-started.md | 8 +- .../scatterplot}/locations-snippet.txt | 0 content/scatterplot/scatterplot-example.md | 3 + content/scatterplot/scatterplot.js | 114 +++++++++ .../third-party-overlay}/overlay-props.txt | 0 .../third-party-overlay-example.md | 0 .../third-party-overlay.js | 110 +++++++++ .../third-party-overlays.md | 5 + css.js | 44 ---- index.css | 95 ++++++++ index.html | 29 ++- index.js | 220 ++---------------- package.json | 14 +- sidebar.js | 83 +++++++ text/draggable-points-overlay.md | 3 - text/scatterplot-example.md | 1 - text/third-party-overlays.md | 5 - 23 files changed, 673 insertions(+), 274 deletions(-) rename code-snippet.react.js => common/code-snippet.react.js (88%) rename markdown.js => common/markdown.js (100%) rename stamen-map-style.js => common/stamen-map-style.js (100%) create mode 100644 content/draggable-points/draggable-points-overlay.md create mode 100644 content/draggable-points/draggable-points.js create mode 100644 content/getting-started/getting-started.js rename text/introductions.md => content/getting-started/getting-started.md (82%) rename {text => content/scatterplot}/locations-snippet.txt (100%) create mode 100644 content/scatterplot/scatterplot-example.md create mode 100644 content/scatterplot/scatterplot.js rename {text => content/third-party-overlay}/overlay-props.txt (100%) rename {text => content/third-party-overlay}/third-party-overlay-example.md (100%) create mode 100644 content/third-party-overlay/third-party-overlay.js create mode 100644 content/third-party-overlay/third-party-overlays.md delete mode 100644 css.js create mode 100644 index.css create mode 100644 sidebar.js delete mode 100644 text/draggable-points-overlay.md delete mode 100644 text/scatterplot-example.md delete mode 100644 text/third-party-overlays.md diff --git a/code-snippet.react.js b/common/code-snippet.react.js similarity index 88% rename from code-snippet.react.js rename to common/code-snippet.react.js index 51ba131c5..b997e128f 100644 --- a/code-snippet.react.js +++ b/common/code-snippet.react.js @@ -20,8 +20,9 @@ 'use strict'; var r = require('r-dom'); -var React = require('react/addons'); -var PureRenderMixin = React.addons.PureRenderMixin; +var React = require('react'); +var ReactDOM = require('react-dom'); +var PureRenderMixin = require('react-addons-pure-render-mixin'); var hljs = require('highlight.js'); var d3 = require('d3'); @@ -35,7 +36,7 @@ module.exports = React.createClass({ }, _updateHighlight: function _updateHighlight() { - var code = d3.select(this.getDOMNode()).select('code').node(); + var code = d3.select(ReactDOM.findDOMNode(this.refs.code)).node(); hljs.highlightBlock(code); }, @@ -48,7 +49,7 @@ module.exports = React.createClass({ }, render: function render() { - return r.pre({}, [ + return r.pre({ref: 'code'}, [ r.code({className: this.props.language}, this.props.text) ]); } diff --git a/markdown.js b/common/markdown.js similarity index 100% rename from markdown.js rename to common/markdown.js diff --git a/stamen-map-style.js b/common/stamen-map-style.js similarity index 100% rename from stamen-map-style.js rename to common/stamen-map-style.js diff --git a/content/draggable-points/draggable-points-overlay.md b/content/draggable-points/draggable-points-overlay.md new file mode 100644 index 000000000..e7f0fc312 --- /dev/null +++ b/content/draggable-points/draggable-points-overlay.md @@ -0,0 +1,3 @@ +# Draggable Points Overlay + +Test \ No newline at end of file diff --git a/content/draggable-points/draggable-points.js b/content/draggable-points/draggable-points.js new file mode 100644 index 000000000..b78fcdb5e --- /dev/null +++ b/content/draggable-points/draggable-points.js @@ -0,0 +1,129 @@ +// Copyright (c) 2015 Uber Technologies, Inc. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +'use strict'; + +var assign = require('object-assign'); +var alphaify = require('alphaify'); +var r = require('r-dom'); +var React = require('react'); +var fs = require('fs'); +var MapGL = require('react-map-gl'); +var d3 = require('d3'); +var Immutable = require('immutable'); + +var DraggablePoints = require('react-map-gl/src/overlays/draggable-points.react'); + +var stamenMapStyle = require('../../common/stamen-map-style'); +var CodeSnippet = require('../../common/code-snippet.react'); +var Markdown = require('../../common/markdown'); + +var initialPoints = [ + {location: [37.79450507471435, -122.39508481737994], id: 0}, + {location: [37.79227619464379, -122.39750244137034], id: 1}, + {location: [37.789251178427776, -122.4013303460217], id: 2}, + {location: [37.786862920252986, -122.40475531334141], id: 3}, + {location: [37.78861431712821, -122.40505751634022], id: 4}, + {location: [37.79060449046487, -122.40556118800487], id: 5}, + {location: [37.790047247333675, -122.4088854209916], id: 6}, + {location: [37.79275381746233, -122.4091876239904], id: 7}, + {location: [37.795619489534374, -122.40989276432093], id: 8}, + {location: [37.79792786675678, -122.41049717031848], id: 9}, + {location: [37.80031576728801, -122.4109001076502], id: 10}, + {location: [37.79920142331301, -122.41916032295062], id: 11} +]; + +var pointIds = initialPoints[initialPoints.length - 1].id; + +module.exports = React.createClass({ + + getInitialState: function getInitialState() { + var normal = d3.random.normal(); + function wiggle(scale) { + return normal() * scale; + } + return { + map: { + latitude: 37.78, + longitude: -122.45, + zoom: 11, + mapStyle: stamenMapStyle, + width: 700, + height: 450, + startDragLatLng: null + }, + draggablePoints: Immutable.fromJS(initialPoints), + }; + }, + + _onAddPoint: function _onAddPoint(_location) { + var points = this.state.draggablePoints.push(new Immutable.Map({ + location: new Immutable.List(_location), + id: ++pointIds + })); + this.setState({draggablePoints: points}); + }, + + _onUpdatePoint: function _onUpdatePoint(opt) { + var index = this.state.draggablePoints.findIndex(function filter(p) { + return p.get('id') === opt.key; + }); + var point = this.state.draggablePoints.get(index); + point = point.set('location', new Immutable.List(opt.location)); + var points = this.state.draggablePoints.set(index, point); + this.setState({draggablePoints: points}); + }, + + _onChangeViewport: function _onChangeViewport(opt) { + this.setState({map: assign({}, this.state.map, opt)}); + }, + + render: function render() { + return r.div([ + r(Markdown, { + text: fs.readFileSync(__dirname + '/draggable-points-overlay.md', 'utf-8') + }), + + r(MapGL, assign({onChangeViewport: this._onChangeViewport}, this.state.map), [ + r(DraggablePoints, { + points: this.state.draggablePoints, + onAddPoint: this._onAddPoint, + onUpdatePoint: this._onUpdatePoint, + renderPoint: function renderPoint(point, pixel) { + return r.g({}, [ + r.circle({ + r: 10, + style: { + fill: alphaify('#1FBAD6', 0.5), + pointerEvents: 'all' + } + }), + r.text({ + style: {fill: 'white', textAnchor: 'middle'}, + y: 5 + }, point.get('id')) + ]); + } + }) + ]), + ]); + } + +}); + diff --git a/content/getting-started/getting-started.js b/content/getting-started/getting-started.js new file mode 100644 index 000000000..bbc3e19c7 --- /dev/null +++ b/content/getting-started/getting-started.js @@ -0,0 +1,72 @@ +// Copyright (c) 2015 Uber Technologies, Inc. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +'use strict'; + +var r = require('r-dom'); +var d3 = require('d3'); +var fs = require('fs'); +var React = require('react'); +var assign = require('object-assign'); +var MapGL = require('react-map-gl'); + +var Markdown = require('../../common/markdown'); +var CodeSnippet = require('../../common/code-snippet.react'); +var stamenMapStyle = require('../../common/stamen-map-style'); + +module.exports = React.createClass({ + + getInitialState: function getInitialState() { + return { + map: { + latitude: 37.78, + longitude: -122.45, + zoom: 11, + mapStyle: stamenMapStyle, + width: 700, + height: 450, + startDragLatLng: null, + }, + }; + }, + + _onChangeViewport: function _onChangeViewport(opt) { + this.setState({map: assign({}, this.state.map, opt)}); + }, + + render: function render() { + return r.div([ + r(Markdown, { + text: fs.readFileSync(__dirname + '/getting-started.md', 'utf-8') + }), + r(CodeSnippet, { + language: 'html', + text: '' + }), + r(MapGL, assign({onChangeViewport: this._onChangeViewport}, this.state.map)), + ]) + } + +}); + diff --git a/text/introductions.md b/content/getting-started/getting-started.md similarity index 82% rename from text/introductions.md rename to content/getting-started/getting-started.md index 6c8df70e7..ba3a2cd4e 100644 --- a/text/introductions.md +++ b/content/getting-started/getting-started.md @@ -1,5 +1,7 @@ -Provides a [React](http://facebook.github.io/react/) friendly API wrapper -for [MapboxGL-js](https://www.mapbox.com/mapbox-gl-js/), A WebGL powered +# Getting Started + +React-map-gl is a [React](http://facebook.github.io/react/)-friendly API wrapper +for [MapboxGL-js](https://www.mapbox.com/mapbox-gl-js/), a WebGL-powered vector and raster tile mapping library. MapboxGL-js provides impressive vector tile rendering capabilities @@ -15,6 +17,4 @@ examples here don't use the paid vector tile API and instead use map tiles by [OpenStreetMap](http://openstreetmap.org), under [CC BY SA](http://creativecommons.org/licenses/by-sa/3.0). -## Introduction - Here's a simple example of creating a map: diff --git a/text/locations-snippet.txt b/content/scatterplot/locations-snippet.txt similarity index 100% rename from text/locations-snippet.txt rename to content/scatterplot/locations-snippet.txt diff --git a/content/scatterplot/scatterplot-example.md b/content/scatterplot/scatterplot-example.md new file mode 100644 index 000000000..55ce302de --- /dev/null +++ b/content/scatterplot/scatterplot-example.md @@ -0,0 +1,3 @@ +# Scatterplot Overlay + +An example of the built in [``](https://github.com/uber/react-map-gl/blob/master/src/overlays/scatterplot.react.js) overlay. diff --git a/content/scatterplot/scatterplot.js b/content/scatterplot/scatterplot.js new file mode 100644 index 000000000..839fed43e --- /dev/null +++ b/content/scatterplot/scatterplot.js @@ -0,0 +1,114 @@ +// Copyright (c) 2015 Uber Technologies, Inc. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +'use strict'; + +var assign = require('object-assign'); +var r = require('r-dom'); +var React = require('react'); +var fs = require('fs'); +var MapGL = require('react-map-gl'); +var d3 = require('d3'); +var Immutable = require('immutable'); + +var ScatterPlotOverlay = require('react-map-gl/src/overlays/scatterplot.react'); + +var stamenMapStyle = require('../../common/stamen-map-style'); +var CodeSnippet = require('../../common/code-snippet.react'); +var Markdown = require('../../common/markdown'); + + +module.exports = React.createClass({ + + getInitialState: function getInitialState() { + var normal = d3.random.normal(); + function wiggle(scale) { + return normal() * scale; + } + return { + map: { + latitude: 37.78, + longitude: -122.45, + zoom: 11, + mapStyle: stamenMapStyle, + width: 700, + height: 450, + isDragging: true, + startDragLngLat: null + }, + locations: Immutable.fromJS(d3.range(2000).map(function _map() { + return [37.788 + wiggle(0.01), -122.408 + wiggle(0.01)]; + })) + }; + }, + + _onChangeViewport: function _onChangeViewport(opt) { + this.setState({map: assign({}, this.state.map, opt)}); + }, + + render: function render() { + return r.div([ + r(Markdown, {text: fs.readFileSync(__dirname + '/scatterplot-example.md', 'utf-8')}), + + r(CodeSnippet, { + language: 'html', + text: '\n' + + ' \n' + + '' + }), + + r(Markdown, { + text: 'Where `locations` is an [ImmutableJS](https://facebook.github.' + + 'io/immutable-js/) List of longitude/latitude pairs' + }), + + r(CodeSnippet, { + language: 'js', + text: fs.readFileSync(__dirname + '/locations-snippet.txt', 'utf-8') + }), + + r(MapGL, assign({onChangeViewport: this._onChangeViewport}, + this.state.map), [ + r(ScatterPlotOverlay, { + width: this.state.map.width, + height: this.state.map.height, + latitude: this.state.map.latitude, + longitude: this.state.map.longitude, + zoom: this.state.map.zoom, + locations: this.state.locations, + isDragging: this.state.map.isDragging, + dotRadius: 2, + globalOpacity: 1, + compositeOperation: 'screen' + }) + ]), + ]); + } + +}); + diff --git a/text/overlay-props.txt b/content/third-party-overlay/overlay-props.txt similarity index 100% rename from text/overlay-props.txt rename to content/third-party-overlay/overlay-props.txt diff --git a/text/third-party-overlay-example.md b/content/third-party-overlay/third-party-overlay-example.md similarity index 100% rename from text/third-party-overlay-example.md rename to content/third-party-overlay/third-party-overlay-example.md diff --git a/content/third-party-overlay/third-party-overlay.js b/content/third-party-overlay/third-party-overlay.js new file mode 100644 index 000000000..2b0e60241 --- /dev/null +++ b/content/third-party-overlay/third-party-overlay.js @@ -0,0 +1,110 @@ +// Copyright (c) 2015 Uber Technologies, Inc. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +'use strict'; + +var assign = require('object-assign'); +var alphaify = require('alphaify'); +var r = require('r-dom'); +var React = require('react'); +var fs = require('fs'); +var MapGL = require('react-map-gl'); +var d3 = require('d3'); +var Immutable = require('immutable'); + +var HeatmapOverlay = require('react-map-gl-heatmap-overlay'); + +var stamenMapStyle = require('../../common/stamen-map-style'); +var CodeSnippet = require('../../common/code-snippet.react'); +var Markdown = require('../../common/markdown'); + +module.exports = React.createClass({ + + getInitialState: function getInitialState() { + var normal = d3.random.normal(); + function wiggle(scale) { + return normal() * scale; + } + return { + map: { + latitude: 37.78, + longitude: -122.45, + zoom: 11, + mapStyle: stamenMapStyle, + width: 700, + height: 450, + startDragLatLng: null + }, + locations: Immutable.fromJS(d3.range(2000).map(function _map() { + return [37.788 + wiggle(0.01), -122.408 + wiggle(0.01)]; + })) + }; + }, + + _onChangeViewport: function _onChangeViewport(opt) { + this.setState({map: assign({}, this.state.map, opt)}); + }, + + render: function render() { + return r.div([ + r(Markdown, { + text: fs.readFileSync(__dirname + '/third-party-overlays.md', 'utf-8') + }), + + r(CodeSnippet, { + language: 'js', + text: fs.readFileSync(__dirname + '/overlay-props.txt', 'utf-8') + }), + + r(Markdown, { + text: fs.readFileSync(__dirname + '/third-party-overlay-example.md', 'utf-8') + }), + + r(CodeSnippet, { + language: 'html', + text: '\n' + + ' \n' + + '' + }), + + r(MapGL, assign({onChangeViewport: this._onChangeViewport}, this.state.map), [ + + r(HeatmapOverlay, { + locations: this.state.locations, + latLngAccessor: function latLngAccessor(location) { + return location.toArray(); + }, + intensityAccessor: function intensityAccessor() { + return 1 / 10; + }, + sizeAccessor: function sizeAccessor() { + return 10; + } + }) + ]) + ]); + } + +}); + diff --git a/content/third-party-overlay/third-party-overlays.md b/content/third-party-overlay/third-party-overlays.md new file mode 100644 index 000000000..030631b61 --- /dev/null +++ b/content/third-party-overlay/third-party-overlays.md @@ -0,0 +1,5 @@ +# Third Party Overlays + +You can also create your own overlays. Overlays will be passed the +following props [transparently](https:// +github.com/uber/react-map-gl/blob/master/src/map.react.js#L589): \ No newline at end of file diff --git a/css.js b/css.js deleted file mode 100644 index 12543f5a7..000000000 --- a/css.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2015 Uber Technologies, Inc. - -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -'use strict'; - -var jss = require('js-stylesheet'); -var fs = require('fs'); -var d3 = require('d3'); - -function addStyleSheet(text) { - d3.select('body').append('style') - .attr('type', 'text/css') - .text(text); -} - -jss({ - body: { - 'font-family': 'helvetica' - }, - h1: { - 'font-size': '40px', - 'font-weight': '300' - } -}); - -addStyleSheet( - fs.readFileSync('node_modules/highlight.js/styles/tomorrow.css', 'utf-8') -); diff --git a/index.css b/index.css new file mode 100644 index 000000000..2267ddd0d --- /dev/null +++ b/index.css @@ -0,0 +1,95 @@ +html, body { + font-family: 'Roboto', sans-serif; + padding:0px; + margin: 0px; + margin-bottom: 100px; + font-size: 1.1em; + line-height: 1.75em; +} + +h1{font-weight: 100} +h2{font-weight: 100; margin-top: 48px} + +a { + text-decoration: none; + color: #08F; +} + +#header { + position: fixed; + top: 0px; + margin: auto auto; + height: 50px; + width: 100%; + background-color: #222222; + box-shadow: 0px 2px 10px #888; +} + +#header-content { + margin: auto auto; + height: 50px; + line-height: 50px; + box-sizing: border-box; + width: 920px; +} + +#header-logo { + height: 50px; + line-height: 50px; + box-sizing: border-box; + font-family: 'Yanone Kaffeesatz', sans-serif; + color: #1FBAD6; + margin-top: -4px; + font-size: 32px; + float: left; +} + +#header-nav { + height: 50px; + line-height: 50px; + box-sizing: border-box; + color: white; + font-size: 16px; + float: right; +} + +#sidebar { + float: left; + width: 200px; + box-sizing: border-box; + font-size: 14px; + padding-top: 25px; +} + +#container { + box-sizing: border-box; + width: 960px; + margin: 50px auto auto auto; + padding: 20px; + padding-bottom: 100px; +} + +#content { + width: 700px; + float: right; +} + +.nav-link { + color: white; + text-decoration: none; +} + +.menuitem { + cursor: pointer; +} + +.hljs { + line-height: 1.25em; + cursor: default; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} \ No newline at end of file diff --git a/index.html b/index.html index 90ef13d3f..2ef9511d1 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,32 @@ + + + + + + + + +
+ +
+
+ - Fork me on GitHub + - \ No newline at end of file + + diff --git a/index.js b/index.js index 3f96639f9..90f7ef77d 100644 --- a/index.js +++ b/index.js @@ -19,215 +19,23 @@ // THE SOFTWARE. 'use strict'; -var assign = require('object-assign'); -var alphaify = require('alphaify'); var r = require('r-dom'); -var Immutable = require('immutable'); -var React = require('react'); +var ReactDOM = require('react-dom'); var document = require('global/document'); -var markdown = require('./markdown'); -var fs = require('fs'); -var MapGL = require('react-map-gl'); -var ScatterPlotOverlay = require('react-map-gl/src/overlays/scatterplot.react'); -/* eslint-disable max-len */ -var DraggablePoints = require('react-map-gl/src/overlays/draggable-points.react'); -/* eslint-enable max-len */ -var HeatmapOverlay = require('react-map-gl-heatmap-overlay'); -var stamenMapStyle = require('./stamen-map-style'); -var CodeSnippet = require('./code-snippet.react'); -var d3 = require('d3'); +var Sidebar = require('./sidebar'); -var initialPoints = [ - {location: [37.79450507471435, -122.39508481737994], id: 0}, - {location: [37.79227619464379, -122.39750244137034], id: 1}, - {location: [37.789251178427776, -122.4013303460217], id: 2}, - {location: [37.786862920252986, -122.40475531334141], id: 3}, - {location: [37.78861431712821, -122.40505751634022], id: 4}, - {location: [37.79060449046487, -122.40556118800487], id: 5}, - {location: [37.790047247333675, -122.4088854209916], id: 6}, - {location: [37.79275381746233, -122.4091876239904], id: 7}, - {location: [37.795619489534374, -122.40989276432093], id: 8}, - {location: [37.79792786675678, -122.41049717031848], id: 9}, - {location: [37.80031576728801, -122.4109001076502], id: 10}, - {location: [37.79920142331301, -122.41916032295062], id: 11} -]; - -var pointIds = initialPoints[initialPoints.length - 1].id; - -var Docs = React.createClass({ - - getInitialState: function getInitialState() { - var normal = d3.random.normal(); - function wiggle(scale) { - return normal() * scale; - } - return { - map: { - latitude: 37.78, - longitude: -122.45, - zoom: 11, - mapStyle: stamenMapStyle, - width: 450, - height: 450, - startDragLatLng: null - }, - draggablePoints: Immutable.fromJS(initialPoints), - locations: Immutable.fromJS(d3.range(2000).map(function _map() { - return [37.788 + wiggle(0.01), -122.408 + wiggle(0.01)]; - })) - }; - }, - - _onAddPoint: function _onAddPoint(_location) { - var points = this.state.draggablePoints.push(new Immutable.Map({ - location: new Immutable.List(_location), - id: ++pointIds - })); - this.setState({draggablePoints: points}); - }, - - _onUpdatePoint: function _onUpdatePoint(opt) { - var index = this.state.draggablePoints.findIndex(function filter(p) { - return p.get('id') === opt.key; - }); - var point = this.state.draggablePoints.get(index); - point = point.set('location', new Immutable.List(opt.location)); - var points = this.state.draggablePoints.set(index, point); - this.setState({draggablePoints: points}); - }, - - _onChangeViewport: function _onChangeViewport(opt) { - this.setState({map: assign({}, this.state.map, opt)}); - }, - - render: function render() { - return r.div({ - style: { - width: 900, - margin: '30px auto auto auto' - } - }, [ - r.h1('react-map-gl'), - r(markdown, {text: fs.readFileSync('text/introductions.md', 'utf-8')}), - r(CodeSnippet, { - language: 'html', - text: '' - }), - r.br(), - r(MapGL, assign({onChangeViewport: this._onChangeViewport}, - this.state.map)), - r.br(), - r(markdown, { - text: fs.readFileSync('text/scatterplot-example.md', 'utf-8') - }), - r(CodeSnippet, { - language: 'html', - text: '\n' + - ' \n' + - '' - }), - r.br(), - r(markdown, { - text: 'Where `locations` is an [ImmutableJS](https://facebook.github.' + - 'io/immutable-js/) List of logitude/latitude pairs' - }), - r(CodeSnippet, { - language: 'js', - text: fs.readFileSync('text/locations-snippet.txt', 'utf-8') - }), - r(MapGL, assign({onChangeViewport: this._onChangeViewport}, - this.state.map), [ - r(ScatterPlotOverlay, { - locations: this.state.locations, - dotRadius: 2, - globalOpacity: 1, - compositeOperation: 'screen' - }) - ]), - r.br(), - r(markdown, { - text: fs.readFileSync('text/draggable-points-overlay.md', 'utf-8') - }), - r(MapGL, assign({onChangeViewport: this._onChangeViewport}, - this.state.map), [ - r(DraggablePoints, { - points: this.state.draggablePoints, - onAddPoint: this._onAddPoint, - onUpdatePoint: this._onUpdatePoint, - renderPoint: function renderPoint(point, pixel) { - return r.g({}, [ - r.circle({ - r: 10, - style: { - fill: alphaify('#1FBAD6', 0.5), - pointerEvents: 'all' - } - }), - r.text({ - style: {fill: 'white', textAnchor: 'middle'}, - y: 5 - }, point.get('id')) - ]); - } - }) - ]), - r.br(), - r(markdown, { - text: fs.readFileSync('text/third-party-overlays.md', 'utf-8') - }), - r(CodeSnippet, { - language: 'js', - text: fs.readFileSync('text/overlay-props.txt', 'utf-8') - }), - r(markdown, { - text: fs.readFileSync('text/third-party-overlay-example.md', 'utf-8') - }), - r(CodeSnippet, { - language: 'html', - text: '\n' + - ' \n' + - '' - }), - r(MapGL, assign({onChangeViewport: this._onChangeViewport}, - this.state.map), [ - r(HeatmapOverlay, { - locations: this.state.locations, - latLngAccessor: function latLngAccessor(location) { - return location.toArray(); - }, - intensityAccessor: function intensityAccessor() { - return 1 / 10; - }, - sizeAccessor: function sizeAccessor() { - return 10; - } - }) - ]) - ]); - } +var sidebar = r(Sidebar, { + content: document.getElementById('content'), + active: location.hash.replace('#', '') }); -React.render(r(Docs), document.body); +ReactDOM.render(sidebar, document.getElementById('sidebar')); -/* eslint-disable no-unused-vars */ -var css = require('./css'); -/* eslint-enable no-unused-vars */ +// // Load the hash-linked component if it exists, otherwise load Getting Started. +// var title = 'Getting Started'; +// var hash = location.hash.replace('#', ''); +// if (hash in contents) { +// title = hash; +// } +// React.render(r(contents[title]), document.getElementById('content')); +// location.hash = title; diff --git a/package.json b/package.json index 1f0b04e2b..beb745a46 100644 --- a/package.json +++ b/package.json @@ -10,19 +10,23 @@ "budo": "^6.1.0", "d3": "^3.5.8", "highlight.js": "^8.8.0", + "immutable": "^3.7.6", "js-stylesheet": "0.0.1", "marked": "^0.3.5", "object-assign": "^4.0.1", - "r-dom": "^1.3.0", - "react": "^0.13.3", - "react-map-gl": "^0.2.1", - "react-map-gl-heatmap-overlay": "^0.2.1", + "r-dom": "^2.1.0", + "react": "^0.14.3", + "react-addons-pure-render-mixin": "^0.14.3", + "react-dom": "^0.14.3", + "react-map-gl": "^0.6.1", + "react-map-gl-heatmap-overlay": "^1.0.0", + "set-location-hash": "^0.3.0", "uber-standard": "^3.7.1", "uglifyify": "^3.0.1" }, "devDependencies": {}, "scripts": { - "start": "budo ./index.js --serve bundle.js --live -- -t brfs| bistre", + "start": "budo ./index.js --serve bundle.js --live -- -t brfs | bistre", "build": "browserify -g uglifyify ./index.js -t brfs > bundle.js", "lint": "uber-standard" }, diff --git a/sidebar.js b/sidebar.js new file mode 100644 index 000000000..6b0bd2ec1 --- /dev/null +++ b/sidebar.js @@ -0,0 +1,83 @@ +// Copyright (c) 2015 Uber Technologies, Inc. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +'use strict'; + +var r = require('r-dom'); +var React = require('react'); +var ReactDOM = require('react-dom'); +var document = require('global/document'); +var setLocationHash = require('set-location-hash'); + +var contents = { + 'Getting Started': require('./content/getting-started/getting-started'), + 'Scatterplot': require('./content/scatterplot/scatterplot'), + // 'Draggable Points': require('./content/draggable-points/draggable-points'), + // 'Third Party Overlays': require('./content/third-party-overlay/third-party-overlay'), +} + +var titles = Object.keys(contents); + + +var MenuItem = React.createClass({ + + componentDidMount: function() { + if (this.props.active) { + this.handleClick(); + } + }, + + handleClick: function() { + ReactDOM.render(r(this.props.component), this.props.content); + setLocationHash(this.props.title); + }, + + render: function() { + return r.p({ + className: 'menuitem', + onClick: this.handleClick + }, this.props.title); + } + +}); + + +module.exports = React.createClass({ + + render: function(render) { + var items = []; + for (var i = 0; i < titles.length; i++) { + var title = titles[i]; + var component = contents[title]; + items.push(r(MenuItem, { + title: title, + component: component, + content: this.props.content, + active: this.props.active === title + })); + } + return r.div(items); + } + +}); + + + + + diff --git a/text/draggable-points-overlay.md b/text/draggable-points-overlay.md deleted file mode 100644 index 2719d0150..000000000 --- a/text/draggable-points-overlay.md +++ /dev/null @@ -1,3 +0,0 @@ -### Draggable Points Overlay - -Test \ No newline at end of file diff --git a/text/scatterplot-example.md b/text/scatterplot-example.md deleted file mode 100644 index 2a0546e08..000000000 --- a/text/scatterplot-example.md +++ /dev/null @@ -1 +0,0 @@ -Next, an example of the built in [``](https://github.com/uber/react-map-gl/blob/master/src/overlays/scatterplot.react.js) overlay. diff --git a/text/third-party-overlays.md b/text/third-party-overlays.md deleted file mode 100644 index bb7a341ec..000000000 --- a/text/third-party-overlays.md +++ /dev/null @@ -1,5 +0,0 @@ -## Third party overlays - -You can also create your own overlays. Overlays will [transparently](https:// -github.com/uber/react-map-gl/blob/master/src/map.react.js#L589) be passed the -following props provided they're a direct children of a `` map. \ No newline at end of file From 8c8b3b978bbf30fa7686d0880b92adc7ce4cac8e Mon Sep 17 00:00:00 2001 From: Rye Terrell Date: Fri, 18 Dec 2015 23:18:57 -0600 Subject: [PATCH 02/16] rebuild bundle --- bundle.js | 1623 +++++++++++++++++++++++++---------------------------- 1 file changed, 758 insertions(+), 865 deletions(-) diff --git a/bundle.js b/bundle.js index 8a8ee7e1f..7752627cb 100644 --- a/bundle.js +++ b/bundle.js @@ -1,551 +1,650 @@ (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.br(),r(MapGL,assign({onChangeViewport:this._onChangeViewport},this.state.map)),r.br(),r(markdown,{text:"Next, an example of the built in [``](https://github.com/uber/react-map-gl/blob/master/src/overlays/scatterplot.react.js) overlay.\n"}),r(CodeSnippet,{language:"html",text:"\n \n"}),r.br(),r(markdown,{text:"Where `locations` is an [ImmutableJS](https://facebook.github.io/immutable-js/) List of logitude/latitude pairs"}),r(CodeSnippet,{language:"js",text:"List [\n List [\n 37.78736425435588,\n -122.39851786165565\n ],\n List [\n 37.78531678199267,\n -122.40015469418074\n ],\n List [\n 37.80051001607987,\n -122.4124101516789\n ]\n // etc...\n]"}),r(MapGL,assign({onChangeViewport:this._onChangeViewport},this.state.map),[r(ScatterPlotOverlay,{locations:this.state.locations,dotRadius:2,globalOpacity:1,compositeOperation:"screen"})]),r.br(),r(markdown,{text:"### Draggable Points Overlay\n\nTest"}),r(MapGL,assign({onChangeViewport:this._onChangeViewport},this.state.map),[r(DraggablePoints,{points:this.state.draggablePoints,onAddPoint:this._onAddPoint,onUpdatePoint:this._onUpdatePoint,renderPoint:function(t,e){return r.g({},[r.circle({r:10,style:{fill:alphaify("#1FBAD6",.5),pointerEvents:"all"}}),r.text({style:{fill:"white",textAnchor:"middle"},y:5},t.get("id"))])}})]),r.br(),r(markdown,{text:"## Third party overlays\n\nYou can also create your own overlays. Overlays will [transparently](https://\ngithub.com/uber/react-map-gl/blob/master/src/map.react.js#L589) be passed the\nfollowing props provided they're a direct children of a `` map."}),r(CodeSnippet,{language:"js",text:"PropTypes: {\n width: React.PropTypes.number.isRequired,\n height: React.PropTypes.number.isRequired,\n project: React.PropTypes.func.isRequired,\n unproject: React.PropTypes.func.isRequired,\n isDragging: React.PropTypes.bool\n}"}),r(markdown,{text:"Here's an example of the third party [react-map-gl-heatmap-overlay](https://github.com/vicapow/react-map-gl-heatmap-overlay) which uses a fork of [Florian Boesch](https://github.com/pyalot)'s [WebGL Heatmap](https://github.com/vicapow/webgl-heatmap)."}),r(CodeSnippet,{language:"html",text:"\n \n"}),r(MapGL,assign({onChangeViewport:this._onChangeViewport},this.state.map),[r(HeatmapOverlay,{locations:this.state.locations,latLngAccessor:function(t){return t.toArray()},intensityAccessor:function(){return.1},sizeAccessor:function(){return 10}})])])}});React.render(r(Docs),document.body);var css=require("./css"); -},{"./code-snippet.react":1,"./css":2,"./markdown":4,"./stamen-map-style":494,"alphaify":5,"d3":10,"global/document":31,"immutable":173,"object-assign":184,"r-dom":188,"react":478,"react-map-gl":299,"react-map-gl-heatmap-overlay":190,"react-map-gl/src/overlays/draggable-points.react":303,"react-map-gl/src/overlays/scatterplot.react":304}],4:[function(require,module,exports){ +},{"d3":13,"highlight.js":62,"r-dom":312,"react":453,"react-addons-pure-render-mixin":314,"react-dom":315}],2:[function(require,module,exports){ "use strict";var marked=require("marked"),r=require("r-dom"),React=require("react"),hljs=require("highlight.js"),d3=require("d3");module.exports=React.createClass({displayName:"Markdown",propTypes:{text:React.PropTypes.string.isRequired},render:function(){return r.div({dangerouslySetInnerHTML:{__html:marked(this.props.text)}})}}); -},{"d3":10,"highlight.js":34,"marked":182,"r-dom":188,"react":478}],5:[function(require,module,exports){ -"use strict";function alphaify(r,a){var e=d3.rgb(r);return"rgba("+[e.r,e.g,e.b]+", "+a+")"}var d3=require("d3");module.exports=alphaify; +},{"d3":13,"highlight.js":62,"marked":305,"r-dom":312,"react":453}],3:[function(require,module,exports){ +"use strict";var Immutable=require("immutable");module.exports=Immutable.Map({version:8,name:"Testing Stamen raster source",sources:{"raster-stamen-source":{type:"raster",tileSize:256,scheme:"xyz",tiles:["http://tile.stamen.com/terrain/{z}/{x}/{y}.png"]}},layers:[{id:"raster-stamen",type:"raster",source:"raster-stamen-source","source-layer":"raster_stamen_full",paint:{"raster-opacity":1}}]}); + +},{"immutable":201}],4:[function(require,module,exports){ +"use strict";var r=require("r-dom"),d3=require("d3"),React=require("react"),assign=require("object-assign"),MapGL=require("react-map-gl"),Markdown=require("../../common/markdown"),CodeSnippet=require("../../common/code-snippet.react"),stamenMapStyle=require("../../common/stamen-map-style");module.exports=React.createClass({getInitialState:function(){return{map:{latitude:37.78,longitude:-122.45,zoom:11,mapStyle:stamenMapStyle,width:700,height:450,startDragLatLng:null}}},_onChangeViewport:function(e){this.setState({map:assign({},this.state.map,e)})},render:function(){return r.div([r(Markdown,{text:"# Getting Started\n\nReact-map-gl is a [React](http://facebook.github.io/react/)-friendly API wrapper\nfor [MapboxGL-js](https://www.mapbox.com/mapbox-gl-js/), a WebGL-powered\nvector and raster tile mapping library.\n\nMapboxGL-js provides impressive vector tile rendering capabilities\nthat you can find out more about [here](https://www.mapbox.com/mapbox-gl-js/).\nAlthough the Mapbox\n[vector tile specification](https://www.mapbox.com/developers/vector-tiles/) is \n[open source](https://github.com/mapbox/vector-tile-spec), there aren't yet very\nmany free alternatives to Mapbox's paid \n[vector tile API](https://www.mapbox.com/pricing/). Because of this, the\nexamples here don't use the paid vector tile API and instead use map tiles by\n[Stamen Design](http://stamen.com), under\n[CC BY 3.0](http://creativecommons.org/licenses/by/3.0) and data by\n[OpenStreetMap](http://openstreetmap.org),\nunder [CC BY SA](http://creativecommons.org/licenses/by-sa/3.0).\n\nHere's a simple example of creating a map:\n"}),r(CodeSnippet,{language:"html",text:""}),r(MapGL,assign({onChangeViewport:this._onChangeViewport},this.state.map))])}}); + +},{"../../common/code-snippet.react":1,"../../common/markdown":2,"../../common/stamen-map-style":3,"d3":13,"object-assign":306,"r-dom":312,"react":453,"react-map-gl":318}],5:[function(require,module,exports){ +"use strict";var assign=require("object-assign"),r=require("r-dom"),React=require("react"),MapGL=require("react-map-gl"),d3=require("d3"),Immutable=require("immutable"),ScatterPlotOverlay=require("react-map-gl/src/overlays/scatterplot.react"),stamenMapStyle=require("../../common/stamen-map-style"),CodeSnippet=require("../../common/code-snippet.react"),Markdown=require("../../common/markdown");module.exports=React.createClass({getInitialState:function(){function t(t){return e()*t}var e=d3.random.normal();return{map:{latitude:37.78,longitude:-122.45,zoom:11,mapStyle:stamenMapStyle,width:700,height:450,isDragging:!0,startDragLngLat:null},locations:Immutable.fromJS(d3.range(2e3).map(function(){return[37.788+t(.01),-122.408+t(.01)]}))}},_onChangeViewport:function(t){this.setState({map:assign({},this.state.map,t)})},render:function(){return r.div([r(Markdown,{text:"# Scatterplot Overlay\n\nAn example of the built in [``](https://github.com/uber/react-map-gl/blob/master/src/overlays/scatterplot.react.js) overlay.\n"}),r(CodeSnippet,{language:"html",text:"\n \n"}),r(Markdown,{text:"Where `locations` is an [ImmutableJS](https://facebook.github.io/immutable-js/) List of longitude/latitude pairs"}),r(CodeSnippet,{language:"js",text:"List [\n List [\n 37.78736425435588,\n -122.39851786165565\n ],\n List [\n 37.78531678199267,\n -122.40015469418074\n ],\n List [\n 37.80051001607987,\n -122.4124101516789\n ]\n // etc...\n]"}),r(MapGL,assign({onChangeViewport:this._onChangeViewport},this.state.map),[r(ScatterPlotOverlay,{width:this.state.map.width,height:this.state.map.height,latitude:this.state.map.latitude,longitude:this.state.map.longitude,zoom:this.state.map.zoom,locations:this.state.locations,isDragging:this.state.map.isDragging,dotRadius:2,globalOpacity:1,compositeOperation:"screen"})])])}}); + +},{"../../common/code-snippet.react":1,"../../common/markdown":2,"../../common/stamen-map-style":3,"d3":13,"immutable":201,"object-assign":306,"r-dom":312,"react":453,"react-map-gl":318,"react-map-gl/src/overlays/scatterplot.react":322}],6:[function(require,module,exports){ +"use strict";var r=require("r-dom"),ReactDOM=require("react-dom"),document=require("global/document"),Sidebar=require("./sidebar"),sidebar=r(Sidebar,{content:document.getElementById("content"),active:location.hash.replace("#","")});ReactDOM.render(sidebar,document.getElementById("sidebar")); +},{"./sidebar":465,"global/document":59,"r-dom":312,"react-dom":315}],7:[function(require,module,exports){ +function replacer(t,e){return util.isUndefined(e)?""+e:util.isNumber(e)&&!isFinite(e)?e.toString():util.isFunction(e)||util.isRegExp(e)?e.toString():e}function truncate(t,e){return util.isString(t)?t.length=0;n--)if(a[n]!=u[n])return!1;for(n=a.length-1;n>=0;n--)if(s=a[n],!_deepEqual(t[s],e[s]))return!1;return!0}function expectedException(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function _throws(t,e,r,i){var s;util.isString(r)&&(i=r,r=null);try{e()}catch(n){s=n}if(i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),t&&!s&&fail(s,r,"Missing expected exception"+i),!t&&expectedException(s,r)&&fail(s,r,"Got unwanted exception"+i),t&&s&&r&&!expectedException(s,r)||!t&&s)throw s}var util=require("util/"),pSlice=Array.prototype.slice,hasOwn=Object.prototype.hasOwnProperty,assert=module.exports=ok;assert.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var e=t.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var i=r.stack,s=e.name,n=i.indexOf("\n"+s);if(n>=0){var a=i.indexOf("\n",n+1);i=i.substring(a+1)}this.stack=i}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(t,e,r){t!=e&&fail(t,e,r,"==",assert.equal)},assert.notEqual=function(t,e,r){t==e&&fail(t,e,r,"!=",assert.notEqual)},assert.deepEqual=function(t,e,r){_deepEqual(t,e)||fail(t,e,r,"deepEqual",assert.deepEqual)},assert.notDeepEqual=function(t,e,r){_deepEqual(t,e)&&fail(t,e,r,"notDeepEqual",assert.notDeepEqual)},assert.strictEqual=function(t,e,r){t!==e&&fail(t,e,r,"===",assert.strictEqual)},assert.notStrictEqual=function(t,e,r){t===e&&fail(t,e,r,"!==",assert.notStrictEqual)},assert["throws"]=function(t,e,r){_throws.apply(this,[!0].concat(pSlice.call(arguments)))},assert.doesNotThrow=function(t,e){_throws.apply(this,[!1].concat(pSlice.call(arguments)))},assert.ifError=function(t){if(t)throw t};var objectKeys=Object.keys||function(t){var e=[];for(var r in t)hasOwn.call(t,r)&&e.push(r);return e}; -},{"d3":10}],6:[function(require,module,exports){ +},{"util/":458}],8:[function(require,module,exports){ !function(e,i){"undefined"!=typeof module&&module.exports?module.exports.browser=i():"function"==typeof define&&define.amd?define(i):this[e]=i()}("bowser",function(){function e(e){function o(i){var o=e.match(i);return o&&o.length>1&&o[1]||""}function s(i){var o=e.match(i);return o&&o.length>1&&o[2]||""}var r,n=o(/(ipod|iphone|ipad)/i).toLowerCase(),t=/like android/i.test(e),a=!t&&/android/i.test(e),d=o(/edge\/(\d+(\.\d+)?)/i),m=o(/version\/(\d+(\.\d+)?)/i),v=/tablet/i.test(e),b=!v&&/[^-]mobi/i.test(e);/opera|opr/i.test(e)?r={name:"Opera",opera:i,version:m||o(/(?:opera|opr)[\s\/](\d+(\.\d+)?)/i)}:/windows phone/i.test(e)?(r={name:"Windows Phone",windowsphone:i},d?(r.msedge=i,r.version=d):(r.msie=i,r.version=o(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?r={name:"Internet Explorer",msie:i,version:o(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:/chrome.+? edge/i.test(e)?r={name:"Microsoft Edge",msedge:i,version:d}:/chrome|crios|crmo/i.test(e)?r={name:"Chrome",chrome:i,version:o(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:n?(r={name:"iphone"==n?"iPhone":"ipad"==n?"iPad":"iPod"},m&&(r.version=m)):/sailfish/i.test(e)?r={name:"Sailfish",sailfish:i,version:o(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?r={name:"SeaMonkey",seamonkey:i,version:o(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel/i.test(e)?(r={name:"Firefox",firefox:i,version:o(/(?:firefox|iceweasel)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(r.firefoxos=i)):/silk/i.test(e)?r={name:"Amazon Silk",silk:i,version:o(/silk\/(\d+(\.\d+)?)/i)}:a?r={name:"Android",version:m}:/phantom/i.test(e)?r={name:"PhantomJS",phantom:i,version:o(/phantomjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?r={name:"BlackBerry",blackberry:i,version:m||o(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:/(web|hpw)os/i.test(e)?(r={name:"WebOS",webos:i,version:m||o(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(r.touchpad=i)):r=/bada/i.test(e)?{name:"Bada",bada:i,version:o(/dolfin\/(\d+(\.\d+)?)/i)}:/tizen/i.test(e)?{name:"Tizen",tizen:i,version:o(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||m}:/safari/i.test(e)?{name:"Safari",safari:i,version:m}:{name:o(/^(.*)\/(.*) /),version:s(/^(.*)\/(.*) /)},!r.msedge&&/(apple)?webkit/i.test(e)?(r.name=r.name||"Webkit",r.webkit=i,!r.version&&m&&(r.version=m)):!r.opera&&/gecko\//i.test(e)&&(r.name=r.name||"Gecko",r.gecko=i,r.version=r.version||o(/gecko\/(\d+(\.\d+)?)/i)),r.msedge||!a&&!r.silk?n&&(r[n]=i,r.ios=i):r.android=i;var f="";r.windowsphone?f=o(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):n?(f=o(/os (\d+([_\s]\d+)*) like mac os x/i),f=f.replace(/[_\s]/g,".")):a?f=o(/android[ \/-](\d+(\.\d+)*)/i):r.webos?f=o(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):r.blackberry?f=o(/rim\stablet\sos\s(\d+(\.\d+)*)/i):r.bada?f=o(/bada\/(\d+(\.\d+)*)/i):r.tizen&&(f=o(/tizen[\/\s](\d+(\.\d+)*)/i)),f&&(r.osversion=f);var l=f.split(".")[0];return v||"ipad"==n||a&&(3==l||4==l&&!b)||r.silk?r.tablet=i:(b||"iphone"==n||"ipod"==n||a||r.blackberry||r.webos||r.bada)&&(r.mobile=i),r.msedge||r.msie&&r.version>=10||r.chrome&&r.version>=20||r.firefox&&r.version>=20||r.safari&&r.version>=6||r.opera&&r.version>=10||r.ios&&r.osversion&&r.osversion.split(".")[0]>=6||r.blackberry&&r.version>=10.1?r.a=i:r.msie&&r.version<10||r.chrome&&r.version<20||r.firefox&&r.version<20||r.safari&&r.version<6||r.opera&&r.version<10||r.ios&&r.osversion&&r.osversion.split(".")[0]<6?r.c=i:r.x=i,r}var i=!0,o=e("undefined"!=typeof navigator?navigator.userAgent:"");return o.test=function(e){for(var i=0;ie?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){} -},{}],10:[function(require,module,exports){ +},{}],13:[function(require,module,exports){ !function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function a(n){return n.length}function o(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function s(n){return(n+="")===xa||n[0]===ba?ba+n:n}function f(n){return(n+="")[0]===ba?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=_a.length;r>e;++e){var u=_a[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++ue;e++)for(var u,i=n[e],a=0,o=i.length;o>a;a++)(u=i[a])&&t(u,a,e);return n}function Z(n){return Sa(n,za),n}function V(n){var t,e;return function(r,u,i){var a,o=n[i].update,l=o.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(a=o[t])&&++t0&&(n=n.slice(0,o));var c=La.get(n);return c&&(n=c,l=B),o?t?u:r:t?b:i}function $(n,t){return function(e){var r=oa.event;oa.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{oa.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Ta,u="click"+r,i=oa.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==qa&&(qa="onselectstart"in e?!1:x(e.style,"userSelect")),qa){var a=n(e).style,o=a[qa];a[qa]="none"}return function(n){if(i.on(r,null),qa&&(a[qa]=o),n){var t=function(){i.on(u,null)};i.on(u,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var u=r.createSVGPoint();if(0>Ra){var i=t(n);if(i.scrollX||i.scrollY){r=oa.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=r[0][0].getScreenCTM();Ra=!(a.f||a.e),r.remove()}}return Ra?(u.x=e.pageX,u.y=e.pageY):(u.x=e.clientX,u.y=e.clientY),u=u.matrixTransform(n.getScreenCTM().inverse()),[u.x,u.y]}var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}function G(){return oa.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?ja:Math.acos(n)}function tn(n){return n>1?Ha:-1>n?-Ha:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function an(n){return(n=Math.sin(n/2))*n}function on(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(a-i)*n/60:180>n?a:240>n?i+(a-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,a;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,a=.5>=e?e*(1+t):e+t-e*t,i=2*e-a,new yn(u(n+120),u(n),u(n-120))}function sn(n,t,e){return this instanceof sn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof sn?new sn(n.h,n.c,n.l):n instanceof hn?pn(n.l,n.a,n.b):pn((n=Sn((n=oa.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new sn(n,t,e)}function fn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Oa)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof sn?fn(n.h,n.c,n.l):Sn((n=yn(n)).r,n.g,n.b):new hn(n,t,e)}function gn(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=vn(u)*Ka,r=vn(r)*Qa,i=vn(i)*no,new yn(mn(3.2404542*u-1.5371385*r-.4985314*i),mn(-.969266*u+1.8760108*r+.041556*i),mn(.0556434*u-.2040259*r+1.0572252*i))}function pn(n,t,e){return n>0?new sn(Math.atan2(e,t)*Ia,Math.sqrt(t*t+e*e),n):new sn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function mn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function yn(n,t,e){return this instanceof yn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof yn?new yn(n.r,n.g,n.b):_n(""+n,yn,cn):new yn(n,t,e)}function Mn(n){return new yn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,u,i,a=0,o=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(Nn(u[0]),Nn(u[1]),Nn(u[2]))}return(i=ro.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(a=(3840&i)>>4,a=a>>4|a,o=240&i,o=o>>4|o,l=15&i,l=l<<4|l):7===n.length&&(a=(16711680&i)>>16,o=(65280&i)>>8,l=255&i)),t(a,o,l))}function wn(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),a=Math.max(n,t,e),o=a-i,l=(a+i)/2;return o?(u=.5>l?o/(a+i):o/(2-a-i),r=n==a?(t-e)/o+(e>t?6:0):t==a?(e-n)/o+2:(n-t)/o+4,r*=60):(r=NaN,u=l>0&&1>l?0:r),new ln(r,u,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/Ka),u=dn((.2126729*n+.7151522*t+.072175*e)/Qa),i=dn((.0193339*n+.119192*t+.9503041*e)/no);return hn(116*u-16,500*(r-u),200*(u-i))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function u(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(i,l)}catch(r){return void a.error.call(i,r)}a.load.call(i,n)}else a.error.call(i,l)}var i={},a=oa.dispatch("beforesend","progress","load","error"),o={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=u:l.onreadystatechange=function(){l.readyState>3&&u()},l.onprogress=function(n){var t=oa.event;oa.event=n;try{a.progress.call(i,l)}finally{oa.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?o[n]:(null==t?delete o[n]:o[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(c=n,i):c},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ca(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),l.open(e,n,!0),null==t||"accept"in o||(o.accept=t+",*/*"),l.setRequestHeader)for(var s in o)l.setRequestHeader(s,o[s]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),a.beforesend.call(i,l),l.send(null==r?null:r),i},i.abort=function(){return l.abort(),i},oa.rebind(i,a,"on"),null==r?i:i.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,n:null};return io?io.n=i:uo=i,io=i,ao||(oo=clearTimeout(oo),ao=1,lo(Tn)),i}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(oo),oo=setTimeout(Tn,t)),ao=0):(ao=1,lo(Tn))}function Rn(){for(var n=Date.now(),t=uo;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=uo,e=1/0;t;)t.c?(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Un(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],a=0,o=r[0],l=0;u>0&&o>0&&(l+o+1>t&&(o=Math.max(1,t-l)),i.push(n.substring(u-=o,u+o)),!((l+=o+1)>t));)o=r[a=(a+1)%r.length];return i.reverse().join(e)}:y;return function(n){var e=so.exec(n),r=e[1]||" ",a=e[2]||">",o=e[3]||"-",l=e[4]||"",c=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===a)&&(c=r="0",a="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===l&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=fo.get(g)||Fn;var M=c&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===o?"":o;if(0>p){var l=oa.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===a?u+n+k:">"===a?k+u+n:"^"===a?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new go(e-1)),1),e}function i(n,e){return t(n=new go(+n),e),n}function a(n,r,i){var a=u(n),o=[];if(i>1)for(;r>a;)e(a)%i||o.push(new Date(+a)),t(a,1);else for(;r>a;)o.push(new Date(+a)),t(a,1);return o}function o(n,t,e){try{go=Hn;var r=new Hn;return r._=n,a(r,t,e)}finally{go=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=a;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(u),l.offset=In(i),l.range=o,n}function In(n){return function(t,e){try{go=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{go=Date}}}function Yn(n){function t(n){function t(t){for(var e,u,i,a=[],o=-1,l=0;++oo;){if(r>=c)return-1;if(u=t.charCodeAt(o++),37===u){if(a=t.charAt(o++),i=C[a in vo?t.charAt(o++):a],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{go=Hn;var t=new go;return t._=n,r(t)}finally{go=Date}}var r=t(n);return e.parse=function(n){try{go=Hn;var t=r.parse(n);return t&&t._}finally{go=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=oa.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(m),k=Xn(m),N=Vn(y),E=Xn(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ho.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ho.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ho.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:ot,"%":function(){return"%"}},C={a:r,A:u,b:i,B:a,c:o,d:tt,e:tt,H:rt,I:rt,j:et,L:at,m:nt,M:ut,p:s,S:it,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Vn(n){return new RegExp("^(?:"+n.map(oa.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e68?1900:2e3)}function nt(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ut(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function it(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function at(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ot(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=Ma(t)/60|0,u=Ma(t)%60;return e+Zn(r,"0",2)+Zn(u,"0",2)}function lt(n,t,e){yo.lastIndex=0;var r=yo.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e=0?1:-1,o=a*e,l=Math.cos(t),c=Math.sin(t),s=i*c,f=u*l+s*Math.cos(o),h=s*a*Math.sin(o);So.add(Math.atan2(h,f)),r=n,u=l,i=c}var t,e,r,u,i;ko.point=function(a,o){ko.point=n,r=(t=a)*Oa,u=Math.cos(o=(e=o)*Oa/2+ja/4),i=Math.sin(o)},ko.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function mt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function yt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return Ma(n[0]-t[0])o;++o)u.point((e=n[o])[0],e[1]);return void u.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,i.push(l),a.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,i.push(l),a.push(c)}}),a.sort(t),qt(i),qt(a),i.length){for(var o=0,l=e,c=a.length;c>o;++o)a[o].e=l=!l;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var o=0,c=s.length;c>o;++o)u.point((f=s[o])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var o=s.length-1;o>=0;--o)u.point((f=s[o])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r0){for(b||(i.polygonStart(),b=!0),i.lineStart();++a1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Dt))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:a,lineStart:l,lineEnd:c,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=a,y.lineStart=l,y.lineEnd=c,g=oa.merge(g);var n=Ot(m,p);g.length?(b||(i.polygonStart(),b=!0),Lt(g,jt,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=Pt(),x=t(M),b=!1;return y}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function jt(n,t){return((n=n.x)[0]<0?n[1]-Ha-Da:Ha-n[1])-((t=t.x)[0]<0?t[1]-Ha-Da:Ha-t[1])}function Ut(n){var t,e=NaN,r=NaN,u=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(i,a){var o=i>0?ja:-ja,l=Ma(i-e);Ma(l-ja)0?Ha:-Ha),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(o,r),n.point(i,r),t=0):u!==o&&l>=ja&&(Ma(e-u)Da?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*a)):(t+r)/2}function Ht(n,t,e,r){var u;if(null==n)u=e*Ha,r.point(-ja,u),r.point(0,u),r.point(ja,u),r.point(ja,0),r.point(ja,-u),r.point(0,-u),r.point(-ja,-u),r.point(-ja,0),r.point(-ja,u);else if(Ma(n[0]-t[0])>Da){var i=n[0]o;++o){var c=t[o],s=c.length;if(s)for(var f=c[0],h=f[0],g=f[1]/2+ja/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=c[d];var m=n[0],y=n[1]/2+ja/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>ja,k=p*M;if(So.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*Ua:b,S^h>=e^m>=e){var N=yt(dt(f),dt(n));bt(N);var E=yt(u,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(a+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Da>i||Da>i&&0>So)^1&a}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,l,c,s;return{lineStart:function(){c=l=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=a?v?0:u(f,h):v?u(f+(0>f?ja:-ja),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(g=r(e,p),(wt(e,g)||wt(p,g))&&(p[0]+=Da,p[1]+=Da,v=t(p[0],p[1]))),v!==l)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(o&&e&&a^v){var m;d&i||!(m=r(p,e,!0))||(s=0,a?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&wt(e,p)||n.point(p[0],p[1]),e=p,l=v,i=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return s|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),u=dt(t),a=[1,0,0],o=yt(r,u),l=mt(o,o),c=o[0],s=l-c*c;if(!s)return!e&&n;var f=i*l/s,h=-i*c/s,g=yt(a,o),p=xt(a,f),v=xt(o,h);Mt(p,v);var d=g,m=mt(p,d),y=mt(d,d),M=m*m-y*(mt(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-m-x)/y);if(Mt(b,p),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=Ma(E-ja)E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(Ma(b[0]-w)ja^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-m+x)/y);return Mt(z,p),[b,_t(z)]}}}function u(t,e){var r=a?n:ja-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),a=i>0,o=Ma(i)>Da,l=ve(n,6*Oa);return Rt(t,e,l,a?[0,-n]:[-ja,n-ja])}function Yt(n,t,e,r){return function(u){var i,a=u.a,o=u.b,l=a.x,c=a.y,s=o.x,f=o.y,h=0,g=1,p=s-l,v=f-c;if(i=n-l,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-l,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-c,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-c,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:l+h*p,y:c+h*v}),1>g&&(u.b={x:l+g*p,y:c+g*v}),u}}}}}}function Zt(n,t,e,r){function u(r,u){return Ma(r[0]-n)0?0:3:Ma(r[0]-e)0?2:1:Ma(r[1]-t)0?1:0:u>0?3:2}function i(n,t){return a(n.x,t.x)}function a(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(o){function l(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,a=1,o=d[u],l=o.length,c=o[0];l>a;++a)i=o[a],c[1]<=r?i[1]>r&&Q(c,i,n)>0&&++t:i[1]<=r&&Q(c,i,n)<0&&--t,c=i;return 0!==t}function c(i,o,l,c){var s=0,f=0;if(null==i||(s=u(i,l))!==(f=u(o,l))||a(i,o)<0^l>0){do c.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+l+4)%4)!==f)}else c.point(o[0],o[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&o.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=NaN}function g(){v&&(p(y,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=f,w&&o.lineEnd()}function p(n,t){n=Math.max(-Fo,Math.min(Fo,n)),t=Math.max(-Fo,Math.min(Fo,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(o.lineStart(),o.point(n,t));else if(e&&w)o.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(o.lineStart(),o.point(r.a.x,r.a.y)),o.point(r.b.x,r.b.y),e||o.lineEnd(),k=!1):e&&(o.lineStart(),o.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,N=o,E=Pt(),A=Yt(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){o=E,v=[],d=[],k=!0},polygonEnd:function(){o=N,v=oa.merge(v);var t=l([n,r]),e=k&&t,u=v.length;(e||u)&&(o.polygonStart(),e&&(o.lineStart(),c(null,null,1,o),o.lineEnd()),u&&Lt(v,i,t,c,o),o.polygonEnd()),v=d=m=null}};return C}}function Vt(n){var t=0,e=ja/3,r=oe(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*ja/180,e=n[1]*ja/180):[t/ja*180,e/ja*180]},u}function Xt(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),a-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),a=Math.sqrt(i)/u;return e.invert=function(n,t){var e=a-t;return[Math.atan2(n,e)/u,tn((i-(n*n+e*e)*u*u)/(2*u))]},e}function $t(){function n(n,t){Oo+=u*n-r*t,r=n,u=t}var t,e,r,u;Xo.point=function(i,a){Xo.point=n,t=r=i,e=u=a},Xo.lineEnd=function(){n(t,e)}}function Bt(n,t){Io>n&&(Io=n),n>Zo&&(Zo=n),Yo>t&&(Yo=t),t>Vo&&(Vo=t)}function Wt(){function n(n,t){a.push("M",n,",",t,i)}function t(n,t){a.push("M",n,",",t),o.point=e}function e(n,t){a.push("L",n,",",t)}function r(){o.point=n}function u(){a.push("Z")}var i=Jt(4.5),a=[],o={point:n,lineStart:function(){o.point=t},lineEnd:r,polygonStart:function(){o.lineEnd=u},polygonEnd:function(){o.lineEnd=r,o.point=n},pointRadius:function(n){return i=Jt(n),o},result:function(){if(a.length){var n=a.join("");return a=[],n}}};return o}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ao+=n,Co+=t,++zo}function Kt(){function n(n,r){var u=n-t,i=r-e,a=Math.sqrt(u*u+i*i);Lo+=a*(t+n)/2,qo+=a*(e+r)/2,To+=a,Gt(t=n,e=r)}var t,e;Bo.point=function(r,u){Bo.point=n,Gt(t=r,e=u)}}function Qt(){Bo.point=Gt}function ne(){function n(n,t){var e=n-r,i=t-u,a=Math.sqrt(e*e+i*i);Lo+=a*(r+n)/2,qo+=a*(u+t)/2,To+=a,a=u*n-r*t,Ro+=a*(r+n),Do+=a*(u+t),Po+=3*a,Gt(r=n,u=t)}var t,e,r,u;Bo.point=function(i,a){Bo.point=n,Gt(t=r=i,e=u=a)},Bo.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+a,e),n.arc(t,e,a,0,Ua)}function e(t,e){n.moveTo(t,e),o.point=r}function r(t,e){n.lineTo(t,e)}function u(){o.point=t}function i(){n.closePath()}var a=4.5,o={point:t,lineStart:function(){o.point=e},lineEnd:u,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=u,o.point=t},pointRadius:function(n){return a=n,o},result:b};return o}function ee(n){function t(n){return(o?r:e)(n)}function e(t){return ie(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=i,t.lineStart()}function i(e,r){var i=dt([e,r]),a=n(e,r);u(M,x,y,b,_,w,M=a[0],x=a[1],y=e,b=i[0],_=i[1],w=i[2],o,t),t.point(M,x)}function a(){S.point=e,t.lineEnd()}function l(){r(),S.point=c,S.lineEnd=s}function c(n,t){ -i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,o,t),S.lineEnd=a,a()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,o,l,c,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=o+g,_=l+p,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=Ma(Ma(w)-1)i||Ma((y*z+M*L)/x-.5)>.3||a>o*g+l*p+c*v)&&(u(t,e,r,o,l,c,A,C,N,b/=S,_/=S,w,d,m),m.point(A,C),u(A,C,N,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,a=Math.cos(30*Oa),o=16;return t.precision=function(n){return arguments.length?(o=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function re(n){var t=ee(function(t,e){return n([t*Ia,e*Ia])});return function(n){return le(t(n))}}function ue(n){this.stream=n}function ie(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ae(n){return oe(function(){return n})()}function oe(n){function t(n){return n=o(n[0]*Oa,n[1]*Oa),[n[0]*h+l,c-n[1]*h]}function e(n){return n=o.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Ia,n[1]*Ia]}function r(){o=Ct(a=fe(m,M,x),i);var n=i(v,d);return l=g-n[0]*h,c=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,a,o,l,c,s,f=ee(function(n,t){return n=i(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=Uo,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=le(b(a,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Uo):It((w=+n)*Oa),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Oa,d=n[1]%360*Oa,r()):[v*Ia,d*Ia]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Oa,M=n[1]%360*Oa,x=n.length>2?n[2]%360*Oa:0,r()):[m*Ia,M*Ia,x*Ia]},oa.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function le(n){return ie(n,function(t,e){n.point(t*Oa,e*Oa)})}function ce(n,t){return[n,t]}function se(n,t){return[n>ja?n-Ua:-ja>n?n+Ua:n,t]}function fe(n,t,e){return n?t||e?Ct(ge(n),pe(t,e)):ge(n):t||e?pe(t,e):se}function he(n){return function(t,e){return t+=n,[t>ja?t-Ua:-ja>t?t+Ua:t,e]}}function ge(n){var t=he(n);return t.invert=he(-n),t}function pe(n,t){function e(n,t){var e=Math.cos(t),o=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*r+o*u;return[Math.atan2(l*i-s*a,o*r-c*u),tn(s*i+l*a)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),a=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),o=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*i-l*a;return[Math.atan2(l*i+c*a,o*r+s*u),tn(s*r-o*u)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,a,o){var l=a*t;null!=u?(u=de(e,u),i=de(e,i),(a>0?i>u:u>i)&&(u+=a*Ua)):(u=n+a*Ua,i=n-.5*l);for(var c,s=u;a>0?s>i:i>s;s-=l)o.point((c=_t([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Da)%(2*Math.PI)}function me(n,t,e){var r=oa.range(n,t-Da,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function ye(n,t,e){var r=oa.range(n,t-Da,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),a=Math.cos(r),o=Math.sin(r),l=u*Math.cos(n),c=u*Math.sin(n),s=a*Math.cos(e),f=a*Math.sin(e),h=2*Math.asin(Math.sqrt(an(r-t)+u*a*an(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*l+t*s,u=e*c+t*f,a=e*i+t*o;return[Math.atan2(u,r)*Ia,Math.atan2(a,Math.sqrt(r*r+u*u))*Ia]}:function(){return[n*Ia,t*Ia]};return p.distance=h,p}function _e(){function n(n,u){var i=Math.sin(u*=Oa),a=Math.cos(u),o=Ma((n*=Oa)-t),l=Math.cos(o);Wo+=Math.atan2(Math.sqrt((o=a*Math.sin(o))*o+(o=r*i-e*a*l)*o),e*i+r*a*l),t=n,e=i,r=a}var t,e,r;Jo.point=function(u,i){t=u*Oa,e=Math.sin(i*=Oa),r=Math.cos(i),Jo.point=n},Jo.lineEnd=function(){Jo.point=Jo.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),a=Math.cos(u);return[Math.atan2(n*i,r*a),Math.asin(r&&e*i/r)]},e}function Se(n,t){function e(n,t){a>0?-Ha+Da>t&&(t=-Ha+Da):t>Ha-Da&&(t=Ha-Da);var e=a/Math.pow(u(t),i);return[e*Math.sin(i*n),a-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(ja/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),a=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=a-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(a/r,1/i))-Ha]},e):Ne}function ke(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return Ma(u)u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var u=n[0],i=e[0],a=t[0]-u,o=r[0]-i,l=n[1],c=e[1],s=t[1]-l,f=r[1]-c,h=(o*(l-c)-f*(u-i))/(f*a-o*s);return[u+h*a,l+h*s]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function je(n){var t=ll.pop()||new Pe;return t.site=n,t}function Ue(n){Be(n),il.remove(n),ll.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,a=n.N,o=[n];Ue(n);for(var l=i;l.circle&&Ma(e-l.circle.x)s;++s)c=o[s],l=o[s-1],nr(c.edge,l.site,c.site,u);l=o[0],c=o[f-1],c.edge=Ke(l.site,c.site,null,u),$e(l),$e(c)}function He(n){for(var t,e,r,u,i=n.x,a=n.y,o=il._;o;)if(r=Oe(o,a)-i,r>Da)o=o.L;else{if(u=i-Ie(o,a),!(u>Da)){r>-Da?(t=o.P,e=o):u>-Da?(t=o,e=o.N):t=e=o;break}if(!o.R){t=o;break}o=o.R}var l=je(n);if(il.insert(t,l),t||e){if(t===e)return Be(t),e=je(t.site),il.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,s=c.x,f=c.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};nr(e.edge,c,p,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,p,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var a=n.P;if(!a)return-(1/0);e=a.site;var o=e.x,l=e.y,c=l-t;if(!c)return o;var s=o-r,f=1/i-1/c,h=s/c;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*c)-l+c/2+u-i/2)))/f+r:(r+o)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,u,i,a,o,l,c,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=ul,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(o=i.edges,l=o.length,a=0;l>a;)s=o[a].end(),r=s.x,u=s.y,c=o[++a%l].start(),t=c.x,e=c.y,(Ma(r-t)>Da||Ma(u-e)>Da)&&(o.splice(a,0,new tr(Qe(i.site,s,Ma(r-f)Da?{x:f,y:Ma(t-f)Da?{x:Ma(e-p)Da?{x:h,y:Ma(t-h)Da?{x:Ma(e-g)=-Pa)){var g=l*l+c*c,p=s*s+f*f,v=(f*g-c*p)/h,d=(l*p-s*g)/h,f=d+o,m=cl.pop()||new Xe;m.arc=n,m.site=u,m.x=v+a,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=ol._;M;)if(m.yd||d>=o)return;if(h>p){if(i){if(i.y>=c)return}else i={x:d,y:l};e={x:d,y:c}}else{if(i){if(i.yr||r>1)if(h>p){if(i){if(i.y>=c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else{if(i){if(i.yg){if(i){if(i.x>=o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}else{if(i){if(i.xi||f>a||r>h||u>g)){if(p=n.point){var p,v=t-n.x,d=e-n.y,m=v*v+d*d;if(l>m){var y=Math.sqrt(l=m);r=t-y,u=e-y,i=t+y,a=e+y,o=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,s,f,x,b);break;case 1:c(n,x,f,h,b);break;case 2:c(n,s,b,x,g);break;case 3:c(n,x,b,h,g)}}}(n,r,u,i,a),o}function vr(n,t){n=oa.rgb(n),t=oa.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,a=t.g-r,o=t.b-u;return function(n){return"#"+bn(Math.round(e+i*n))+bn(Math.round(r+a*n))+bn(Math.round(u+o*n))}}function dr(n,t){var e,r={},u={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function mr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function yr(n,t){var e,r,u,i=fl.lastIndex=hl.lastIndex=0,a=-1,o=[],l=[];for(n+="",t+="";(e=fl.exec(n))&&(r=hl.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),o[a]?o[a]+=u:o[++a]=u),(e=e[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:mr(e,r)})),i=hl.lastIndex;return ir;++r)o[(e=l[r]).i]=e.x(n);return o.join("")})}function Mr(n,t){for(var e,r=oa.interpolators.length;--r>=0&&!(e=oa.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],u=[],i=n.length,a=t.length,o=Math.min(n.length,t.length);for(e=0;o>e;++e)r.push(Mr(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;a>e;++e)u[e]=t[e];return function(n){for(e=0;o>e;++e)u[e]=r[e](n);return u}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Ha)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Ua*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Ua/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=oa.hcl(n),t=oa.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,a=t.c-r,o=t.l-u;return isNaN(a)&&(a=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return fn(e+i*n,r+a*n,u+o*n)+""}}function Dr(n,t){n=oa.hsl(n),t=oa.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,a=t.s-r,o=t.l-u;return isNaN(a)&&(a=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return cn(e+i*n,r+a*n,u+o*n)+""}}function Pr(n,t){n=oa.lab(n),t=oa.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,a=t.a-r,o=t.b-u;return function(n){return gn(e+i*n,r+a*n,u+o*n)+""}}function jr(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Ur(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),u=Fr(t,e),i=Hr(Or(e,t,-u))||0;t[0]*e[1]180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:mr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:mr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var u=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:u-4,x:mr(n[0],t[0])},{i:u-2,x:mr(n[1],t[1])})}else(1!==t[0]||1!==t[1])&&e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=oa.transform(n),t=oa.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,u=-1,i=r.length;++u=0;)e.push(u[r])}function au(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,a=-1;++ae;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function mu(n){return n.reduce(yu,0)}function yu(n,t){return n+t[1]}function Mu(n,t){return xu(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xu(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function bu(n){return[oa.min(n),oa.max(n)]}function _u(n,t){return n.value-t.value}function wu(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Su(n,t){n._pack_next=t,t._pack_prev=n}function ku(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Nu(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(c=e.length)){var e,r,u,i,a,o,l,c,s=1/0,f=-(1/0),h=1/0,g=-(1/0);if(e.forEach(Eu),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(u=e[1],u.x=u.r,u.y=0,t(u),c>2))for(i=e[2],zu(r,u,i),t(i),wu(r,i),r._pack_prev=i,wu(i,u),u=r._pack_next,a=3;c>a;a++){zu(r,u,i=e[a]);var p=0,v=1,d=1;for(o=u._pack_next;o!==u;o=o._pack_next,v++)if(ku(o,i)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!ku(l,i);l=l._pack_prev,d++);p?(d>v||v==d&&u.ra;a++)i=e[a],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(Au)}}function Eu(n){n._pack_next=n._pack_prev=n}function Au(n){delete n._pack_next,delete n._pack_prev}function Cu(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,a=u.length;++i=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pu(n,t,e){return n.a.parent===t.parent?n.a:e}function ju(n){return 1+oa.max(n,function(n){return n.y})}function Uu(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fu(n){var t=n.children;return t&&t.length?Fu(t[0]):n}function Hu(n){var t,e=n.children;return e&&(t=e.length)?Hu(e[t-1]):n}function Ou(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Iu(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Yu(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zu(n){return n.rangeExtent?n.rangeExtent():Yu(n.range())}function Vu(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Xu(n,t){var e,r=0,u=n.length-1,i=n[r],a=n[u];return i>a&&(e=r,r=u,u=e,e=i,i=a,a=e),n[r]=t.floor(i),n[u]=t.ceil(a),n}function $u(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:wl}function Bu(n,t,e,r){var u=[],i=[],a=0,o=Math.min(n.length,t.length)-1;for(n[o]2?Bu:Vu,l=r?Wr:Br;return a=u(n,t,l,e),o=u(t,n,l,Mr),i}function i(n){return a(n)}var a,o;return i.invert=function(n){return o(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(jr)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Qu(n,t)},i.tickFormat=function(t,e){return ni(n,t,e)},i.nice=function(t){return Gu(n,t),u()},i.copy=function(){return Wu(n,t,e,r)},u()}function Ju(n,t){return oa.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gu(n,t){return Xu(n,$u(Ku(n,t)[2]))}function Ku(n,t){null==t&&(t=10);var e=Yu(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Qu(n,t){return oa.range.apply(oa,Ku(n,t))}function ni(n,t,e){var r=Ku(n,t);if(e){var u=so.exec(e);if(u.shift(),"s"===u[8]){var i=oa.formatPrefix(Math.max(Ma(r[0]),Ma(r[1])));return u[7]||(u[7]="."+ti(i.scale(r[2]))),u[8]="f",e=oa.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+ei(u[8],r)),e=u.join("")}else e=",."+ti(r[2])+"f";return oa.format(e)}function ti(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function ei(n,t){var e=ti(t[2]);return n in Sl?Math.abs(e-ti(Math.max(Ma(t[0]),Ma(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ri(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function a(t){return n(u(t))}return a.invert=function(t){return i(n.invert(t))},a.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),a):r},a.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),a):t},a.nice=function(){var t=Xu(r.map(u),e?Math:Nl);return n.domain(t),r=t.map(i),a},a.ticks=function(){var n=Yu(r),a=[],o=n[0],l=n[1],c=Math.floor(u(o)),s=Math.ceil(u(l)),f=t%1?2:t;if(isFinite(s-c)){if(e){for(;s>c;c++)for(var h=1;f>h;h++)a.push(i(c)*h);a.push(i(c))}else for(a.push(i(c));c++0;h--)a.push(i(c)*h);for(c=0;a[c]l;s--);a=a.slice(c,s)}return a},a.tickFormat=function(n,t){if(!arguments.length)return kl;arguments.length<2?t=kl:"function"!=typeof t&&(t=oa.format(t));var r,o=Math.max(.1,n/a.ticks().length),l=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(l(u(n)+r))<=o?t(n):""}},a.copy=function(){return ri(n.copy(),t,e,r)},Ju(a,n)}function ui(n,t,e){function r(t){return n(u(t))}var u=ii(t),i=ii(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Qu(e,n)},r.tickFormat=function(n,t){return ni(e,n,t)},r.nice=function(n){return r.domain(Gu(e,n))},r.exponent=function(a){return arguments.length?(u=ii(t=a),i=ii(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return ui(n.copy(),t,e)},Ju(r,n)}function ii(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ai(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):NaN))-1)%i.length]}function r(t,e){return oa.range(n.length).map(function(n){return t+e*n})}var u,i,a;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new c;for(var i,a=-1,o=r.length;++ae?[NaN,NaN]:[e>0?o[e-1]:n[0],et?NaN:t/i+n,[t,t+1/i]},r.copy=function(){return li(n,t,e)},u()}function ci(n,t){function e(e){return e>=e?t[oa.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return ci(n,t)},e}function si(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qu(n,t)},t.tickFormat=function(t,e){return ni(n,t,e)},t.copy=function(){return si(n)},t}function fi(){return 0}function hi(n){return n.innerRadius}function gi(n){return n.outerRadius}function pi(n){return n.startAngle}function vi(n){return n.endAngle}function di(n){return n&&n.padAngle}function mi(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function yi(n,t,e,r,u){var i=n[0]-t[0],a=n[1]-t[1],o=(u?r:-r)/Math.sqrt(i*i+a*a),l=o*a,c=-o*i,s=n[0]+l,f=n[1]+c,h=t[0]+l,g=t[1]+c,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(Math.max(0,M*M*y-x*x)),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,N=_-p,E=w-v,A=S-p,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mi(n){function t(t){function a(){c.push("M",i(n(s),o))}for(var l,c=[],s=[],f=-1,h=t.length,g=En(e),p=En(r);++f1?n.join("L"):n+"Z"}function bi(n){return n.join("L")+"Z"}function _i(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t1&&u.push("H",r[0]),u.join("")}function wi(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t1){o=t[1],i=n[l],l++,r+="C"+(u[0]+a[0])+","+(u[1]+a[1])+","+(i[0]-o[0])+","+(i[1]-o[1])+","+i[0]+","+i[1];for(var c=2;c9&&(u=3*t/Math.sqrt(u),a[o]=u*e,a[o+1]=u*r));for(o=-1;++o<=l;)u=(n[Math.min(l,o+1)][0]-n[Math.max(0,o-1)][0])/(6*(1+a[o]*a[o])),i.push([u||0,a[o]*u||0]);return i}function Fi(n){return n.length<3?xi(n):n[0]+Ai(n,Ui(n))}function Hi(n){for(var t,e,r,u=-1,i=n.length;++u=t?a(n-t):void(s.c=a)}function a(e){var u=p.active,i=p[u];i&&(i.timer.c=null,i.timer.t=NaN,--p.count,delete p[u],i.event&&i.event.interrupt.call(n,n.__data__,i.index));for(var a in p)if(r>+a){var c=p[a];c.timer.c=null,c.timer.t=NaN,--p.count,delete p[a]}s.c=o,qn(function(){return s.c&&o(e||1)&&(s.c=null,s.t=NaN),1},0,l),p.active=r,v.event&&v.event.start.call(n,n.__data__,t),g=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&g.push(r)}),h=v.ease,f=v.duration}function o(u){for(var i=u/f,a=h(i),o=g.length;o>0;)g[--o].call(n,a);return i>=1?(v.event&&v.event.end.call(n,n.__data__,t),--p.count?delete p[r]:delete n[e],1):void 0}var l,s,f,h,g,p=n[e]||(n[e]={active:0,count:0}),v=p[r];v||(l=u.time,s=qn(i,0,l),v=p[r]={tween:new c,time:l,timer:s,delay:u.delay,duration:u.duration,ease:u.ease,index:t},u=null,++p.count)}function na(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function ta(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function ea(n){return n.toISOString()}function ra(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=oa.bisect(Gl,u);return i==Gl.length?[t.year,Ku(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Gl[i-1]1?{floor:function(t){for(;e(t=n.floor(t));)t=ua(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=ua(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yu(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],ua(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ra(n.copy(),t,e)},Ju(r,n)}function ua(n){return new Date(n)}function ia(n){return JSON.parse(n.responseText)}function aa(n){var t=sa.createRange();return t.selectNode(sa.body),t.createContextualFragment(n.responseText)}var oa={version:"3.5.10"},la=[].slice,ca=function(n){return la.call(n)},sa=this.document;if(sa)try{ca(sa.documentElement.childNodes)[0].nodeType}catch(fa){ca=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),sa)try{sa.createElement("DIV").style.setProperty("opacity",0,"")}catch(ha){var ga=this.Element.prototype,pa=ga.setAttribute,va=ga.setAttributeNS,da=this.CSSStyleDeclaration.prototype,ma=da.setProperty;ga.setAttribute=function(n,t){pa.call(this,n,t+"")},ga.setAttributeNS=function(n,t,e){va.call(this,n,t,e+"")},da.setProperty=function(n,t,e){ma.call(this,n,t+"",e)}}oa.ascending=e,oa.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},oa.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=r){e=r;break}for(;++ur&&(e=r)}else{for(;++u=r){e=r;break}for(;++ur&&(e=r)}return e},oa.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=r){e=r;break}for(;++ue&&(e=r)}else{for(;++u=r){e=r;break}for(;++ue&&(e=r)}return e},oa.extent=function(n,t){var e,r,u,i=-1,a=n.length;if(1===arguments.length){for(;++i=r){e=u=r;break}for(;++ir&&(e=r),r>u&&(u=r))}else{for(;++i=r){e=u=r;break}for(;++ir&&(e=r),r>u&&(u=r))}return[e,u]},oa.sum=function(n,t){var e,r=0,i=n.length,a=-1;if(1===arguments.length)for(;++a1?l/(s-1):void 0},oa.deviation=function(){var n=oa.variance.apply(this,arguments);return n?Math.sqrt(n):n};var ya=i(e);oa.bisectLeft=ya.left,oa.bisect=oa.bisectRight=ya.right,oa.bisector=function(n){return i(1===n.length?function(t,r){return e(n(t),r)}:n)},oa.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=Math.random()*i--|0,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},oa.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},oa.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},oa.zip=function(){if(!(r=arguments.length))return[];for(var n=-1,t=oa.min(arguments,a),e=new Array(t);++n=0;)for(r=n[u],t=r.length;--t>=0;)e[--a]=r[t];return e};var Ma=Math.abs;oa.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,u=[],i=o(Ma(e)),a=-1;if(n*=i,t*=i,e*=i,0>e)for(;(r=n+e*++a)>t;)u.push(r/i);else for(;(r=n+e*++a)=i.length)return r?r.call(u,a):e?a.sort(e):a;for(var l,s,f,h,g=-1,p=a.length,v=i[o++],d=new c;++g=i.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],a=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(oa.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return a[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},oa.set=function(n){var t=new m;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(m,{has:h,add:function(n){return this._[s(n+="")]=!0,n},remove:g,values:p,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t))}}),oa.behavior={},oa.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},oa.event=null,oa.requote=function(n){return n.replace(wa,"\\$&")};var wa=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Sa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},ka=function(n,t){return t.querySelector(n)},Na=function(n,t){return t.querySelectorAll(n)},Ea=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ea=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(ka=function(n,t){return Sizzle(n,t)[0]||null},Na=Sizzle,Ea=Sizzle.matchesSelector),oa.selection=function(){return oa.select(sa.documentElement)};var Aa=oa.selection.prototype=[];Aa.select=function(n){var t,e,r,u,i=[];n=A(n);for(var a=-1,o=this.length;++a=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Ca.hasOwnProperty(e)?{space:Ca[e],local:n}:n}},Aa.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=oa.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Aa.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,u=-1;if(t=e.classList){for(;++uu){if("string"!=typeof n){2>u&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>u){var i=this.node();return t(i).getComputedStyle(i,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Aa.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(j(t,n[t]));return this}return this.each(j(n,t))},Aa.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Aa.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Aa.append=function(n){return n=U(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Aa.insert=function(n,t){return n=U(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Aa.remove=function(){return this.each(F)},Aa.data=function(n,t){function e(n,e){var r,u,i,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),v=new Array(a);if(t){var d,m=new c,y=new Array(a);for(r=-1;++rr;++r)p[r]=H(e[r]);for(;a>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,o.push(p),l.push(g),s.push(v)}var r,u,i=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++ii;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var o=0,l=e.length;l>o;o++)(r=e[o])&&n.call(r,r.__data__,o,i)&&t.push(r)}return E(u)},Aa.order=function(){for(var n=-1,t=this.length;++n=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},Aa.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++tn;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},Aa.size=function(){var n=0;return Y(this,function(){++n}),n};var za=[];oa.selection.enter=Z,oa.selection.enter.prototype=za,za.append=Aa.append,za.empty=Aa.empty,za.node=Aa.node,za.call=Aa.call,za.size=Aa.size,za.select=function(n){for(var t,e,r,u,i,a=[],o=-1,l=this.length;++or){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var La=oa.map({mouseenter:"mouseover",mouseleave:"mouseout"});sa&&La.forEach(function(n){"on"+n in sa&&La.remove(n)});var qa,Ta=0;oa.mouse=function(n){return J(n,k())};var Ra=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;oa.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return J(n,r)},oa.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",a)}function e(n,t,e,i,a){return function(){function o(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(m.on(i+d,null).on(a+d,null),y(p),g({type:"dragend"}))}var c,s=this,f=oa.event.target,h=s.parentNode,g=r.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=oa.select(e(f)).on(i+d,o).on(a+d,l),y=W(f),M=t(h,v);u?(c=u.apply(s,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],g({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),u=null,i=e(b,oa.mouse,t,"mousemove","mouseup"),a=e(G,oa.touch,y,"touchmove","touchend");return n.origin=function(t){return arguments.length?(u=t,n):u},oa.rebind(n,r,"on")},oa.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?ca(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Da=1e-6,Pa=Da*Da,ja=Math.PI,Ua=2*ja,Fa=Ua-Da,Ha=ja/2,Oa=ja/180,Ia=180/ja,Ya=Math.SQRT2,Za=2,Va=4;oa.interpolateZoom=function(n,t){var e,r,u=n[0],i=n[1],a=n[2],o=t[0],l=t[1],c=t[2],s=o-u,f=l-i,h=s*s+f*f;if(Pa>h)r=Math.log(c/a)/Ya,e=function(n){return[u+n*s,i+n*f,a*Math.exp(Ya*n*r)]};else{var g=Math.sqrt(h),p=(c*c-a*a+Va*h)/(2*a*Za*g),v=(c*c-a*a-Va*h)/(2*c*Za*g),d=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(v*v+1)-v);r=(m-d)/Ya,e=function(n){var t=n*r,e=rn(d),o=a/(Za*g)*(e*un(Ya*t+d)-en(d));return[u+o*s,i+o*f,a*e/rn(Ya*t+d)]}}return e.duration=1e3*r,e},oa.behavior.zoom=function(){function n(n){n.on(L,f).on($a+".zoom",g).on("dblclick.zoom",p).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function u(n){k.k=Math.max(A[0],Math.min(A[1],n))}function i(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function a(t,e,r,a){t.__chart__={x:k.x,y:k.y,k:k.k},u(Math.pow(2,a)),i(d=e,r),t=oa.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function o(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){o(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function s(n){--z||(n({type:"zoomend"}),d=null)}function f(){function n(){o=1,i(oa.mouse(u),h),c(a)}function r(){f.on(q,null).on(T,null),g(o),s(a)}var u=this,a=D.of(u,arguments),o=0,f=oa.select(t(u)).on(q,n).on(T,r),h=e(oa.mouse(u)),g=W(u);Ol.call(u),l(a)}function h(){function n(){var n=oa.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=oa.event.target;oa.select(t).on(x,r).on(b,o),_.push(t);for(var e=oa.event.changedTouches,u=0,i=e.length;i>u;++u)d[e[u].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var s=l[0];a(p,s,d[s.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var s=l[0],f=l[1],h=s[0]-f[0],g=s[1]-f[1];m=h*h+g*g}}function r(){var n,t,e,r,a=oa.touches(p);Ol.call(p);for(var o=0,l=a.length;l>o;++o,r=null)if(e=a[o],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],u(f*g)}M=null,i(n,t),c(v)}function o(){if(oa.event.touches.length){for(var t=oa.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}oa.selectAll(_).on(y,null),w.on(L,f).on(R,h),N(),s(v)}var g,p=this,v=D.of(p,arguments),d={},m=0,y=".zoom-"+oa.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,_=[],w=oa.select(p),N=W(p);t(),l(v),w.on(L,null).on(R,t)}function g(){var n=D.of(this,arguments);y?clearTimeout(y):(Ol.call(this),v=e(d=m||oa.mouse(this)),l(n)),y=setTimeout(function(){y=null,s(n)},50),S(),u(Math.pow(2,.002*Xa())*k.k),i(d,v),c(n)}function p(){var n=oa.mouse(this),t=Math.log(k.k)/Math.LN2;a(this,n,e(n),oa.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,m,y,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Ba,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return $a||($a="onwheel"in sa?(Xa=function(){return-oa.event.deltaY*(oa.event.deltaMode?120:1)},"wheel"):"onmousewheel"in sa?(Xa=function(){return oa.event.wheelDelta},"mousewheel"):(Xa=function(){return-oa.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Fl?oa.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],u=d?d[0]:e/2,i=d?d[1]:r/2,a=oa.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=a(t),o=e/r[2];this.__chart__=k={x:u-r[0]*o,y:i-r[1]*o,k:o},c(n)}}).each("interrupt.zoom",function(){s(n)}).each("end.zoom",function(){s(n)}):(this.__chart__=k,l(n),c(n),s(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},o(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},u(+t),o(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Ba:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},oa.rebind(n,D,"on")};var Xa,$a,Ba=[0,1/0];oa.color=on,on.prototype.toString=function(){return this.rgb()+""},oa.hsl=ln;var Wa=ln.prototype=new on;Wa.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Wa.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Wa.rgb=function(){return cn(this.h,this.s,this.l)},oa.hcl=sn;var Ja=sn.prototype=new on;Ja.brighter=function(n){return new sn(this.h,this.c,Math.min(100,this.l+Ga*(arguments.length?n:1)))},Ja.darker=function(n){return new sn(this.h,this.c,Math.max(0,this.l-Ga*(arguments.length?n:1)))},Ja.rgb=function(){return fn(this.h,this.c,this.l).rgb()},oa.lab=hn;var Ga=18,Ka=.95047,Qa=1,no=1.08883,to=hn.prototype=new on;to.brighter=function(n){return new hn(Math.min(100,this.l+Ga*(arguments.length?n:1)),this.a,this.b)},to.darker=function(n){return new hn(Math.max(0,this.l-Ga*(arguments.length?n:1)),this.a,this.b)},to.rgb=function(){return gn(this.l,this.a,this.b)},oa.rgb=yn;var eo=yn.prototype=new on;eo.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new yn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new yn(u,u,u)},eo.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new yn(n*this.r,n*this.g,n*this.b)},eo.hsl=function(){return wn(this.r,this.g,this.b)},eo.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ro=oa.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ro.forEach(function(n,t){ro.set(n,Mn(t))}),oa.functor=En,oa.xhr=An(y),oa.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var a=Cn(n,t,null==e?r:u(e),i);return a.row=function(n){return arguments.length?a.response(null==(e=n)?r:u(n)):e},a}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(a).join(n)}function a(n){return o.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var o=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=c)return a;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++s;){var r=n.charCodeAt(s++),o=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++o);else if(r!==l)continue;return n.slice(t,s-o)}return n.slice(t)}for(var r,u,i={},a={},o=[],c=n.length,s=0,f=0;(r=e())!==a;){for(var h=[];r!==i&&r!==a;)h.push(r),r=e();t&&null==(h=t(h,f++))||o.push(h)}return o},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new m,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(a).join(n)].concat(t.map(function(t){return u.map(function(n){return a(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},oa.csv=oa.dsv(",","text/csv"),oa.tsv=oa.dsv(" ","text/tab-separated-values");var uo,io,ao,oo,lo=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};oa.timer=function(){qn.apply(this,arguments)},oa.timer.flush=function(){Rn(),Dn()},oa.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var co=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(jn);oa.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=oa.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),co[8+e/3]};var so=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fo=oa.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=oa.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ho=oa.time={},go=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){po.setUTCDate.apply(this._,arguments)},setDay:function(){po.setUTCDay.apply(this._,arguments)},setFullYear:function(){po.setUTCFullYear.apply(this._,arguments)},setHours:function(){po.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){po.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){po.setUTCMinutes.apply(this._,arguments)},setMonth:function(){po.setUTCMonth.apply(this._,arguments)},setSeconds:function(){po.setUTCSeconds.apply(this._,arguments)},setTime:function(){po.setTime.apply(this._,arguments)}};var po=Date.prototype;ho.year=On(function(n){return n=ho.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ho.years=ho.year.range,ho.years.utc=ho.year.utc.range,ho.day=On(function(n){var t=new go(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ho.days=ho.day.range,ho.days.utc=ho.day.utc.range,ho.dayOfYear=function(n){var t=ho.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ho[n]=On(function(n){return(n=ho.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ho.year(n).getDay();return Math.floor((ho.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ho[n+"s"]=e.range,ho[n+"s"].utc=e.utc.range,ho[n+"OfYear"]=function(n){var e=ho.year(n).getDay();return Math.floor((ho.dayOfYear(n)+(e+t)%7)/7)}}),ho.week=ho.sunday,ho.weeks=ho.sunday.range,ho.weeks.utc=ho.sunday.utc.range,ho.weekOfYear=ho.sundayOfYear;var vo={"-":"",_:" ",0:"0"},mo=/^\s*\d+/,yo=/^%/;oa.locale=function(n){return{numberFormat:Un(n),timeFormat:Yn(n)}};var Mo=oa.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], -shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});oa.format=Mo.numberFormat,oa.geo={},st.prototype={s:0,t:0,add:function(n){ft(n,this.t,xo),ft(xo.s,this.s,this),this.s?this.t+=xo.t:this.s=xo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var xo=new st;oa.geo.stream=function(n,t){n&&bo.hasOwnProperty(n.type)?bo[n.type](n,t):ht(n,t)};var bo={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++rn?4*ja+n:n,ko.lineStart=ko.lineEnd=ko.point=b}};oa.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=dt([t*Oa,e*Oa]);if(m){var u=yt(m,r),i=[u[1],-u[0],0],a=yt(i,u);bt(a),a=_t(a);var l=t-p,c=l>0?1:-1,v=a[0]*Ia*c,d=Ma(l)>180;if(d^(v>c*p&&c*t>v)){var y=a[1]*Ia;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>c*p&&c*t>v)){var y=-a[1]*Ia;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?o(s,t)>o(s,h)&&(h=t):o(t,h)>o(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?o(s,t)>o(s,h)&&(h=t):o(t,h)>o(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=Ma(r)>180?r+(r>0?360:-360):r}else v=n,d=e;ko.point(n,e),t(n,e)}function i(){ko.lineStart()}function a(){u(v,d),ko.lineEnd(),Ma(y)>Da&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function o(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nSo?(s=-(h=180),f=-(g=90)):y>Da?g=90:-Da>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],oa.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],c(e[0],u)||c(e[1],u)?(o(u[0],e[1])>o(u[0],u[1])&&(u[1]=e[1]),o(e[0],u[1])>o(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var a,e,p=-(1/0),t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(a=o(u[1],e[0]))>p&&(p=a,s=e[0],h=u[1])}return M=x=null,s===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[s,f],[h,g]]}}(),oa.geo.centroid=function(n){No=Eo=Ao=Co=zo=Lo=qo=To=Ro=Do=Po=0,oa.geo.stream(n,jo);var t=Ro,e=Do,r=Po,u=t*t+e*e+r*r;return Pa>u&&(t=Lo,e=qo,r=To,Da>Eo&&(t=Ao,e=Co,r=zo),u=t*t+e*e+r*r,Pa>u)?[NaN,NaN]:[Math.atan2(e,t)*Ia,tn(r/Math.sqrt(u))*Ia]};var No,Eo,Ao,Co,zo,Lo,qo,To,Ro,Do,Po,jo={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){jo.lineStart=At},polygonEnd:function(){jo.lineStart=Nt}},Uo=Rt(zt,Ut,Ht,[-ja,-ja/2]),Fo=1e9;oa.geo.clipExtent=function(){var n,t,e,r,u,i,a={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(o){return arguments.length?(i=Zt(n=+o[0][0],t=+o[0][1],e=+o[1][0],r=+o[1][1]),u&&(u.valid=!1,u=null),a):[[n,t],[e,r]]}};return a.extent([[0,0],[960,500]])},(oa.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,oa.geo.albers=function(){return oa.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},oa.geo.albersUsa=function(){function n(n){var i=n[0],a=n[1];return t=null,e(i,a),t||(r(i,a),t)||u(i,a),t}var t,e,r,u,i=oa.geo.albers(),a=oa.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=oa.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?a:u>=.166&&.234>u&&r>=-.214&&-.115>r?o:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=a.stream(n),r=o.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),a.precision(t),o.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),a.scale(.35*t),o.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var c=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*c,f-.238*c],[s+.455*c,f+.238*c]]).stream(l).point,r=a.translate([s-.307*c,f+.201*c]).clipExtent([[s-.425*c+Da,f+.12*c+Da],[s-.214*c-Da,f+.234*c-Da]]).stream(l).point,u=o.translate([s-.205*c,f+.212*c]).clipExtent([[s-.214*c+Da,f+.166*c+Da],[s-.115*c-Da,f+.234*c-Da]]).stream(l).point,n},n.scale(1070)};var Ho,Oo,Io,Yo,Zo,Vo,Xo={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Oo=0,Xo.lineStart=$t},polygonEnd:function(){Xo.lineStart=Xo.lineEnd=Xo.point=b,Ho+=Ma(Oo/2)}},$o={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Bo={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Bo.lineStart=ne},polygonEnd:function(){Bo.point=Gt,Bo.lineStart=Kt,Bo.lineEnd=Qt}};oa.geo.path=function(){function n(n){return n&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=u(i)),oa.geo.stream(n,a)),i.result()}function t(){return a=null,n}var e,r,u,i,a,o=4.5;return n.area=function(n){return Ho=0,oa.geo.stream(n,u(Xo)),Ho},n.centroid=function(n){return Ao=Co=zo=Lo=qo=To=Ro=Do=Po=0,oa.geo.stream(n,u(Bo)),Po?[Ro/Po,Do/Po]:To?[Lo/To,qo/To]:zo?[Ao/zo,Co/zo]:[NaN,NaN]},n.bounds=function(n){return Zo=Vo=-(Io=Yo=1/0),oa.geo.stream(n,u($o)),[[Io,Yo],[Zo,Vo]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||re(n):y,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Wt:new te(n),"function"!=typeof o&&i.pointRadius(o),t()):r},n.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),n):o},n.projection(oa.geo.albersUsa()).context(null)},oa.geo.transform=function(n){return{stream:function(t){var e=new ue(t);for(var r in n)e[r]=n[r];return e}}},ue.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},oa.geo.projection=ae,oa.geo.projectionMutator=oe,(oa.geo.equirectangular=function(){return ae(ce)}).raw=ce.invert=ce,oa.geo.rotation=function(n){function t(t){return t=n(t[0]*Oa,t[1]*Oa),t[0]*=Ia,t[1]*=Ia,t}return n=fe(n[0]%360*Oa,n[1]*Oa,n.length>2?n[2]*Oa:0),t.invert=function(t){return t=n.invert(t[0]*Oa,t[1]*Oa),t[0]*=Ia,t[1]*=Ia,t},t},se.invert=ce,oa.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=fe(-n[0]*Oa,-n[1]*Oa,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ia,n[1]*=Ia}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Oa,u*Oa),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Oa,(u=+r)*Oa),n):u},n.angle(90)},oa.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Oa,u=n[1]*Oa,i=t[1]*Oa,a=Math.sin(r),o=Math.cos(r),l=Math.sin(u),c=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*a)*e+(e=c*s-l*f*o)*e),l*s+c*f*o)},oa.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return oa.range(Math.ceil(i/d)*d,u,d).map(h).concat(oa.range(Math.ceil(c/m)*m,l,m).map(g)).concat(oa.range(Math.ceil(r/p)*p,e,p).filter(function(n){return Ma(n%d)>Da}).map(s)).concat(oa.range(Math.ceil(o/v)*v,a,v).filter(function(n){return Ma(n%m)>Da}).map(f))}var e,r,u,i,a,o,l,c,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(l).slice(1),h(u).reverse().slice(1),g(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],c=+t[0][1],l=+t[1][1],i>u&&(t=i,i=u,u=t),c>l&&(t=c,c=l,l=t),n.precision(y)):[[i,c],[u,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),n.precision(y)):[[r,o],[e,a]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=me(o,a,90),f=ye(r,e,y),h=me(c,l,90),g=ye(i,u,y),n):y},n.majorExtent([[-180,-90+Da],[180,90-Da]]).minorExtent([[-180,-80-Da],[180,80+Da]])},oa.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=Me,u=xe;return n.distance=function(){return oa.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},oa.geo.interpolate=function(n,t){return be(n[0]*Oa,n[1]*Oa,t[0]*Oa,t[1]*Oa)},oa.geo.length=function(n){return Wo=0,oa.geo.stream(n,Jo),Wo};var Wo,Jo={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Go=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(oa.geo.azimuthalEqualArea=function(){return ae(Go)}).raw=Go;var Ko=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},y);(oa.geo.azimuthalEquidistant=function(){return ae(Ko)}).raw=Ko,(oa.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(oa.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var Qo=we(function(n){return 1/n},Math.atan);(oa.geo.gnomonic=function(){return ae(Qo)}).raw=Qo,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Ha]},(oa.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var nl=we(function(){return 1},Math.asin);(oa.geo.orthographic=function(){return ae(nl)}).raw=nl;var tl=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(oa.geo.stereographic=function(){return ae(tl)}).raw=tl,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Ha]},(oa.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,oa.geom={},oa.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=En(e),i=En(r),a=n.length,o=[],l=[];for(t=0;a>t;t++)o.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(o.sort(qe),t=0;a>t;t++)l.push([o[t][0],-o[t][1]]);var c=Le(o),s=Le(l),f=s[0]===c[0],h=s[s.length-1]===c[c.length-1],g=[];for(t=c.length-1;t>=0;--t)g.push(n[o[c[t]][2]]);for(t=+f;t=r&&c.x<=i&&c.y>=u&&c.y<=a?[[r,a],[i,a],[i,u],[r,u]]:[];s.point=n[o]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Da)*Da,y:Math.round(a(n,t)/Da)*Da,i:t}})}var r=Ce,u=ze,i=r,a=u,o=sl;return n?t(n):(t.links=function(n){return or(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return or(e(n)).cells.forEach(function(e,r){for(var u,i,a=e.site,o=e.edges.sort(Ve),l=-1,c=o.length,s=o[c-1].edge,f=s.l===a?s.r:s.l;++l=c,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=hr()),f?u=c:o=c,h?a=s:l=s,i(n,t,e,r,u,a,o,l)}var s,f,h,g,p,v,d,m,y,M=En(o),x=En(l);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,a)for(g=0;p>g;++g)s=n[g],s.xm&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=hr();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){gr(n,k,v,d,m,y)},k.find=function(n){return pr(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=pl.get(e)||gl,r=vl.get(r)||y,br(r(e.apply(null,la.call(arguments,1))))},oa.interpolateHcl=Rr,oa.interpolateHsl=Dr,oa.interpolateLab=Pr,oa.interpolateRound=jr,oa.transform=function(n){var t=sa.createElementNS(oa.ns.prefix.svg,"g");return(oa.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Ur(e?e.matrix:dl)})(n)},Ur.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var dl={a:1,b:0,c:0,d:1,e:0,f:0};oa.interpolateTransform=$r,oa.layout={},oa.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++eo*o/m){if(v>l){var c=t.charge/l;n.px-=i*c,n.py-=a*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=i*c,n.py-=a*c}}return!t.charge}}function t(n){n.px=oa.event.x,n.py=oa.event.y,l.resume()}var e,r,u,i,a,o,l={},c=oa.dispatch("start","tick","end"),s=[1,1],f=.9,h=ml,g=yl,p=-30,v=Ml,d=.1,m=.64,M=[],x=[];return l.tick=function(){if((u*=.99)<.005)return e=null,c.end({type:"end",alpha:u=0}),!0;var t,r,l,h,g,v,m,y,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,g=l.target,y=g.x-h.x,b=g.y-h.y,(v=y*y+b*b)&&(v=u*a[r]*((v=Math.sqrt(v))-i[r])/v,y*=v,b*=v,g.x-=y*(m=h.weight+g.weight?h.weight/(h.weight+g.weight):.5),g.y-=b*m,h.x+=y*(m=1-m),h.y+=b*m);if((m=u*d)&&(y=s[0]/2,b=s[1]/2,r=-1,m))for(;++r<_;)l=M[r],l.x+=(y-l.x)*m,l.y+=(b-l.y)*m;if(p)for(ru(t=oa.geom.quadtree(M),u,o),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*f,l.y-=(l.py-(l.py=l.y))*f);c.tick({type:"tick",alpha:u})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(s=n,l):s},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.friction=function(n){return arguments.length?(f=+n,l):f},l.charge=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(m=n*n,l):Math.sqrt(m)},l.alpha=function(n){return arguments.length?(n=+n,u?n>0?u=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:u=0})):n>0&&(c.start({type:"start",alpha:u=n}),e=qn(l.tick)),l):u},l.start=function(){function n(n,r){if(!e){for(e=new Array(u),l=0;u>l;++l)e[l]=[];for(l=0;c>l;++l){var i=x[l];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var a,o=e[t],l=-1,s=o.length;++lt;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;u>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",f)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(t=0;c>t;++t)i[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)i[t]=h;if(a=[],"function"==typeof g)for(t=0;c>t;++t)a[t]=+g.call(this,x[t],t);else for(t=0;c>t;++t)a[t]=g;if(o=[],"function"==typeof p)for(t=0;u>t;++t)o[t]=+p.call(this,M[t],t);else for(t=0;u>t;++t)o[t]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=oa.behavior.drag().origin(y).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",nu)),arguments.length?void this.on("mouseover.force",tu).on("mouseout.force",eu).call(r):r},oa.rebind(l,c,"on")};var ml=20,yl=1,Ml=1/0;oa.layout.hierarchy=function(){function n(u){var i,a=[u],o=[];for(u.depth=0;null!=(i=a.pop());)if(o.push(i),(c=e.call(n,i,i.depth))&&(l=c.length)){for(var l,c,s;--l>=0;)a.push(s=c[l]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return au(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),o}var t=cu,e=ou,r=lu;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(iu(t,function(n){n.children&&(n.value=0)}),au(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},oa.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(a=i.length)){var a,o,l,c=-1;for(r=t.value?r/t.value:0;++cf?-1:1),p=oa.sum(c),v=p?(f-l*g)/p:0,d=oa.range(l),m=[];return null!=e&&d.sort(e===xl?function(n,t){return c[t]-c[n]}:function(n,t){return e(a[n],a[t])}),d.forEach(function(n){m[n]={data:a[n],value:o=c[n],startAngle:s,endAngle:s+=o*v+g,padAngle:h}}),m}var t=Number,e=xl,r=0,u=Ua,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var xl={};oa.layout.stack=function(){function n(o,l){if(!(h=o.length))return o;var c=o.map(function(e,r){return t.call(n,e,r)}),s=c.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),a.call(n,t,e)]})}),f=e.call(n,s,l);c=oa.permute(c,f),s=oa.permute(s,f);var h,g,p,v,d=r.call(n,s,l),m=c[0].length;for(p=0;m>p;++p)for(u.call(n,c[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,c[g][p],v+=s[g-1][p][1],s[g][p][1]);return o}var t=y,e=pu,r=vu,u=gu,i=fu,a=hu;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:bl.get(t)||pu,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:_l.get(t)||vu,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(a=t,n):a},n.out=function(t){return arguments.length?(u=t,n):u},n};var bl=oa.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(du),i=n.map(mu),a=oa.range(r).sort(function(n,t){return u[n]-u[t]}),o=0,l=0,c=[],s=[];for(t=0;r>t;++t)e=a[t],l>o?(o+=i[e],c.push(e)):(l+=i[e],s.push(e));return s.reverse().concat(c)},reverse:function(n){return oa.range(n.length).reverse()},"default":pu}),_l=oa.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,a=[],o=0,l=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>o&&(o=r),a.push(r)}for(e=0;i>e;++e)l[e]=(o-a[e])/2;return l},wiggle:function(n){var t,e,r,u,i,a,o,l,c,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=l=c=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,o=f[e][0]-f[e-1][0];s>t;++t){for(r=0,a=(n[t][e][1]-n[t][e-1][1])/(2*o);t>r;++r)a+=(n[r][e][1]-n[r][e-1][1])/o;i+=a*n[t][e][1]}g[e]=l-=u?i/u*o:0,c>l&&(c=l)}for(e=0;h>e;++e)g[e]-=c;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,a=1/u,o=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=a}for(e=0;i>e;++e)o[e]=0;return o},zero:vu});oa.layout.histogram=function(){function n(n,i){for(var a,o,l=[],c=n.map(e,this),s=r.call(this,c,i),f=u.call(this,s,c,i),i=-1,h=c.length,g=f.length-1,p=t?1:1/h;++i0)for(i=-1;++i=s[0]&&o<=s[1]&&(a=l[oa.bisect(f,o,1,g)-1],a.y+=p,a.push(n[i]));return l}var t=!0,e=Number,r=bu,u=Mu;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return xu(n,t)}:En(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},oa.layout.pack=function(){function n(n,i){var a=e.call(this,n,i),o=a[0],l=u[0],c=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(o.x=o.y=0,au(o,function(n){n.r=+s(n.value)}),au(o,Nu),r){var f=r*(t?1:Math.max(2*o.r/l,2*o.r/c))/2;au(o,function(n){n.r+=f}),au(o,Nu),au(o,function(n){n.r-=f})}return Cu(o,l/2,c/2,t?1:1/Math.max(2*o.r/l,2*o.r/c)),a}var t,e=oa.layout.hierarchy().sort(_u),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},uu(n,e)},oa.layout.tree=function(){function n(n,u){var s=a.call(this,n,u),f=s[0],h=t(f);if(au(h,e),h.parent.m=-h.z,iu(h,r),c)iu(f,i);else{var g=f,p=f,v=f;iu(f,function(n){n.xp.x&&(p=n),n.depth>v.depth&&(v=n)});var d=o(g,p)/2-g.x,m=l[0]/(p.x+o(p,g)/2+d),y=l[1]/(v.depth||1);iu(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,a=0,o=i.length;o>a;++a)r.push((i[a]=u={_:i[a],parent:t,children:(u=i[a].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Du(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+o(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+o(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,a=t,l=u.parent.children[0],c=u.m,s=i.m,f=a.m,h=l.m;a=Tu(a),u=qu(u),a&&u;)l=qu(l),i=Tu(i),i.a=n,r=a.z+f-u.z-c+o(a._,u._),r>0&&(Ru(Pu(a,n,e),n,r),c+=r,s+=r),f+=a.m,c+=u.m,h+=l.m,s+=i.m;a&&!Tu(i)&&(i.t=a,i.m+=f-s),u&&!qu(l)&&(l.t=u,l.m+=c-h,e=n)}return e}function i(n){n.x*=l[0],n.y=n.depth*l[1]}var a=oa.layout.hierarchy().sort(null).value(null),o=Lu,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(o=t,n):o},n.size=function(t){return arguments.length?(c=null==(l=t)?i:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:i,n):c?l:null},uu(n,a)},oa.layout.cluster=function(){function n(n,i){var a,o=t.call(this,n,i),l=o[0],c=0;au(l,function(n){var t=n.children;t&&t.length?(n.x=Uu(t),n.y=ju(t)):(n.x=a?c+=e(n,a):0,n.y=0,a=n)});var s=Fu(l),f=Hu(l),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return au(l,u?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),o}var t=oa.layout.hierarchy().sort(null).value(null),e=Lu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},uu(n,t)},oa.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++ut?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var a,o,l,c=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?c.dx:"dice"===g?c.dy:"slice-dice"===g?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),s.area=0;(l=h.length)>0;)s.push(a=h[l-1]),s.area+=a.area,"squarify"!==g||(o=r(s,v))<=p?(h.pop(),p=o):(s.area-=s.pop().area,u(s,v,c,!1),v=Math.min(c.dx,c.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,c,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,a=f(t),o=r.slice(),l=[];for(n(o,a.dx*a.dy/t.value),l.area=0;i=o.pop();)l.push(i),l.area+=i.area,null!=i.z&&(u(l,i.z?a.dx:a.dy,a,!o.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,a=-1,o=n.length;++ae&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,a=n.length,o=e.x,c=e.y,s=t?l(n.area/t):0; +i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,o,t),S.lineEnd=a,a()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,o,l,c,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=o+g,_=l+p,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=Ma(Ma(w)-1)i||Ma((y*z+M*L)/x-.5)>.3||a>o*g+l*p+c*v)&&(u(t,e,r,o,l,c,A,C,N,b/=S,_/=S,w,d,m),m.point(A,C),u(A,C,N,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,a=Math.cos(30*Oa),o=16;return t.precision=function(n){return arguments.length?(o=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function re(n){var t=ee(function(t,e){return n([t*Ia,e*Ia])});return function(n){return le(t(n))}}function ue(n){this.stream=n}function ie(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ae(n){return oe(function(){return n})()}function oe(n){function t(n){return n=o(n[0]*Oa,n[1]*Oa),[n[0]*h+l,c-n[1]*h]}function e(n){return n=o.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Ia,n[1]*Ia]}function r(){o=Ct(a=fe(m,M,x),i);var n=i(v,d);return l=g-n[0]*h,c=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,a,o,l,c,s,f=ee(function(n,t){return n=i(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=Uo,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=le(b(a,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Uo):It((w=+n)*Oa),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Oa,d=n[1]%360*Oa,r()):[v*Ia,d*Ia]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Oa,M=n[1]%360*Oa,x=n.length>2?n[2]%360*Oa:0,r()):[m*Ia,M*Ia,x*Ia]},oa.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function le(n){return ie(n,function(t,e){n.point(t*Oa,e*Oa)})}function ce(n,t){return[n,t]}function se(n,t){return[n>ja?n-Ua:-ja>n?n+Ua:n,t]}function fe(n,t,e){return n?t||e?Ct(ge(n),pe(t,e)):ge(n):t||e?pe(t,e):se}function he(n){return function(t,e){return t+=n,[t>ja?t-Ua:-ja>t?t+Ua:t,e]}}function ge(n){var t=he(n);return t.invert=he(-n),t}function pe(n,t){function e(n,t){var e=Math.cos(t),o=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*r+o*u;return[Math.atan2(l*i-s*a,o*r-c*u),tn(s*i+l*a)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),a=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),o=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*i-l*a;return[Math.atan2(l*i+c*a,o*r+s*u),tn(s*r-o*u)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,a,o){var l=a*t;null!=u?(u=de(e,u),i=de(e,i),(a>0?i>u:u>i)&&(u+=a*Ua)):(u=n+a*Ua,i=n-.5*l);for(var c,s=u;a>0?s>i:i>s;s-=l)o.point((c=_t([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Da)%(2*Math.PI)}function me(n,t,e){var r=oa.range(n,t-Da,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function ye(n,t,e){var r=oa.range(n,t-Da,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),a=Math.cos(r),o=Math.sin(r),l=u*Math.cos(n),c=u*Math.sin(n),s=a*Math.cos(e),f=a*Math.sin(e),h=2*Math.asin(Math.sqrt(an(r-t)+u*a*an(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*l+t*s,u=e*c+t*f,a=e*i+t*o;return[Math.atan2(u,r)*Ia,Math.atan2(a,Math.sqrt(r*r+u*u))*Ia]}:function(){return[n*Ia,t*Ia]};return p.distance=h,p}function _e(){function n(n,u){var i=Math.sin(u*=Oa),a=Math.cos(u),o=Ma((n*=Oa)-t),l=Math.cos(o);Wo+=Math.atan2(Math.sqrt((o=a*Math.sin(o))*o+(o=r*i-e*a*l)*o),e*i+r*a*l),t=n,e=i,r=a}var t,e,r;Jo.point=function(u,i){t=u*Oa,e=Math.sin(i*=Oa),r=Math.cos(i),Jo.point=n},Jo.lineEnd=function(){Jo.point=Jo.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),a=Math.cos(u);return[Math.atan2(n*i,r*a),Math.asin(r&&e*i/r)]},e}function Se(n,t){function e(n,t){a>0?-Ha+Da>t&&(t=-Ha+Da):t>Ha-Da&&(t=Ha-Da);var e=a/Math.pow(u(t),i);return[e*Math.sin(i*n),a-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(ja/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),a=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=a-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(a/r,1/i))-Ha]},e):Ne}function ke(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return Ma(u)u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var u=n[0],i=e[0],a=t[0]-u,o=r[0]-i,l=n[1],c=e[1],s=t[1]-l,f=r[1]-c,h=(o*(l-c)-f*(u-i))/(f*a-o*s);return[u+h*a,l+h*s]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function je(n){var t=ll.pop()||new Pe;return t.site=n,t}function Ue(n){Be(n),il.remove(n),ll.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,a=n.N,o=[n];Ue(n);for(var l=i;l.circle&&Ma(e-l.circle.x)s;++s)c=o[s],l=o[s-1],nr(c.edge,l.site,c.site,u);l=o[0],c=o[f-1],c.edge=Ke(l.site,c.site,null,u),$e(l),$e(c)}function He(n){for(var t,e,r,u,i=n.x,a=n.y,o=il._;o;)if(r=Oe(o,a)-i,r>Da)o=o.L;else{if(u=i-Ie(o,a),!(u>Da)){r>-Da?(t=o.P,e=o):u>-Da?(t=o,e=o.N):t=e=o;break}if(!o.R){t=o;break}o=o.R}var l=je(n);if(il.insert(t,l),t||e){if(t===e)return Be(t),e=je(t.site),il.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,s=c.x,f=c.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};nr(e.edge,c,p,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,p,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var a=n.P;if(!a)return-(1/0);e=a.site;var o=e.x,l=e.y,c=l-t;if(!c)return o;var s=o-r,f=1/i-1/c,h=s/c;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*c)-l+c/2+u-i/2)))/f+r:(r+o)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,u,i,a,o,l,c,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=ul,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(o=i.edges,l=o.length,a=0;l>a;)s=o[a].end(),r=s.x,u=s.y,c=o[++a%l].start(),t=c.x,e=c.y,(Ma(r-t)>Da||Ma(u-e)>Da)&&(o.splice(a,0,new tr(Qe(i.site,s,Ma(r-f)Da?{x:f,y:Ma(t-f)Da?{x:Ma(e-p)Da?{x:h,y:Ma(t-h)Da?{x:Ma(e-g)=-Pa)){var g=l*l+c*c,p=s*s+f*f,v=(f*g-c*p)/h,d=(l*p-s*g)/h,f=d+o,m=cl.pop()||new Xe;m.arc=n,m.site=u,m.x=v+a,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=ol._;M;)if(m.yd||d>=o)return;if(h>p){if(i){if(i.y>=c)return}else i={x:d,y:l};e={x:d,y:c}}else{if(i){if(i.yr||r>1)if(h>p){if(i){if(i.y>=c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else{if(i){if(i.yg){if(i){if(i.x>=o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}else{if(i){if(i.xi||f>a||r>h||u>g)){if(p=n.point){var p,v=t-n.x,d=e-n.y,m=v*v+d*d;if(l>m){var y=Math.sqrt(l=m);r=t-y,u=e-y,i=t+y,a=e+y,o=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,s,f,x,b);break;case 1:c(n,x,f,h,b);break;case 2:c(n,s,b,x,g);break;case 3:c(n,x,b,h,g)}}}(n,r,u,i,a),o}function vr(n,t){n=oa.rgb(n),t=oa.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,a=t.g-r,o=t.b-u;return function(n){return"#"+bn(Math.round(e+i*n))+bn(Math.round(r+a*n))+bn(Math.round(u+o*n))}}function dr(n,t){var e,r={},u={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function mr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function yr(n,t){var e,r,u,i=fl.lastIndex=hl.lastIndex=0,a=-1,o=[],l=[];for(n+="",t+="";(e=fl.exec(n))&&(r=hl.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),o[a]?o[a]+=u:o[++a]=u),(e=e[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:mr(e,r)})),i=hl.lastIndex;return ir;++r)o[(e=l[r]).i]=e.x(n);return o.join("")})}function Mr(n,t){for(var e,r=oa.interpolators.length;--r>=0&&!(e=oa.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],u=[],i=n.length,a=t.length,o=Math.min(n.length,t.length);for(e=0;o>e;++e)r.push(Mr(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;a>e;++e)u[e]=t[e];return function(n){for(e=0;o>e;++e)u[e]=r[e](n);return u}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Ha)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Ua*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Ua/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=oa.hcl(n),t=oa.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,a=t.c-r,o=t.l-u;return isNaN(a)&&(a=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return fn(e+i*n,r+a*n,u+o*n)+""}}function Dr(n,t){n=oa.hsl(n),t=oa.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,a=t.s-r,o=t.l-u;return isNaN(a)&&(a=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return cn(e+i*n,r+a*n,u+o*n)+""}}function Pr(n,t){n=oa.lab(n),t=oa.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,a=t.a-r,o=t.b-u;return function(n){return gn(e+i*n,r+a*n,u+o*n)+""}}function jr(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Ur(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),u=Fr(t,e),i=Hr(Or(e,t,-u))||0;t[0]*e[1]180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:mr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:mr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var u=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:u-4,x:mr(n[0],t[0])},{i:u-2,x:mr(n[1],t[1])})}else(1!==t[0]||1!==t[1])&&e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=oa.transform(n),t=oa.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,u=-1,i=r.length;++u=0;)e.push(u[r])}function au(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,a=-1;++ae;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function mu(n){return n.reduce(yu,0)}function yu(n,t){return n+t[1]}function Mu(n,t){return xu(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xu(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function bu(n){return[oa.min(n),oa.max(n)]}function _u(n,t){return n.value-t.value}function wu(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Su(n,t){n._pack_next=t,t._pack_prev=n}function ku(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Nu(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(c=e.length)){var e,r,u,i,a,o,l,c,s=1/0,f=-(1/0),h=1/0,g=-(1/0);if(e.forEach(Eu),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(u=e[1],u.x=u.r,u.y=0,t(u),c>2))for(i=e[2],zu(r,u,i),t(i),wu(r,i),r._pack_prev=i,wu(i,u),u=r._pack_next,a=3;c>a;a++){zu(r,u,i=e[a]);var p=0,v=1,d=1;for(o=u._pack_next;o!==u;o=o._pack_next,v++)if(ku(o,i)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!ku(l,i);l=l._pack_prev,d++);p?(d>v||v==d&&u.ra;a++)i=e[a],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(Au)}}function Eu(n){n._pack_next=n._pack_prev=n}function Au(n){delete n._pack_next,delete n._pack_prev}function Cu(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,a=u.length;++i=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pu(n,t,e){return n.a.parent===t.parent?n.a:e}function ju(n){return 1+oa.max(n,function(n){return n.y})}function Uu(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fu(n){var t=n.children;return t&&t.length?Fu(t[0]):n}function Hu(n){var t,e=n.children;return e&&(t=e.length)?Hu(e[t-1]):n}function Ou(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Iu(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Yu(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zu(n){return n.rangeExtent?n.rangeExtent():Yu(n.range())}function Vu(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Xu(n,t){var e,r=0,u=n.length-1,i=n[r],a=n[u];return i>a&&(e=r,r=u,u=e,e=i,i=a,a=e),n[r]=t.floor(i),n[u]=t.ceil(a),n}function $u(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:wl}function Bu(n,t,e,r){var u=[],i=[],a=0,o=Math.min(n.length,t.length)-1;for(n[o]2?Bu:Vu,l=r?Wr:Br;return a=u(n,t,l,e),o=u(t,n,l,Mr),i}function i(n){return a(n)}var a,o;return i.invert=function(n){return o(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(jr)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Qu(n,t)},i.tickFormat=function(t,e){return ni(n,t,e)},i.nice=function(t){return Gu(n,t),u()},i.copy=function(){return Wu(n,t,e,r)},u()}function Ju(n,t){return oa.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gu(n,t){return Xu(n,$u(Ku(n,t)[2])),Xu(n,$u(Ku(n,t)[2])),n}function Ku(n,t){null==t&&(t=10);var e=Yu(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Qu(n,t){return oa.range.apply(oa,Ku(n,t))}function ni(n,t,e){var r=Ku(n,t);if(e){var u=so.exec(e);if(u.shift(),"s"===u[8]){var i=oa.formatPrefix(Math.max(Ma(r[0]),Ma(r[1])));return u[7]||(u[7]="."+ti(i.scale(r[2]))),u[8]="f",e=oa.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+ei(u[8],r)),e=u.join("")}else e=",."+ti(r[2])+"f";return oa.format(e)}function ti(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function ei(n,t){var e=ti(t[2]);return n in Sl?Math.abs(e-ti(Math.max(Ma(t[0]),Ma(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ri(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function a(t){return n(u(t))}return a.invert=function(t){return i(n.invert(t))},a.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),a):r},a.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),a):t},a.nice=function(){var t=Xu(r.map(u),e?Math:Nl);return n.domain(t),r=t.map(i),a},a.ticks=function(){var n=Yu(r),a=[],o=n[0],l=n[1],c=Math.floor(u(o)),s=Math.ceil(u(l)),f=t%1?2:t;if(isFinite(s-c)){if(e){for(;s>c;c++)for(var h=1;f>h;h++)a.push(i(c)*h);a.push(i(c))}else for(a.push(i(c));c++0;h--)a.push(i(c)*h);for(c=0;a[c]l;s--);a=a.slice(c,s)}return a},a.tickFormat=function(n,e){if(!arguments.length)return kl;arguments.length<2?e=kl:"function"!=typeof e&&(e=oa.format(e));var r=Math.max(1,t*n/a.ticks().length);return function(n){var a=n/i(Math.round(u(n)));return t-.5>a*t&&(a*=t),r>=a?e(n):""}},a.copy=function(){return ri(n.copy(),t,e,r)},Ju(a,n)}function ui(n,t,e){function r(t){return n(u(t))}var u=ii(t),i=ii(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Qu(e,n)},r.tickFormat=function(n,t){return ni(e,n,t)},r.nice=function(n){return r.domain(Gu(e,n))},r.exponent=function(a){return arguments.length?(u=ii(t=a),i=ii(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return ui(n.copy(),t,e)},Ju(r,n)}function ii(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ai(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):NaN))-1)%i.length]}function r(t,e){return oa.range(n.length).map(function(n){return t+e*n})}var u,i,a;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new c;for(var i,a=-1,o=r.length;++ae?[NaN,NaN]:[e>0?o[e-1]:n[0],et?NaN:t/i+n,[t,t+1/i]},r.copy=function(){return li(n,t,e)},u()}function ci(n,t){function e(e){return e>=e?t[oa.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return ci(n,t)},e}function si(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qu(n,t)},t.tickFormat=function(t,e){return ni(n,t,e)},t.copy=function(){return si(n)},t}function fi(){return 0}function hi(n){return n.innerRadius}function gi(n){return n.outerRadius}function pi(n){return n.startAngle}function vi(n){return n.endAngle}function di(n){return n&&n.padAngle}function mi(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function yi(n,t,e,r,u){var i=n[0]-t[0],a=n[1]-t[1],o=(u?r:-r)/Math.sqrt(i*i+a*a),l=o*a,c=-o*i,s=n[0]+l,f=n[1]+c,h=t[0]+l,g=t[1]+c,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(Math.max(0,M*M*y-x*x)),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,N=_-p,E=w-v,A=S-p,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mi(n){function t(t){function a(){c.push("M",i(n(s),o))}for(var l,c=[],s=[],f=-1,h=t.length,g=En(e),p=En(r);++f1?n.join("L"):n+"Z"}function bi(n){return n.join("L")+"Z"}function _i(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t1&&u.push("H",r[0]),u.join("")}function wi(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t1){o=t[1],i=n[l],l++,r+="C"+(u[0]+a[0])+","+(u[1]+a[1])+","+(i[0]-o[0])+","+(i[1]-o[1])+","+i[0]+","+i[1];for(var c=2;c9&&(u=3*t/Math.sqrt(u),a[o]=u*e,a[o+1]=u*r));for(o=-1;++o<=l;)u=(n[Math.min(l,o+1)][0]-n[Math.max(0,o-1)][0])/(6*(1+a[o]*a[o])),i.push([u||0,a[o]*u||0]);return i}function Fi(n){return n.length<3?xi(n):n[0]+Ai(n,Ui(n))}function Hi(n){for(var t,e,r,u=-1,i=n.length;++u=t?a(n-t):void(s.c=a)}function a(e){var u=p.active,i=p[u];i&&(i.timer.c=null,i.timer.t=NaN,--p.count,delete p[u],i.event&&i.event.interrupt.call(n,n.__data__,i.index));for(var a in p)if(r>+a){var c=p[a];c.timer.c=null,c.timer.t=NaN,--p.count,delete p[a]}s.c=o,qn(function(){return s.c&&o(e||1)&&(s.c=null,s.t=NaN),1},0,l),p.active=r,v.event&&v.event.start.call(n,n.__data__,t),g=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&g.push(r)}),h=v.ease,f=v.duration}function o(u){for(var i=u/f,a=h(i),o=g.length;o>0;)g[--o].call(n,a);return i>=1?(v.event&&v.event.end.call(n,n.__data__,t),--p.count?delete p[r]:delete n[e],1):void 0}var l,s,f,h,g,p=n[e]||(n[e]={active:0,count:0}),v=p[r];v||(l=u.time,s=qn(i,0,l),v=p[r]={tween:new c,time:l,timer:s,delay:u.delay,duration:u.duration,ease:u.ease,index:t},u=null,++p.count)}function na(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function ta(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function ea(n){return n.toISOString()}function ra(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=oa.bisect(Gl,u);return i==Gl.length?[t.year,Ku(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Gl[i-1]1?{floor:function(t){for(;e(t=n.floor(t));)t=ua(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=ua(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yu(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],ua(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ra(n.copy(),t,e)},Ju(r,n)}function ua(n){return new Date(n)}function ia(n){return JSON.parse(n.responseText)}function aa(n){var t=sa.createRange();return t.selectNode(sa.body),t.createContextualFragment(n.responseText)}var oa={version:"3.5.12"},la=[].slice,ca=function(n){return la.call(n)},sa=this.document;if(sa)try{ca(sa.documentElement.childNodes)[0].nodeType}catch(fa){ca=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),sa)try{sa.createElement("DIV").style.setProperty("opacity",0,"")}catch(ha){var ga=this.Element.prototype,pa=ga.setAttribute,va=ga.setAttributeNS,da=this.CSSStyleDeclaration.prototype,ma=da.setProperty;ga.setAttribute=function(n,t){pa.call(this,n,t+"")},ga.setAttributeNS=function(n,t,e){va.call(this,n,t,e+"")},da.setProperty=function(n,t,e){ma.call(this,n,t+"",e)}}oa.ascending=e,oa.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},oa.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=r){e=r;break}for(;++ur&&(e=r)}else{for(;++u=r){e=r;break}for(;++ur&&(e=r)}return e},oa.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=r){e=r;break}for(;++ue&&(e=r)}else{for(;++u=r){e=r;break}for(;++ue&&(e=r)}return e},oa.extent=function(n,t){var e,r,u,i=-1,a=n.length;if(1===arguments.length){for(;++i=r){e=u=r;break}for(;++ir&&(e=r),r>u&&(u=r))}else{for(;++i=r){e=u=r;break}for(;++ir&&(e=r),r>u&&(u=r))}return[e,u]},oa.sum=function(n,t){var e,r=0,i=n.length,a=-1;if(1===arguments.length)for(;++a1?l/(s-1):void 0},oa.deviation=function(){var n=oa.variance.apply(this,arguments);return n?Math.sqrt(n):n};var ya=i(e);oa.bisectLeft=ya.left,oa.bisect=oa.bisectRight=ya.right,oa.bisector=function(n){return i(1===n.length?function(t,r){return e(n(t),r)}:n)},oa.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=Math.random()*i--|0,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},oa.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},oa.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},oa.zip=function(){if(!(r=arguments.length))return[];for(var n=-1,t=oa.min(arguments,a),e=new Array(t);++n=0;)for(r=n[u],t=r.length;--t>=0;)e[--a]=r[t];return e};var Ma=Math.abs;oa.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,u=[],i=o(Ma(e)),a=-1;if(n*=i,t*=i,e*=i,0>e)for(;(r=n+e*++a)>t;)u.push(r/i);else for(;(r=n+e*++a)=i.length)return r?r.call(u,a):e?a.sort(e):a;for(var l,s,f,h,g=-1,p=a.length,v=i[o++],d=new c;++g=i.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],a=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(oa.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return a[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},oa.set=function(n){var t=new m;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(m,{has:h,add:function(n){return this._[s(n+="")]=!0,n},remove:g,values:p,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t))}}),oa.behavior={},oa.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},oa.event=null,oa.requote=function(n){return n.replace(wa,"\\$&")};var wa=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Sa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},ka=function(n,t){return t.querySelector(n)},Na=function(n,t){return t.querySelectorAll(n)},Ea=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ea=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(ka=function(n,t){return Sizzle(n,t)[0]||null},Na=Sizzle,Ea=Sizzle.matchesSelector),oa.selection=function(){return oa.select(sa.documentElement)};var Aa=oa.selection.prototype=[];Aa.select=function(n){var t,e,r,u,i=[];n=A(n);for(var a=-1,o=this.length;++a=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Ca.hasOwnProperty(e)?{space:Ca[e],local:n}:n}},Aa.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=oa.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Aa.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,u=-1;if(t=e.classList){for(;++uu){if("string"!=typeof n){2>u&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>u){var i=this.node();return t(i).getComputedStyle(i,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Aa.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(j(t,n[t]));return this}return this.each(j(n,t))},Aa.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Aa.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Aa.append=function(n){return n=U(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Aa.insert=function(n,t){return n=U(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Aa.remove=function(){return this.each(F)},Aa.data=function(n,t){function e(n,e){var r,u,i,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),v=new Array(a);if(t){var d,m=new c,y=new Array(a);for(r=-1;++rr;++r)p[r]=H(e[r]);for(;a>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,o.push(p),l.push(g),s.push(v)}var r,u,i=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++ii;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var o=0,l=e.length;l>o;o++)(r=e[o])&&n.call(r,r.__data__,o,i)&&t.push(r)}return E(u)},Aa.order=function(){for(var n=-1,t=this.length;++n=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},Aa.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++tn;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},Aa.size=function(){var n=0;return Y(this,function(){++n}),n};var za=[];oa.selection.enter=Z,oa.selection.enter.prototype=za,za.append=Aa.append,za.empty=Aa.empty,za.node=Aa.node,za.call=Aa.call,za.size=Aa.size,za.select=function(n){for(var t,e,r,u,i,a=[],o=-1,l=this.length;++or){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var La=oa.map({mouseenter:"mouseover",mouseleave:"mouseout"});sa&&La.forEach(function(n){"on"+n in sa&&La.remove(n)});var qa,Ta=0;oa.mouse=function(n){return J(n,k())};var Ra=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;oa.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return J(n,r)},oa.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",a)}function e(n,t,e,i,a){return function(){function o(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(m.on(i+d,null).on(a+d,null),y(p),g({type:"dragend"}))}var c,s=this,f=oa.event.target,h=s.parentNode,g=r.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=oa.select(e(f)).on(i+d,o).on(a+d,l),y=W(f),M=t(h,v);u?(c=u.apply(s,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],g({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),u=null,i=e(b,oa.mouse,t,"mousemove","mouseup"),a=e(G,oa.touch,y,"touchmove","touchend");return n.origin=function(t){return arguments.length?(u=t,n):u},oa.rebind(n,r,"on")},oa.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?ca(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Da=1e-6,Pa=Da*Da,ja=Math.PI,Ua=2*ja,Fa=Ua-Da,Ha=ja/2,Oa=ja/180,Ia=180/ja,Ya=Math.SQRT2,Za=2,Va=4;oa.interpolateZoom=function(n,t){var e,r,u=n[0],i=n[1],a=n[2],o=t[0],l=t[1],c=t[2],s=o-u,f=l-i,h=s*s+f*f;if(Pa>h)r=Math.log(c/a)/Ya,e=function(n){return[u+n*s,i+n*f,a*Math.exp(Ya*n*r)]};else{var g=Math.sqrt(h),p=(c*c-a*a+Va*h)/(2*a*Za*g),v=(c*c-a*a-Va*h)/(2*c*Za*g),d=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(v*v+1)-v);r=(m-d)/Ya,e=function(n){var t=n*r,e=rn(d),o=a/(Za*g)*(e*un(Ya*t+d)-en(d));return[u+o*s,i+o*f,a*e/rn(Ya*t+d)]}}return e.duration=1e3*r,e},oa.behavior.zoom=function(){function n(n){n.on(L,f).on($a+".zoom",g).on("dblclick.zoom",p).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function u(n){k.k=Math.max(A[0],Math.min(A[1],n))}function i(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function a(t,e,r,a){t.__chart__={x:k.x,y:k.y,k:k.k},u(Math.pow(2,a)),i(d=e,r),t=oa.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function o(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){o(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function s(n){--z||(n({type:"zoomend"}),d=null)}function f(){function n(){o=1,i(oa.mouse(u),h),c(a)}function r(){f.on(q,null).on(T,null),g(o),s(a)}var u=this,a=D.of(u,arguments),o=0,f=oa.select(t(u)).on(q,n).on(T,r),h=e(oa.mouse(u)),g=W(u);Ol.call(u),l(a)}function h(){function n(){var n=oa.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=oa.event.target;oa.select(t).on(x,r).on(b,o),_.push(t);for(var e=oa.event.changedTouches,u=0,i=e.length;i>u;++u)d[e[u].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var s=l[0];a(p,s,d[s.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var s=l[0],f=l[1],h=s[0]-f[0],g=s[1]-f[1];m=h*h+g*g}}function r(){var n,t,e,r,a=oa.touches(p);Ol.call(p);for(var o=0,l=a.length;l>o;++o,r=null)if(e=a[o],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],u(f*g)}M=null,i(n,t),c(v)}function o(){if(oa.event.touches.length){for(var t=oa.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}oa.selectAll(_).on(y,null),w.on(L,f).on(R,h),N(),s(v)}var g,p=this,v=D.of(p,arguments),d={},m=0,y=".zoom-"+oa.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,_=[],w=oa.select(p),N=W(p);t(),l(v),w.on(L,null).on(R,t)}function g(){var n=D.of(this,arguments);y?clearTimeout(y):(Ol.call(this),v=e(d=m||oa.mouse(this)),l(n)),y=setTimeout(function(){y=null,s(n)},50),S(),u(Math.pow(2,.002*Xa())*k.k),i(d,v),c(n)}function p(){var n=oa.mouse(this),t=Math.log(k.k)/Math.LN2;a(this,n,e(n),oa.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,m,y,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Ba,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return $a||($a="onwheel"in sa?(Xa=function(){return-oa.event.deltaY*(oa.event.deltaMode?120:1)},"wheel"):"onmousewheel"in sa?(Xa=function(){return oa.event.wheelDelta},"mousewheel"):(Xa=function(){return-oa.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Fl?oa.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],u=d?d[0]:e/2,i=d?d[1]:r/2,a=oa.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=a(t),o=e/r[2];this.__chart__=k={x:u-r[0]*o,y:i-r[1]*o,k:o},c(n)}}).each("interrupt.zoom",function(){s(n)}).each("end.zoom",function(){s(n)}):(this.__chart__=k,l(n),c(n),s(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},o(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},u(+t),o(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Ba:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},oa.rebind(n,D,"on")};var Xa,$a,Ba=[0,1/0];oa.color=on,on.prototype.toString=function(){return this.rgb()+""},oa.hsl=ln;var Wa=ln.prototype=new on;Wa.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Wa.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Wa.rgb=function(){return cn(this.h,this.s,this.l)},oa.hcl=sn;var Ja=sn.prototype=new on;Ja.brighter=function(n){return new sn(this.h,this.c,Math.min(100,this.l+Ga*(arguments.length?n:1)))},Ja.darker=function(n){return new sn(this.h,this.c,Math.max(0,this.l-Ga*(arguments.length?n:1)))},Ja.rgb=function(){return fn(this.h,this.c,this.l).rgb()},oa.lab=hn;var Ga=18,Ka=.95047,Qa=1,no=1.08883,to=hn.prototype=new on;to.brighter=function(n){return new hn(Math.min(100,this.l+Ga*(arguments.length?n:1)),this.a,this.b)},to.darker=function(n){return new hn(Math.max(0,this.l-Ga*(arguments.length?n:1)),this.a,this.b)},to.rgb=function(){return gn(this.l,this.a,this.b)},oa.rgb=yn;var eo=yn.prototype=new on;eo.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new yn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new yn(u,u,u)},eo.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new yn(n*this.r,n*this.g,n*this.b)},eo.hsl=function(){return wn(this.r,this.g,this.b)},eo.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ro=oa.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ro.forEach(function(n,t){ro.set(n,Mn(t))}),oa.functor=En,oa.xhr=An(y),oa.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var a=Cn(n,t,null==e?r:u(e),i);return a.row=function(n){return arguments.length?a.response(null==(e=n)?r:u(n)):e},a}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(a).join(n)}function a(n){return o.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var o=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=c)return a;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++s;){var r=n.charCodeAt(s++),o=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++o);else if(r!==l)continue;return n.slice(t,s-o)}return n.slice(t)}for(var r,u,i={},a={},o=[],c=n.length,s=0,f=0;(r=e())!==a;){for(var h=[];r!==i&&r!==a;)h.push(r),r=e();t&&null==(h=t(h,f++))||o.push(h)}return o},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new m,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(a).join(n)].concat(t.map(function(t){return u.map(function(n){return a(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},oa.csv=oa.dsv(",","text/csv"),oa.tsv=oa.dsv(" ","text/tab-separated-values");var uo,io,ao,oo,lo=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};oa.timer=function(){qn.apply(this,arguments)},oa.timer.flush=function(){Rn(),Dn()},oa.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var co=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(jn);oa.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=oa.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),co[8+e/3]};var so=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fo=oa.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=oa.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ho=oa.time={},go=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){po.setUTCDate.apply(this._,arguments)},setDay:function(){po.setUTCDay.apply(this._,arguments)},setFullYear:function(){po.setUTCFullYear.apply(this._,arguments)},setHours:function(){po.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){po.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){po.setUTCMinutes.apply(this._,arguments)},setMonth:function(){po.setUTCMonth.apply(this._,arguments)},setSeconds:function(){po.setUTCSeconds.apply(this._,arguments)},setTime:function(){po.setTime.apply(this._,arguments)}};var po=Date.prototype;ho.year=On(function(n){return n=ho.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ho.years=ho.year.range,ho.years.utc=ho.year.utc.range,ho.day=On(function(n){var t=new go(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ho.days=ho.day.range,ho.days.utc=ho.day.utc.range,ho.dayOfYear=function(n){var t=ho.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ho[n]=On(function(n){return(n=ho.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ho.year(n).getDay();return Math.floor((ho.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ho[n+"s"]=e.range,ho[n+"s"].utc=e.utc.range,ho[n+"OfYear"]=function(n){var e=ho.year(n).getDay();return Math.floor((ho.dayOfYear(n)+(e+t)%7)/7)}}),ho.week=ho.sunday,ho.weeks=ho.sunday.range,ho.weeks.utc=ho.sunday.utc.range,ho.weekOfYear=ho.sundayOfYear;var vo={"-":"",_:" ",0:"0"},mo=/^\s*\d+/,yo=/^%/;oa.locale=function(n){return{numberFormat:Un(n),timeFormat:Yn(n)}};var Mo=oa.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], +shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});oa.format=Mo.numberFormat,oa.geo={},st.prototype={s:0,t:0,add:function(n){ft(n,this.t,xo),ft(xo.s,this.s,this),this.s?this.t+=xo.t:this.s=xo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var xo=new st;oa.geo.stream=function(n,t){n&&bo.hasOwnProperty(n.type)?bo[n.type](n,t):ht(n,t)};var bo={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++rn?4*ja+n:n,ko.lineStart=ko.lineEnd=ko.point=b}};oa.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=dt([t*Oa,e*Oa]);if(m){var u=yt(m,r),i=[u[1],-u[0],0],a=yt(i,u);bt(a),a=_t(a);var l=t-p,c=l>0?1:-1,v=a[0]*Ia*c,d=Ma(l)>180;if(d^(v>c*p&&c*t>v)){var y=a[1]*Ia;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>c*p&&c*t>v)){var y=-a[1]*Ia;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?o(s,t)>o(s,h)&&(h=t):o(t,h)>o(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?o(s,t)>o(s,h)&&(h=t):o(t,h)>o(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=Ma(r)>180?r+(r>0?360:-360):r}else v=n,d=e;ko.point(n,e),t(n,e)}function i(){ko.lineStart()}function a(){u(v,d),ko.lineEnd(),Ma(y)>Da&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function o(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nSo?(s=-(h=180),f=-(g=90)):y>Da?g=90:-Da>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],oa.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],c(e[0],u)||c(e[1],u)?(o(u[0],e[1])>o(u[0],u[1])&&(u[1]=e[1]),o(e[0],u[1])>o(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var a,e,p=-(1/0),t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(a=o(u[1],e[0]))>p&&(p=a,s=e[0],h=u[1])}return M=x=null,s===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[s,f],[h,g]]}}(),oa.geo.centroid=function(n){No=Eo=Ao=Co=zo=Lo=qo=To=Ro=Do=Po=0,oa.geo.stream(n,jo);var t=Ro,e=Do,r=Po,u=t*t+e*e+r*r;return Pa>u&&(t=Lo,e=qo,r=To,Da>Eo&&(t=Ao,e=Co,r=zo),u=t*t+e*e+r*r,Pa>u)?[NaN,NaN]:[Math.atan2(e,t)*Ia,tn(r/Math.sqrt(u))*Ia]};var No,Eo,Ao,Co,zo,Lo,qo,To,Ro,Do,Po,jo={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){jo.lineStart=At},polygonEnd:function(){jo.lineStart=Nt}},Uo=Rt(zt,Ut,Ht,[-ja,-ja/2]),Fo=1e9;oa.geo.clipExtent=function(){var n,t,e,r,u,i,a={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(o){return arguments.length?(i=Zt(n=+o[0][0],t=+o[0][1],e=+o[1][0],r=+o[1][1]),u&&(u.valid=!1,u=null),a):[[n,t],[e,r]]}};return a.extent([[0,0],[960,500]])},(oa.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,oa.geo.albers=function(){return oa.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},oa.geo.albersUsa=function(){function n(n){var i=n[0],a=n[1];return t=null,e(i,a),t||(r(i,a),t)||u(i,a),t}var t,e,r,u,i=oa.geo.albers(),a=oa.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=oa.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?a:u>=.166&&.234>u&&r>=-.214&&-.115>r?o:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=a.stream(n),r=o.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),a.precision(t),o.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),a.scale(.35*t),o.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var c=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*c,f-.238*c],[s+.455*c,f+.238*c]]).stream(l).point,r=a.translate([s-.307*c,f+.201*c]).clipExtent([[s-.425*c+Da,f+.12*c+Da],[s-.214*c-Da,f+.234*c-Da]]).stream(l).point,u=o.translate([s-.205*c,f+.212*c]).clipExtent([[s-.214*c+Da,f+.166*c+Da],[s-.115*c-Da,f+.234*c-Da]]).stream(l).point,n},n.scale(1070)};var Ho,Oo,Io,Yo,Zo,Vo,Xo={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Oo=0,Xo.lineStart=$t},polygonEnd:function(){Xo.lineStart=Xo.lineEnd=Xo.point=b,Ho+=Ma(Oo/2)}},$o={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Bo={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Bo.lineStart=ne},polygonEnd:function(){Bo.point=Gt,Bo.lineStart=Kt,Bo.lineEnd=Qt}};oa.geo.path=function(){function n(n){return n&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=u(i)),oa.geo.stream(n,a)),i.result()}function t(){return a=null,n}var e,r,u,i,a,o=4.5;return n.area=function(n){return Ho=0,oa.geo.stream(n,u(Xo)),Ho},n.centroid=function(n){return Ao=Co=zo=Lo=qo=To=Ro=Do=Po=0,oa.geo.stream(n,u(Bo)),Po?[Ro/Po,Do/Po]:To?[Lo/To,qo/To]:zo?[Ao/zo,Co/zo]:[NaN,NaN]},n.bounds=function(n){return Zo=Vo=-(Io=Yo=1/0),oa.geo.stream(n,u($o)),[[Io,Yo],[Zo,Vo]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||re(n):y,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Wt:new te(n),"function"!=typeof o&&i.pointRadius(o),t()):r},n.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),n):o},n.projection(oa.geo.albersUsa()).context(null)},oa.geo.transform=function(n){return{stream:function(t){var e=new ue(t);for(var r in n)e[r]=n[r];return e}}},ue.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},oa.geo.projection=ae,oa.geo.projectionMutator=oe,(oa.geo.equirectangular=function(){return ae(ce)}).raw=ce.invert=ce,oa.geo.rotation=function(n){function t(t){return t=n(t[0]*Oa,t[1]*Oa),t[0]*=Ia,t[1]*=Ia,t}return n=fe(n[0]%360*Oa,n[1]*Oa,n.length>2?n[2]*Oa:0),t.invert=function(t){return t=n.invert(t[0]*Oa,t[1]*Oa),t[0]*=Ia,t[1]*=Ia,t},t},se.invert=ce,oa.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=fe(-n[0]*Oa,-n[1]*Oa,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ia,n[1]*=Ia}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Oa,u*Oa),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Oa,(u=+r)*Oa),n):u},n.angle(90)},oa.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Oa,u=n[1]*Oa,i=t[1]*Oa,a=Math.sin(r),o=Math.cos(r),l=Math.sin(u),c=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*a)*e+(e=c*s-l*f*o)*e),l*s+c*f*o)},oa.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return oa.range(Math.ceil(i/d)*d,u,d).map(h).concat(oa.range(Math.ceil(c/m)*m,l,m).map(g)).concat(oa.range(Math.ceil(r/p)*p,e,p).filter(function(n){return Ma(n%d)>Da}).map(s)).concat(oa.range(Math.ceil(o/v)*v,a,v).filter(function(n){return Ma(n%m)>Da}).map(f))}var e,r,u,i,a,o,l,c,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(l).slice(1),h(u).reverse().slice(1),g(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],c=+t[0][1],l=+t[1][1],i>u&&(t=i,i=u,u=t),c>l&&(t=c,c=l,l=t),n.precision(y)):[[i,c],[u,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),n.precision(y)):[[r,o],[e,a]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=me(o,a,90),f=ye(r,e,y),h=me(c,l,90),g=ye(i,u,y),n):y},n.majorExtent([[-180,-90+Da],[180,90-Da]]).minorExtent([[-180,-80-Da],[180,80+Da]])},oa.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=Me,u=xe;return n.distance=function(){return oa.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},oa.geo.interpolate=function(n,t){return be(n[0]*Oa,n[1]*Oa,t[0]*Oa,t[1]*Oa)},oa.geo.length=function(n){return Wo=0,oa.geo.stream(n,Jo),Wo};var Wo,Jo={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Go=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(oa.geo.azimuthalEqualArea=function(){return ae(Go)}).raw=Go;var Ko=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},y);(oa.geo.azimuthalEquidistant=function(){return ae(Ko)}).raw=Ko,(oa.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(oa.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var Qo=we(function(n){return 1/n},Math.atan);(oa.geo.gnomonic=function(){return ae(Qo)}).raw=Qo,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Ha]},(oa.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var nl=we(function(){return 1},Math.asin);(oa.geo.orthographic=function(){return ae(nl)}).raw=nl;var tl=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(oa.geo.stereographic=function(){return ae(tl)}).raw=tl,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Ha]},(oa.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,oa.geom={},oa.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=En(e),i=En(r),a=n.length,o=[],l=[];for(t=0;a>t;t++)o.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(o.sort(qe),t=0;a>t;t++)l.push([o[t][0],-o[t][1]]);var c=Le(o),s=Le(l),f=s[0]===c[0],h=s[s.length-1]===c[c.length-1],g=[];for(t=c.length-1;t>=0;--t)g.push(n[o[c[t]][2]]);for(t=+f;t=r&&c.x<=i&&c.y>=u&&c.y<=a?[[r,a],[i,a],[i,u],[r,u]]:[];s.point=n[o]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Da)*Da,y:Math.round(a(n,t)/Da)*Da,i:t}})}var r=Ce,u=ze,i=r,a=u,o=sl;return n?t(n):(t.links=function(n){return or(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return or(e(n)).cells.forEach(function(e,r){for(var u,i,a=e.site,o=e.edges.sort(Ve),l=-1,c=o.length,s=o[c-1].edge,f=s.l===a?s.r:s.l;++l=c,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=hr()),f?u=c:o=c,h?a=s:l=s,i(n,t,e,r,u,a,o,l)}var s,f,h,g,p,v,d,m,y,M=En(o),x=En(l);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,a)for(g=0;p>g;++g)s=n[g],s.xm&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=hr();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){gr(n,k,v,d,m,y)},k.find=function(n){return pr(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=pl.get(e)||gl,r=vl.get(r)||y,br(r(e.apply(null,la.call(arguments,1))))},oa.interpolateHcl=Rr,oa.interpolateHsl=Dr,oa.interpolateLab=Pr,oa.interpolateRound=jr,oa.transform=function(n){var t=sa.createElementNS(oa.ns.prefix.svg,"g");return(oa.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Ur(e?e.matrix:dl)})(n)},Ur.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var dl={a:1,b:0,c:0,d:1,e:0,f:0};oa.interpolateTransform=$r,oa.layout={},oa.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++eo*o/m){if(v>l){var c=t.charge/l;n.px-=i*c,n.py-=a*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=i*c,n.py-=a*c}}return!t.charge}}function t(n){n.px=oa.event.x,n.py=oa.event.y,l.resume()}var e,r,u,i,a,o,l={},c=oa.dispatch("start","tick","end"),s=[1,1],f=.9,h=ml,g=yl,p=-30,v=Ml,d=.1,m=.64,M=[],x=[];return l.tick=function(){if((u*=.99)<.005)return e=null,c.end({type:"end",alpha:u=0}),!0;var t,r,l,h,g,v,m,y,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,g=l.target,y=g.x-h.x,b=g.y-h.y,(v=y*y+b*b)&&(v=u*a[r]*((v=Math.sqrt(v))-i[r])/v,y*=v,b*=v,g.x-=y*(m=h.weight+g.weight?h.weight/(h.weight+g.weight):.5),g.y-=b*m,h.x+=y*(m=1-m),h.y+=b*m);if((m=u*d)&&(y=s[0]/2,b=s[1]/2,r=-1,m))for(;++r<_;)l=M[r],l.x+=(y-l.x)*m,l.y+=(b-l.y)*m;if(p)for(ru(t=oa.geom.quadtree(M),u,o),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*f,l.y-=(l.py-(l.py=l.y))*f);c.tick({type:"tick",alpha:u})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(s=n,l):s},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.friction=function(n){return arguments.length?(f=+n,l):f},l.charge=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(m=n*n,l):Math.sqrt(m)},l.alpha=function(n){return arguments.length?(n=+n,u?n>0?u=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:u=0})):n>0&&(c.start({type:"start",alpha:u=n}),e=qn(l.tick)),l):u},l.start=function(){function n(n,r){if(!e){for(e=new Array(u),l=0;u>l;++l)e[l]=[];for(l=0;c>l;++l){var i=x[l];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var a,o=e[t],l=-1,s=o.length;++lt;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;u>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",f)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(t=0;c>t;++t)i[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)i[t]=h;if(a=[],"function"==typeof g)for(t=0;c>t;++t)a[t]=+g.call(this,x[t],t);else for(t=0;c>t;++t)a[t]=g;if(o=[],"function"==typeof p)for(t=0;u>t;++t)o[t]=+p.call(this,M[t],t);else for(t=0;u>t;++t)o[t]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=oa.behavior.drag().origin(y).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",nu)),arguments.length?void this.on("mouseover.force",tu).on("mouseout.force",eu).call(r):r},oa.rebind(l,c,"on")};var ml=20,yl=1,Ml=1/0;oa.layout.hierarchy=function(){function n(u){var i,a=[u],o=[];for(u.depth=0;null!=(i=a.pop());)if(o.push(i),(c=e.call(n,i,i.depth))&&(l=c.length)){for(var l,c,s;--l>=0;)a.push(s=c[l]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return au(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),o}var t=cu,e=ou,r=lu;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(iu(t,function(n){n.children&&(n.value=0)}),au(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},oa.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(a=i.length)){var a,o,l,c=-1;for(r=t.value?r/t.value:0;++cf?-1:1),p=oa.sum(c),v=p?(f-l*g)/p:0,d=oa.range(l),m=[];return null!=e&&d.sort(e===xl?function(n,t){return c[t]-c[n]}:function(n,t){return e(a[n],a[t])}),d.forEach(function(n){m[n]={data:a[n],value:o=c[n],startAngle:s,endAngle:s+=o*v+g,padAngle:h}}),m}var t=Number,e=xl,r=0,u=Ua,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var xl={};oa.layout.stack=function(){function n(o,l){if(!(h=o.length))return o;var c=o.map(function(e,r){return t.call(n,e,r)}),s=c.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),a.call(n,t,e)]})}),f=e.call(n,s,l);c=oa.permute(c,f),s=oa.permute(s,f);var h,g,p,v,d=r.call(n,s,l),m=c[0].length;for(p=0;m>p;++p)for(u.call(n,c[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,c[g][p],v+=s[g-1][p][1],s[g][p][1]);return o}var t=y,e=pu,r=vu,u=gu,i=fu,a=hu;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:bl.get(t)||pu,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:_l.get(t)||vu,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(a=t,n):a},n.out=function(t){return arguments.length?(u=t,n):u},n};var bl=oa.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(du),i=n.map(mu),a=oa.range(r).sort(function(n,t){return u[n]-u[t]}),o=0,l=0,c=[],s=[];for(t=0;r>t;++t)e=a[t],l>o?(o+=i[e],c.push(e)):(l+=i[e],s.push(e));return s.reverse().concat(c)},reverse:function(n){return oa.range(n.length).reverse()},"default":pu}),_l=oa.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,a=[],o=0,l=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>o&&(o=r),a.push(r)}for(e=0;i>e;++e)l[e]=(o-a[e])/2;return l},wiggle:function(n){var t,e,r,u,i,a,o,l,c,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=l=c=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,o=f[e][0]-f[e-1][0];s>t;++t){for(r=0,a=(n[t][e][1]-n[t][e-1][1])/(2*o);t>r;++r)a+=(n[r][e][1]-n[r][e-1][1])/o;i+=a*n[t][e][1]}g[e]=l-=u?i/u*o:0,c>l&&(c=l)}for(e=0;h>e;++e)g[e]-=c;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,a=1/u,o=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=a}for(e=0;i>e;++e)o[e]=0;return o},zero:vu});oa.layout.histogram=function(){function n(n,i){for(var a,o,l=[],c=n.map(e,this),s=r.call(this,c,i),f=u.call(this,s,c,i),i=-1,h=c.length,g=f.length-1,p=t?1:1/h;++i0)for(i=-1;++i=s[0]&&o<=s[1]&&(a=l[oa.bisect(f,o,1,g)-1],a.y+=p,a.push(n[i]));return l}var t=!0,e=Number,r=bu,u=Mu;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return xu(n,t)}:En(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},oa.layout.pack=function(){function n(n,i){var a=e.call(this,n,i),o=a[0],l=u[0],c=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(o.x=o.y=0,au(o,function(n){n.r=+s(n.value)}),au(o,Nu),r){var f=r*(t?1:Math.max(2*o.r/l,2*o.r/c))/2;au(o,function(n){n.r+=f}),au(o,Nu),au(o,function(n){n.r-=f})}return Cu(o,l/2,c/2,t?1:1/Math.max(2*o.r/l,2*o.r/c)),a}var t,e=oa.layout.hierarchy().sort(_u),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},uu(n,e)},oa.layout.tree=function(){function n(n,u){var s=a.call(this,n,u),f=s[0],h=t(f);if(au(h,e),h.parent.m=-h.z,iu(h,r),c)iu(f,i);else{var g=f,p=f,v=f;iu(f,function(n){n.xp.x&&(p=n),n.depth>v.depth&&(v=n)});var d=o(g,p)/2-g.x,m=l[0]/(p.x+o(p,g)/2+d),y=l[1]/(v.depth||1);iu(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,a=0,o=i.length;o>a;++a)r.push((i[a]=u={_:i[a],parent:t,children:(u=i[a].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Du(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+o(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+o(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,a=t,l=u.parent.children[0],c=u.m,s=i.m,f=a.m,h=l.m;a=Tu(a),u=qu(u),a&&u;)l=qu(l),i=Tu(i),i.a=n,r=a.z+f-u.z-c+o(a._,u._),r>0&&(Ru(Pu(a,n,e),n,r),c+=r,s+=r),f+=a.m,c+=u.m,h+=l.m,s+=i.m;a&&!Tu(i)&&(i.t=a,i.m+=f-s),u&&!qu(l)&&(l.t=u,l.m+=c-h,e=n)}return e}function i(n){n.x*=l[0],n.y=n.depth*l[1]}var a=oa.layout.hierarchy().sort(null).value(null),o=Lu,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(o=t,n):o},n.size=function(t){return arguments.length?(c=null==(l=t)?i:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:i,n):c?l:null},uu(n,a)},oa.layout.cluster=function(){function n(n,i){var a,o=t.call(this,n,i),l=o[0],c=0;au(l,function(n){var t=n.children;t&&t.length?(n.x=Uu(t),n.y=ju(t)):(n.x=a?c+=e(n,a):0,n.y=0,a=n)});var s=Fu(l),f=Hu(l),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return au(l,u?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),o}var t=oa.layout.hierarchy().sort(null).value(null),e=Lu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},uu(n,t)},oa.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++ut?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var a,o,l,c=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?c.dx:"dice"===g?c.dy:"slice-dice"===g?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),s.area=0;(l=h.length)>0;)s.push(a=h[l-1]),s.area+=a.area,"squarify"!==g||(o=r(s,v))<=p?(h.pop(),p=o):(s.area-=s.pop().area,u(s,v,c,!1),v=Math.min(c.dx,c.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,c,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,a=f(t),o=r.slice(),l=[];for(n(o,a.dx*a.dy/t.value),l.area=0;i=o.pop();)l.push(i),l.area+=i.area,null!=i.z&&(u(l,i.z?a.dx:a.dy,a,!o.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,a=-1,o=n.length;++ae&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,a=n.length,o=e.x,c=e.y,s=t?l(n.area/t):0; if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++ie.dx)&&(s=e.dx);++ie&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=oa.random.normal.apply(oa,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=oa.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},oa.scale={};var wl={floor:y,ceil:y};oa.scale.linear=function(){return Wu([0,1],[0,1],Mr,!1)};var Sl={s:1,g:1,p:1,r:1,e:1};oa.scale.log=function(){return ri(oa.scale.linear().domain([0,1]),10,!0,[1,10])};var kl=oa.format(".0e"),Nl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};oa.scale.pow=function(){return ui(oa.scale.linear(),1,[0,1])},oa.scale.sqrt=function(){return oa.scale.pow().exponent(.5)},oa.scale.ordinal=function(){return ai([],{t:"range",a:[[]]})},oa.scale.category10=function(){return oa.scale.ordinal().range(El)},oa.scale.category20=function(){return oa.scale.ordinal().range(Al)},oa.scale.category20b=function(){return oa.scale.ordinal().range(Cl)},oa.scale.category20c=function(){return oa.scale.ordinal().range(zl)};var El=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Al=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),Cl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),zl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);oa.scale.quantile=function(){return oi([],[])},oa.scale.quantize=function(){return li(0,1,[0,1])},oa.scale.threshold=function(){return ci([.5],[0,1])},oa.scale.identity=function(){return si([0,1])},oa.svg={},oa.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),s=a.apply(this,arguments)-Ha,f=o.apply(this,arguments)-Ha,h=Math.abs(f-s),g=s>f?0:1;if(n>c&&(p=c,c=n,n=p),h>=Fa)return t(c,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,N=0,E=0,A=[];if((m=(+l.apply(this,arguments)||0)/2)&&(d=i===Ll?Math.sqrt(n*n+c*c):+i.apply(this,arguments),g||(E*=-1),c&&(E=tn(d/c*Math.sin(m))),n&&(N=tn(d/n*Math.sin(m)))),c){y=c*Math.cos(s+E),M=c*Math.sin(s+E),x=c*Math.cos(f-E),b=c*Math.sin(f-E);var C=Math.abs(f-s-2*E)<=ja?0:1;if(E&&mi(y,M,x,b)===g^C){var z=(s+f)/2;y=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-N),w=n*Math.sin(f-N),S=n*Math.cos(s+N),k=n*Math.sin(s+N);var L=Math.abs(s-f+2*N)<=ja?0:1;if(N&&mi(_,w,S,k)===1-g^L){var q=(s+f)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Da&&(p=Math.min(Math.abs(c-n)/2,+u.apply(this,arguments)))>.001){v=c>n^g?0:1;var T=p,R=p;if(ja>h){var D=null==S?[_,w]:null==x?[y,M]:Re([y,M],[S,k],[x,b],[_,w]),P=y-D[0],j=M-D[1],U=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*U+j*F)/(Math.sqrt(P*P+j*j)*Math.sqrt(U*U+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(p,(n-O)/(H-1)),T=Math.min(p,(c-O)/(H+1))}if(null!=x){var I=yi(null==S?[_,w]:[S,k],[y,M],c,T,g),Y=yi([x,b],[_,w],c,T,g);p===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-g^mi(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",g," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",y,",",M);if(null!=S){var Z=yi([y,M],[S,k],n,-R,g),V=yi([_,w],null==x?[y,M]:[x,b],n,-R,g);p===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^mi(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",y,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",g," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-g," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hi,r=gi,u=fi,i=Ll,a=pi,o=vi,l=di;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=En(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==Ll?Ll:En(t),n):i},n.startAngle=function(t){return arguments.length?(a=En(t),n):a},n.endAngle=function(t){return arguments.length?(o=En(t),n):o},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+a.apply(this,arguments)+ +o.apply(this,arguments))/2-Ha;return[Math.cos(t)*n,Math.sin(t)*n]},n};var Ll="auto";oa.svg.line=function(){return Mi(y)};var ql=oa.map({linear:xi,"linear-closed":bi,step:_i,"step-before":wi,"step-after":Si,basis:zi,"basis-open":Li,"basis-closed":qi,bundle:Ti,cardinal:Ei,"cardinal-open":ki,"cardinal-closed":Ni,monotone:Fi});ql.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Tl=[0,2/3,1/3,0],Rl=[0,1/3,2/3,0],Dl=[0,1/6,2/3,1/6];oa.svg.line.radial=function(){var n=Mi(Hi);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wi.reverse=Si,Si.reverse=wi,oa.svg.area=function(){return Oi(y)},oa.svg.area.radial=function(){var n=Oi(Hi);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},oa.svg.chord=function(){function n(n,o){var l=t(this,i,n,o),c=t(this,a,n,o);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?u(l.r,l.p1,l.r,l.p0):u(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+u(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=o.call(n,u,r),a=l.call(n,u,r)-Ha,s=c.call(n,u,r)-Ha;return{r:i,a0:a,a1:s,p0:[i*Math.cos(a),i*Math.sin(a)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>ja)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=Me,a=xe,o=Ii,l=pi,c=vi;return n.radius=function(t){return arguments.length?(o=En(t),n):o},n.source=function(t){return arguments.length?(i=En(t),n):i},n.target=function(t){return arguments.length?(a=En(t),n):a},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},oa.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),a=e.call(this,n,u),o=(i.y+a.y)/2,l=[i,{x:i.x,y:o},{x:a.x,y:o},a];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yi;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},oa.svg.diagonal.radial=function(){var n=oa.svg.diagonal(),t=Yi,e=n.projection;return n.projection=function(n){return arguments.length?e(Zi(t=n)):t},n},oa.svg.symbol=function(){function n(n,r){return(Pl.get(t.call(this,n,r))||$i)(e.call(this,n,r))}var t=Xi,e=Vi;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Pl=oa.map({circle:$i,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Ul)),e=t*Ul;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});oa.svg.symbolTypes=Pl.keys();var jl=Math.sqrt(3),Ul=Math.tan(30*Oa);Aa.transition=function(n){for(var t,e,r=Fl||++Yl,u=Ki(n),i=[],a=Hl||{time:Date.now(),ease:Nr,delay:0,duration:250},o=-1,l=this.length;++oi;i++){u.push(t=[]);for(var e=this[i],o=0,l=e.length;l>o;o++)(r=e[o])&&n.call(r,r.__data__,o,i)&&t.push(r)}return Wi(u,this.namespace,this.id)},Il.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Il.attr=function(n,t){function e(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(o);return e!==n&&(t=a(e,n),function(n){this.setAttribute(o,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(o.space,o.local);return e!==n&&(t=a(e,n),function(n){this.setAttributeNS(o.space,o.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var a="transform"==n?$r:Mr,o=oa.ns.qualify(n);return Ji(this,"attr."+n,t,o.local?i:u)},Il.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=oa.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Il.style=function(n,e,r){function u(){this.style.removeProperty(n)}function i(e){return null==e?u:(e+="",function(){var u,i=t(this).getComputedStyle(this,null).getPropertyValue(n);return i!==e&&(u=Mr(i,e),function(t){this.style.setProperty(n,u(t),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof n){2>a&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ji(this,"style."+n,e,i)},Il.styleTween=function(n,e,r){function u(u,i){var a=e.call(this,u,i,t(this).getComputedStyle(this,null).getPropertyValue(n));return a&&function(t){this.style.setProperty(n,a(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,u)},Il.text=function(n){return Ji(this,"text",n,Gi)},Il.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Il.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=oa.ease.apply(oa,arguments)),Y(this,function(r){r[e][t].ease=n}))},Il.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Il.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Il.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Hl,i=Fl;try{Fl=e,Y(this,function(t,u,i){Hl=t[r][e],n.call(t,t.__data__,u,i)})}finally{Hl=u,Fl=i}}else Y(this,function(u){var i=u[r][e];(i.event||(i.event=oa.dispatch("start","end","interrupt"))).on(n,t)});return this},Il.transition=function(){for(var n,t,e,r,u=this.id,i=++Yl,a=this.namespace,o=[],l=0,c=this.length;c>l;l++){o.push(n=[]);for(var t=this[l],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[a][u],Qi(e,s,a,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wi(o,a,i)},oa.svg.axis=function(){function n(n){n.each(function(){var n,c=oa.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==l?f.ticks?f.ticks.apply(f,o):f.domain():l,g=null==t?f.tickFormat?f.tickFormat.apply(f,o):y:t,p=c.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Da),d=oa.transition(p.exit()).style("opacity",Da).remove(),m=oa.transition(p.order()).style("opacity",1),M=Math.max(u,0)+a,x=Zu(f),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),oa.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=m.select("line"),C=p.select("text").text(g),z=v.select("text"),L=m.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=na,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*i+"V0H"+x[1]+"V"+q*i)):(n=ta,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*i+","+x[0]+"H0V"+x[1]+"H"+q*i)),E.attr(N,q*u),z.attr(k,q*M),A.attr(S,0).attr(N,q*u),L.attr(w,0).attr(k,q*M),f.rangeBand){var T=f,R=T.rangeBand()/2;s=f=function(n){return T(n)+R}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=oa.scale.linear(),r=Zl,u=6,i=6,a=3,o=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Vl?t+"":Zl,n):r},n.ticks=function(){return arguments.length?(o=ca(arguments),n):o},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(a=+t,n):a},n.tickSubdivide=function(){return arguments.length&&n},n};var Zl="bottom",Vl={top:1,right:1,bottom:1,left:1};oa.svg.brush=function(){function n(t){t.each(function(){var t=oa.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),a=t.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=t.selectAll(".resize").data(v,y);o.exit().remove(),o.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Xl[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",n.empty()?"none":null);var l,f=oa.transition(t),h=oa.transition(a);c&&(l=Zu(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(f)),s&&(l=Zu(s),h.attr("y",l[0]).attr("height",l[1]-l[0]),u(f)),e(f)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+f[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",f[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function u(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==oa.event.keyCode&&(C||(M=null,L[0]-=f[1],L[1]-=h[1],C=2),S())}function v(){32==oa.event.keyCode&&2==C&&(L[0]+=f[1],L[1]+=h[1],C=0,S())}function d(){var n=oa.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(oa.event.altKey?(M||(M=[(f[0]+f[1])/2,(h[0]+h[1])/2]),L[0]=f[+(n[0]s?(u=r,r=s):u=s),v[0]!=r||v[1]!=u?(e?o=null:a=null,v[0]=r,v[1]=u,!0):void 0}function y(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),oa.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=oa.select(oa.event.target),w=l.of(b,arguments),k=oa.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&s,C=_.classed("extent"),z=W(b),L=oa.mouse(b),q=oa.select(t(b)).on("keydown.brush",i).on("keyup.brush",v);if(oa.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",y):q.on("mousemove.brush",d).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),C)L[0]=f[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[f[1-T]-L[0],h[1-R]-L[1]],L[0]=f[T],L[1]=h[R]}else oa.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),oa.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var a,o,l=N(n,"brushstart","brush","brushend"),c=null,s=null,f=[0,0],h=[0,0],g=!0,p=!0,v=$l[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:f,y:h,i:a,j:o},e=this.__chart__||t;this.__chart__=t,Fl?oa.select(this).transition().each("start.brush",function(){a=e.i,o=e.j,f=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(f,t.x),r=xr(h,t.y);return a=o=null,function(u){f=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=$l[!c<<1|!s],n):c},n.y=function(t){return arguments.length?(s=t,v=$l[!c<<1|!s],n):s},n.clamp=function(t){return arguments.length?(c&&s?(g=!!t[0],p=!!t[1]):c?g=!!t:s&&(p=!!t),n):c&&s?[g,p]:c?g:s?p:null},n.extent=function(t){var e,r,u,i,l;return arguments.length?(c&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),a=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),(e!=f[0]||r!=f[1])&&(f=[e,r])),s&&(u=t[0],i=t[1],c&&(u=u[1],i=i[1]),o=[u,i],s.invert&&(u=s(u),i=s(i)),u>i&&(l=u,u=i,i=l),(u!=h[0]||i!=h[1])&&(h=[u,i])),n):(c&&(a?(e=a[0],r=a[1]):(e=f[0],r=f[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),s&&(o?(u=o[0],i=o[1]):(u=h[0],i=h[1],s.invert&&(u=s.invert(u),i=s.invert(i)),u>i&&(l=u,u=i,i=l))),c&&s?[[e,u],[r,i]]:c?[e,r]:s&&[u,i])},n.clear=function(){return n.empty()||(f=[0,0],h=[0,0],a=o=null),n},n.empty=function(){return!!c&&f[0]==f[1]||!!s&&h[0]==h[1]},oa.rebind(n,l,"on")};var Xl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},$l=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Bl=ho.format=Mo.timeFormat,Wl=Bl.utc,Jl=Wl("%Y-%m-%dT%H:%M:%S.%LZ");Bl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?ea:Jl,ea.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},ea.toString=Jl.toString,ho.second=On(function(n){return new go(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ho.seconds=ho.second.range,ho.seconds.utc=ho.second.utc.range,ho.minute=On(function(n){return new go(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ho.minutes=ho.minute.range,ho.minutes.utc=ho.minute.utc.range,ho.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new go(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ho.hours=ho.hour.range,ho.hours.utc=ho.hour.utc.range,ho.month=On(function(n){return n=ho.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ho.months=ho.month.range,ho.months.utc=ho.month.utc.range;var Gl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Kl=[[ho.second,1],[ho.second,5],[ho.second,15],[ho.second,30],[ho.minute,1],[ho.minute,5],[ho.minute,15],[ho.minute,30],[ho.hour,1],[ho.hour,3],[ho.hour,6],[ho.hour,12],[ho.day,1],[ho.day,2],[ho.week,1],[ho.month,1],[ho.month,3],[ho.year,1]],Ql=Bl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),nc={range:function(n,t,e){return oa.range(Math.ceil(n/e)*e,+t,e).map(ua)},floor:y,ceil:y};Kl.year=ho.year,ho.scale=function(){return ra(oa.scale.linear(),Kl,Ql)};var tc=Kl.map(function(n){return[n[0].utc,n[1]]}),ec=Wl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);tc.year=ho.year.utc,ho.scale.utc=function(){return ra(oa.scale.linear(),tc,ec)},oa.text=An(function(n){return n.responseText}),oa.json=function(n,t){return Cn(n,"application/json",ia,t)},oa.html=function(n,t){return Cn(n,"text/html",aa,t)},oa.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=oa,define(oa)):"object"==typeof module&&module.exports?module.exports=oa:this.d3=oa}(); -},{}],11:[function(require,module,exports){ -var now=require("date-now");module.exports=function(n,u,t){function e(){var p=now()-a;u>p&&p>0?r=setTimeout(e,u-p):(r=null,t||(i=n.apply(o,l),r||(o=l=null)))}var r,l,o,a,i;return null==u&&(u=100),function(){o=this,l=arguments,a=now();var p=t&&!r;return r||(r=setTimeout(e,u)),p&&(i=n.apply(o,l),o=l=null),i}}; +},{}],14:[function(require,module,exports){ +(function (process){ +"use strict";var emptyFunction=require("./emptyFunction"),EventListener={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):("production"!==process.env.NODE_ENV&&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."),{remove:emptyFunction})},registerDefault:function(){}};module.exports=EventListener; -},{"date-now":12}],12:[function(require,module,exports){ -function now(){return(new Date).getTime()}module.exports=Date.now||now; +}).call(this,require('_process')) +},{"./emptyFunction":21,"_process":311}],15:[function(require,module,exports){ +"use strict";var canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),ExecutionEnvironment={canUseDOM:canUseDOM,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:canUseDOM&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:canUseDOM&&!!window.screen,isInWorker:!canUseDOM};module.exports=ExecutionEnvironment; -},{}],13:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ +"use strict";function camelize(e){return e.replace(_hyphenPattern,function(e,t){return t.toUpperCase()})}var _hyphenPattern=/-(.)/g;module.exports=camelize; + +},{}],17:[function(require,module,exports){ +"use strict";function camelizeStyleName(e){return camelize(e.replace(msPattern,"ms-"))}var camelize=require("./camelize"),msPattern=/^-ms-/;module.exports=camelizeStyleName; + +},{"./camelize":16}],18:[function(require,module,exports){ +"use strict";function containsNode(e,o){var t=!0;e:for(;t;){var n=e,i=o;if(t=!1,n&&i){if(n===i)return!0;if(isTextNode(n))return!1;if(isTextNode(i)){e=n,o=i.parentNode,t=!0;continue e}return n.contains?n.contains(i):n.compareDocumentPosition?!!(16&n.compareDocumentPosition(i)):!1}return!1}}var isTextNode=require("./isTextNode");module.exports=containsNode; + +},{"./isTextNode":31}],19:[function(require,module,exports){ +"use strict";function hasArrayNature(r){return!!r&&("object"==typeof r||"function"==typeof r)&&"length"in r&&!("setInterval"in r)&&"number"!=typeof r.nodeType&&(Array.isArray(r)||"callee"in r||"item"in r)}function createArrayFromMixed(r){return hasArrayNature(r)?Array.isArray(r)?r.slice():toArray(r):[r]}var toArray=require("./toArray");module.exports=createArrayFromMixed; + +},{"./toArray":39}],20:[function(require,module,exports){ +(function (process){ +"use strict";function getNodeName(e){var r=e.match(nodeNamePattern);return r&&r[1].toLowerCase()}function createNodesFromMarkup(e,r){var a=dummyNode;dummyNode?void 0:"production"!==process.env.NODE_ENV?invariant(!1,"createNodesFromMarkup dummy not initialized"):invariant(!1);var t=getNodeName(e),n=t&&getMarkupWrap(t);if(n){a.innerHTML=n[1]+e+n[2];for(var i=n[0];i--;)a=a.lastChild}else a.innerHTML=e;var o=a.getElementsByTagName("script");o.length&&(r?void 0:"production"!==process.env.NODE_ENV?invariant(!1,"createNodesFromMarkup(...): Unexpected ",returnEnd:!0,subLanguage:["actionscript","javascript","handlebars"]}},a,{className:"pi",begin:/<\?\w+/,end:/\?>/,relevance:10},{className:"tag",begin:"",contains:[{className:"title",begin:/[^ \/><\n\t]+/,relevance:0},s]}]}}; -},{}],170:[function(require,module,exports){ +},{}],198:[function(require,module,exports){ module.exports=function(e){var a="for let if while then else return where group by xquery encoding versionmodule namespace boundary-space preserve strip default collation base-uri orderingcopy-namespaces order declare import schema namespace function option in allowing emptyat tumbling window sliding window start when only end when previous next stable ascendingdescending empty greatest least some every satisfies switch case typeswitch try catch andor to union intersect instance of treat as castable cast map array delete insert intoreplace value rename copy modify update",n="false true xs:string xs:integer element item xs:date xs:datetime xs:float xs:double xs:decimal QName xs:anyURI xs:long xs:int xs:short xs:byte attribute",s={className:"variable",begin:/\$[a-zA-Z0-9\-]+/,relevance:5},t={className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},i={className:"string",variants:[{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]},r={className:"decorator",begin:"%\\w+"},c={className:"comment",begin:"\\(:",end:":\\)",relevance:10,contains:[{className:"doc",begin:"@\\w+"}]},o={begin:"{",end:"}"},l=[s,i,t,c,r,o];return o.contains=l,{aliases:["xpath","xq"],case_insensitive:!1,lexemes:/[a-zA-Z\$][a-zA-Z0-9_:\-]*/,illegal:/(proc)|(abstract)|(extends)|(until)|(#)/,keywords:{keyword:a,literal:n},contains:l}}; -},{}],171:[function(require,module,exports){ +},{}],199:[function(require,module,exports){ module.exports=function(e){var n={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:'b"',end:'"'},{begin:"b'",end:"'"},e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null})]},a={variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]};return{aliases:["zep"],case_insensitive:!0,keywords:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var let while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally int uint long ulong char uchar double float bool boolean stringlikely unlikely",contains:[e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0,keywords:"__halt_compiler",lexemes:e.UNDERSCORE_IDENT_RE}),{className:"string",begin:"<<<['\"]?\\w+['\"]?$",end:"^\\w+;",contains:[e.BACKSLASH_ESCAPE]},{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",beginKeywords:"function",end:/[;{]/,excludeEnd:!0,illegal:"\\$|\\[|%",contains:[e.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)",contains:["self",e.C_BLOCK_COMMENT_MODE,n,a]}]},{className:"class",beginKeywords:"class interface",end:"{",excludeEnd:!0,illegal:/[:\(\$"]/,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",end:";",illegal:/[\.']/,contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",end:";",contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"=>"},n,a]}}; -},{}],172:[function(require,module,exports){ +},{}],200:[function(require,module,exports){ exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<>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<>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<0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l}; -},{}],173:[function(require,module,exports){ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Immutable=e()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return t.value=!1,t}function r(t){t&&(t.value=!0)}function n(){}function i(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=new Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function o(t){return void 0===t.size&&(t.size=t.__iterate(s)),t.size}function u(t,e){if("number"!=typeof e){var r=+e;if(""+r!==e)return NaN;e=r}return 0>e?o(t)+e:e}function s(){return!0}function a(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function h(t,e){return c(t,e,0)}function f(t,e){return c(t,e,e)}function c(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function _(t){return y(t)?t:O(t)}function p(t){return d(t)?t:x(t)}function v(t){return m(t)?t:k(t)}function l(t){return y(t)&&!g(t)?t:A(t)}function y(t){return!(!t||!t[vr])}function d(t){return!(!t||!t[lr])}function m(t){return!(!t||!t[yr])}function g(t){return d(t)||m(t)}function w(t){return!(!t||!t[dr])}function S(t){this.next=t}function z(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function I(){return{value:void 0,done:!0}}function b(t){return!!M(t)}function q(t){return t&&"function"==typeof t.next}function D(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(Sr&&t[Sr]||t[zr]);return"function"==typeof e?e:void 0}function E(t){return t&&"number"==typeof t.length}function O(t){return null===t||void 0===t?T():y(t)?t.toSeq():C(t)}function x(t){return null===t||void 0===t?T().toKeyedSeq():y(t)?d(t)?t.toSeq():t.fromEntrySeq():W(t)}function k(t){return null===t||void 0===t?T():y(t)?d(t)?t.entrySeq():t.toIndexedSeq():B(t)}function A(t){return(null===t||void 0===t?T():y(t)?d(t)?t.entrySeq():t:B(t)).toSetSeq()}function j(t){this._array=t,this.size=t.length}function R(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function U(t){this._iterable=t,this.size=t.length||t.size}function K(t){this._iterator=t,this._iteratorCache=[]}function L(t){return!(!t||!t[br])}function T(){return qr||(qr=new j([]))}function W(t){var e=Array.isArray(t)?new j(t).fromEntrySeq():q(t)?new K(t).fromEntrySeq():b(t)?new U(t).fromEntrySeq():"object"==typeof t?new R(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function B(t){var e=J(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function C(t){var e=J(t)||"object"==typeof t&&new R(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function J(t){return E(t)?new j(t):q(t)?new K(t):b(t)?new U(t):void 0}function N(t,e,r,n){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var s=i[r?o-u:u];if(e(s[1],n?s[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,r)}function P(t,e,r,n){var i=t._cache;if(i){var o=i.length-1,u=0;return new S(function(){var t=i[r?o-u:u];return u++>o?I():z(e,n?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,r)}function H(){throw TypeError("Abstract")}function V(){}function Y(){}function Q(){}function X(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return"function"==typeof t.equals&&"function"==typeof e.equals&&t.equals(e)?!0:!1}function F(t,e){return e?G(e,t,"",{"":t}):Z(t)}function G(t,e,r,n){return Array.isArray(e)?t.call(n,r,k(e).map(function(r,n){return G(t,r,n,e)})):$(e)?t.call(n,r,x(e).map(function(r,n){return G(t,r,n,e)})):e}function Z(t){return Array.isArray(t)?k(t).map(Z).toList():$(t)?x(t).map(Z).toMap():t}function $(t){return t&&(t.constructor===Object||void 0===t.constructor)}function tt(t){return t>>>1&1073741824|3221225471&t}function et(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)t/=4294967295,r^=t;return tt(r)}return"string"===e?t.length>jr?rt(t):nt(t):"function"==typeof t.hashCode?t.hashCode():it(t)}function rt(t){var e=Kr[t];return void 0===e&&(e=nt(t),Ur===Rr&&(Ur=0,Kr={}),Ur++,Kr[t]=e),e}function nt(t){for(var e=0,r=0;r0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ut(t,e){if(!t)throw new Error(e)}function st(t){ut(t!==1/0,"Cannot perform this action with an infinite size.")}function at(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ht(t){this._iter=t,this.size=t.size}function ft(t){this._iter=t,this.size=t.size}function ct(t){this._iter=t,this.size=t.size}function _t(t){var e=jt(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Rt,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===wr){var n=t.__iterator(e,r);return new S(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===gr?mr:gr,r)},e}function pt(t,e,r){var n=jt(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,cr);return o===cr?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return n(e.call(r,t,i,u),i,o)!==!1},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(wr,i);return new S(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return z(n,s,e.call(r,u[1],s,t),i)})},n}function vt(t,e){var r=jt(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=_t(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.includes=function(e){return t.includes(e)},r.cacheResult=Rt,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function lt(t,e,r,n){var i=jt(t);return n&&(i.has=function(n){var i=t.get(n,cr);return i!==cr&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,cr);return o!==cr&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){return e.call(r,t,o,a)?(s++,i(t,n?o:s-1,u)):void 0},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(wr,o),s=0;return new S(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,h=a[0],f=a[1];if(e.call(r,f,h,t))return z(i,n?h:s++,f,o)}})},i}function yt(t,e,r){var n=Lt().asMutable();return t.__iterate(function(i,o){n.update(e.call(r,i,o,t),0,function(t){return t+1})}),n.asImmutable()}function dt(t,e,r){var n=d(t),i=(w(t)?Ie():Lt()).asMutable();t.__iterate(function(o,u){i.update(e.call(r,o,u,t),function(t){return t=t||[],t.push(n?[u,o]:o),t})});var o=At(t);return i.map(function(e){return Ot(t,o(e))})}function mt(t,e,r,n){var i=t.size;if(void 0!==e&&(e=0|e),void 0!==r&&(r=0|r),a(e,r,i))return t;var o=h(e,i),s=f(r,i);if(o!==o||s!==s)return mt(t.toSeq().cacheResult(),e,r,n);var c,_=s-o;_===_&&(c=0>_?0:_);var p=jt(t);return p.size=0===c?c:t.size&&c||void 0,!n&&L(t)&&c>=0&&(p.get=function(e,r){return e=u(this,e),e>=0&&c>e?t.get(e+o,r):r}),p.__iterateUncached=function(e,r){var i=this;if(0===c)return 0;if(r)return this.cacheResult().__iterate(e,r);var u=0,s=!0,a=0;return t.__iterate(function(t,r){return s&&(s=u++c)return I();var t=i.next();return n||e===gr?t:e===mr?z(e,s-1,void 0,t):z(e,s-1,t.value[1],t)})},p}function gt(t,e,r){var n=jt(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)}),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(wr,i),s=!0;return new S(function(){if(!s)return I();var t=u.next();if(t.done)return t;var i=t.value,a=i[0],h=i[1];return e.call(r,h,a,o)?n===wr?t:z(n,a,h,t):(s=!1,I())})},n}function wt(t,e,r,n){var i=jt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,h){return s&&(s=e.call(r,t,o,h))?void 0:(a++,i(t,n?o:a-1,u))}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(wr,o),a=!0,h=0;return new S(function(){var t,o,f;do{if(t=s.next(),t.done)return n||i===gr?t:i===mr?z(i,h++,void 0,t):z(i,h++,t.value[1],t);var c=t.value;o=c[0],f=c[1],a&&(a=e.call(r,f,o,u))}while(a);return i===wr?t:z(i,o,f,t)})},i}function St(t,e){var r=d(t),n=[t].concat(e).map(function(t){return y(t)?r&&(t=p(t)):t=r?W(t):B(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&d(i)||m(t)&&m(i))return i}var o=new j(n);return r?o=o.toKeyedSeq():m(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),o}function zt(t,e,r){var n=jt(t);return n.__iterateUncached=function(n,i){function o(t,a){var h=this;t.__iterate(function(t,i){return(!e||e>a)&&y(t)?o(t,a+1):n(t,r?i:u++,h)===!1&&(s=!0),!s},i)}var u=0,s=!1;return o(t,0),u},n.__iteratorUncached=function(n,i){var o=t.__iterator(n,i),u=[],s=0;return new S(function(){for(;o;){var t=o.next();if(t.done===!1){var a=t.value;if(n===wr&&(a=a[1]),e&&!(u.length0}function Et(t,e,r){var n=jt(t);return n.size=new j(r).map(function(t){return t.size}).min(),n.__iterate=function(t,e){for(var r,n=this.__iterator(gr,e),i=0;!(r=n.next()).done&&t(r.value,i++,this)!==!1;);return i},n.__iteratorUncached=function(t,n){var i=r.map(function(t){return t=_(t),D(n?t.reverse():t)}),o=0,u=!1;return new S(function(){var r;return u||(r=i.map(function(t){return t.next()}),u=r.some(function(t){return t.done})),u?I():z(t,o++,e.apply(null,r.map(function(t){return t.value})))})},n}function Ot(t,e){return L(t)?e:t.constructor(e)}function xt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function kt(t){return st(t.size),o(t)}function At(t){return d(t)?p:m(t)?v:l}function jt(t){return Object.create((d(t)?x:m(t)?k:A).prototype)}function Rt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Ut(t,e){return t>e?1:e>t?-1:0}function Kt(t){var e=D(t);if(!e){if(!E(t))throw new TypeError("Expected iterable or array-like: "+t);e=D(_(t))}return e}function Lt(t){return null===t||void 0===t?Qt():Tt(t)&&!w(t)?t:Qt().withMutations(function(e){var r=p(t);st(r.size),r.forEach(function(t,r){return e.set(r,t)})})}function Tt(t){return!(!t||!t[Lr])}function Wt(t,e){this.ownerID=t,this.entries=e}function Bt(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r}function Ct(t,e,r){this.ownerID=t,this.count=e,this.nodes=r}function Jt(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r}function Nt(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r}function Pt(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Vt(t._root)}function Ht(t,e){return z(t,e[0],e[1])}function Vt(t,e){return{node:t,index:0,__prev:e}}function Yt(t,e,r,n){var i=Object.create(Tr);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Qt(){return Wr||(Wr=Yt(0))}function Xt(t,r,n){var i,o;if(t._root){var u=e(_r),s=e(pr);if(i=Ft(t._root,t.__ownerID,0,void 0,r,n,u,s),!s.value)return t;o=t.size+(u.value?n===cr?-1:1:0)}else{if(n===cr)return t;o=1,i=new Wt(t.__ownerID,[[r,n]])}return t.__ownerID?(t.size=o,t._root=i,t.__hash=void 0,t.__altered=!0,t):i?Yt(o,i):Qt()}function Ft(t,e,n,i,o,u,s,a){return t?t.update(e,n,i,o,u,s,a):u===cr?t:(r(a),r(s),new Nt(e,i,[o,u]))}function Gt(t){return t.constructor===Nt||t.constructor===Jt}function Zt(t,e,r,n,i){if(t.keyHash===n)return new Jt(e,n,[t.entry,i]);var o,u=(0===r?t.keyHash:t.keyHash>>>r)&fr,s=(0===r?n:n>>>r)&fr,a=u===s?[Zt(t,e,r+ar,n,i)]:(o=new Nt(e,n,i),s>u?[t,o]:[o,t]);return new Bt(e,1<s;s++,a<<=1){var f=e[s];void 0!==f&&s!==n&&(i|=a,u[o++]=f)}return new Bt(t,i,u)}function ee(t,e,r,n,i){for(var o=0,u=new Array(hr),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Ct(t,o+1,u)}function re(t,e,r){for(var n=[],i=0;i>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function se(t,e,r,n){var o=n?t:i(t);return o[e]=r,o}function ae(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=new Array(i),u=0,s=0;i>s;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}function he(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,u=0;n>u;u++)u===e&&(o=1),i[u]=t[u+o];return i}function fe(t){var e=le();if(null===t||void 0===t)return e;if(ce(t))return t;var r=v(t),n=r.size;return 0===n?e:(st(n),n>0&&hr>n?ve(0,n,ar,null,new _e(r.toArray())):e.withMutations(function(t){t.setSize(n),r.forEach(function(e,r){return t.set(r,e)})}))}function ce(t){return!(!t||!t[Nr])}function _e(t,e){this.array=t,this.ownerID=e}function pe(t,e){function r(t,e,r){return 0===e?n(t,r):i(t,e,r)}function n(t,r){var n=r===s?a&&a.array:t&&t.array,i=r>o?0:o-r,h=u-r;return h>hr&&(h=hr),function(){if(i===h)return Vr;var t=e?--h:i++;return n&&n[t]}}function i(t,n,i){var s,a=t&&t.array,h=i>o?0:o-i>>n,f=(u-i>>n)+1;return f>hr&&(f=hr),function(){for(;;){if(s){var t=s();if(t!==Vr)return t;s=null}if(h===f)return Vr;var o=e?--f:h++;s=r(a&&a[o],n-ar,i+(o<=t.size||0>r)return t.withMutations(function(t){0>r?we(t,r).set(0,n):we(t,0,r+1).set(r,n)});r+=t._origin;var i=t._tail,o=t._root,s=e(pr);return r>=ze(t._capacity)?i=de(i,t.__ownerID,0,r,n,s):o=de(o,t.__ownerID,t._level,r,n,s),s.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):ve(t._origin,t._capacity,t._level,o,i):t}function de(t,e,n,i,o,u){var s=i>>>n&fr,a=t&&s0){var f=t&&t.array[s],c=de(f,e,n-ar,i,o,u);return c===f?t:(h=me(t,e),h.array[s]=c,h)}return a&&t.array[s]===o?t:(r(u),h=me(t,e),void 0===o&&s===h.array.length-1?h.array.pop():h.array[s]=o,h)}function me(t,e){return e&&t&&e===t.ownerID?t:new _e(t?t.array.slice():[],e)}function ge(t,e){if(e>=ze(t._capacity))return t._tail;if(e<1<0;)r=r.array[e>>>n&fr],n-=ar;return r}}function we(t,e,r){void 0!==e&&(e=0|e),void 0!==r&&(r=0|r);var i=t.__ownerID||new n,o=t._origin,u=t._capacity,s=o+e,a=void 0===r?u:0>r?u+r:o+r;if(s===o&&a===u)return t;if(s>=a)return t.clear();for(var h=t._level,f=t._root,c=0;0>s+c;)f=new _e(f&&f.array.length?[void 0,f]:[],i),h+=ar,c+=1<=1<p?ge(t,a-1):p>_?new _e([],i):v;if(v&&p>_&&u>s&&v.array.length){f=me(f,i);for(var y=f,d=h;d>ar;d-=ar){var m=_>>>d&fr;y=y.array[m]=me(y.array[m],i)}y.array[_>>>ar&fr]=v}if(u>a&&(l=l&&l.removeAfter(i,0,a)),s>=p)s-=p,a-=p,h=ar,f=null,l=l&&l.removeBefore(i,0,s);else if(s>o||_>p){for(c=0;f;){var g=s>>>h&fr;if(g!==p>>>h&fr)break;g&&(c+=(1<o&&(f=f.removeBefore(i,h,s-c)),f&&_>p&&(f=f.removeAfter(i,h,p-c)),c&&(s-=c,a-=c)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=h,t._root=f,t._tail=l,t.__hash=void 0,t.__altered=!0,t):ve(s,a,h,f,l)}function Se(t,e,r){for(var n=[],i=0,o=0;oi&&(i=s.size),y(u)||(s=s.map(function(t){return F(t)})),n.push(s)}return i>t.size&&(t=t.setSize(i)),ie(t,e,n)}function ze(t){return hr>t?0:t-1>>>ar<=hr&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&s!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):qe(n,i)}function Ee(t){return null===t||void 0===t?ke():Oe(t)?t:ke().unshiftAll(t)}function Oe(t){return!(!t||!t[Qr])}function xe(t,e,r,n){var i=Object.create(Xr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function ke(){return Fr||(Fr=xe(0))}function Ae(t){return null===t||void 0===t?Ke():je(t)&&!w(t)?t:Ke().withMutations(function(e){var r=l(t);st(r.size),r.forEach(function(t){return e.add(t)})})}function je(t){return!(!t||!t[Gr])}function Re(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Ue(t,e){var r=Object.create(Zr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Ke(){return $r||($r=Ue(Qt()))}function Le(t){return null===t||void 0===t?Be():Te(t)?t:Be().withMutations(function(e){var r=l(t);st(r.size),r.forEach(function(t){return e.add(t)})})}function Te(t){return je(t)&&w(t)}function We(t,e){var r=Object.create(tn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Be(){return en||(en=We(De()))}function Ce(t,e){var r,n=function(o){if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var u=Object.keys(t);Pe(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=Lt(o)},i=n.prototype=Object.create(rn);return i.constructor=n,n}function Je(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function Ne(t){return t._name||t.constructor.name||"Record"}function Pe(t,e){try{e.forEach(He.bind(void 0,t))}catch(r){}}function He(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){ut(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function Ve(t,e){if(t===e)return!0;if(!y(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||d(t)!==d(e)||m(t)!==m(e)||w(t)!==w(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!g(t);if(w(t)){var n=t.entries();return e.every(function(t,e){var i=n.next().value;return i&&X(i[1],t)&&(r||X(i[0],e))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,s=e.__iterate(function(e,n){return(r?t.has(e):i?X(e,t.get(n,cr)):X(t.get(n,cr),e))?void 0:(u=!1,!1)});return u&&t.size===s}function Ye(t,e,r){if(!(this instanceof Ye))return new Ye(t,e,r);if(ut(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,Math.ceil((e-t)/r-1)+1),0===this.size){if(nn)return nn;nn=this}}function Qe(t,e){if(!(this instanceof Qe))return new Qe(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(on)return on;on=this}}function Xe(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function Fe(t,e){return e}function Ge(t,e){return[e,t]}function Ze(t){return function(){return!t.apply(this,arguments)}}function $e(t){return function(){return-t.apply(this,arguments)}}function tr(t){return"string"==typeof t?JSON.stringify(t):t}function er(){return i(arguments)}function rr(t,e){return e>t?1:t>e?-1:0}function nr(t){if(t.size===1/0)return 0;var e=w(t),r=d(t),n=e?1:0,i=t.__iterate(r?e?function(t,e){n=31*n+or(et(t),et(e))|0}:function(t,e){n=n+or(et(t),et(e))|0}:e?function(t){n=31*n+et(t)|0}:function(t){n=n+et(t)|0});return ir(i,n)}function ir(t,e){return e=Mr(e,3432918353),e=Mr(e<<15|e>>>-15,461845907),e=Mr(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=Mr(e^e>>>16,2246822507),e=Mr(e^e>>>13,3266489909),e=tt(e^e>>>16)}function or(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var ur=Array.prototype.slice,sr="delete",ar=5,hr=1<=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},j.prototype.__iterator=function(t,e){var r=this._array,n=r.length-1,i=0;return new S(function(){return i>n?I():z(t,i,r[e?n-i++:i++])})},t(R,x),R.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},R.prototype.has=function(t){return this._object.hasOwnProperty(t)},R.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,o=0;i>=o;o++){var u=n[e?i-o:o];if(t(r[u],u,this)===!1)return o+1}return o},R.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length-1,o=0;return new S(function(){var u=n[e?i-o:o];return o++>i?I():z(t,u,r[u])})},R.prototype[dr]=!0,t(U,k),U.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=D(r),i=0;if(q(n))for(var o;!(o=n.next()).done&&t(o.value,i++,this)!==!1;);return i},U.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=D(r);if(!q(n))return new S(I);var i=0;return new S(function(){var e=n.next();return e.done?e:z(t,i++,e.value)})},t(K,k),K.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;i=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return z(t,i,n[i++])})};var qr;t(H,_),t(V,H),t(Y,H),t(Q,H),H.Keyed=V,H.Indexed=Y,H.Set=Q;var Dr,Mr="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},Er=Object.isExtensible,Or=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),xr="function"==typeof WeakMap;xr&&(Dr=new WeakMap);var kr=0,Ar="__immutablehash__";"function"==typeof Symbol&&(Ar=Symbol(Ar));var jr=16,Rr=255,Ur=0,Kr={};t(at,x),at.prototype.get=function(t,e){return this._iter.get(t,e)},at.prototype.has=function(t){return this._iter.has(t)},at.prototype.valueSeq=function(){return this._iter.valueSeq()},at.prototype.reverse=function(){var t=this,e=vt(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},at.prototype.map=function(t,e){var r=this,n=pt(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},at.prototype.__iterate=function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?kt(this):0,function(i){return t(i,e?--r:r++,n)}),e)},at.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(gr,e),n=e?kt(this):0;return new S(function(){var i=r.next();return i.done?i:z(t,e?--n:n++,i.value,i)})},at.prototype[dr]=!0,t(ht,k),ht.prototype.includes=function(t){return this._iter.includes(t)},ht.prototype.__iterate=function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},ht.prototype.__iterator=function(t,e){var r=this._iter.__iterator(gr,e),n=0;return new S(function(){var e=r.next();return e.done?e:z(t,n++,e.value,e)})},t(ft,A),ft.prototype.has=function(t){return this._iter.includes(t)},ft.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},ft.prototype.__iterator=function(t,e){var r=this._iter.__iterator(gr,e);return new S(function(){var e=r.next();return e.done?e:z(t,e.value,e.value,e)})},t(ct,x),ct.prototype.entrySeq=function(){return this._iter.toSeq()},ct.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){if(e){xt(e);var n=y(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}},e)},ct.prototype.__iterator=function(t,e){var r=this._iter.__iterator(gr,e);return new S(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){xt(n);var i=y(n);return z(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}})},ht.prototype.cacheResult=at.prototype.cacheResult=ft.prototype.cacheResult=ct.prototype.cacheResult=Rt,t(Lt,V),Lt.prototype.toString=function(){return this.__toString("Map {","}")},Lt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Lt.prototype.set=function(t,e){return Xt(this,t,e)},Lt.prototype.setIn=function(t,e){return this.updateIn(t,cr,function(){return e})},Lt.prototype.remove=function(t){return Xt(this,t,cr)},Lt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return cr})},Lt.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},Lt.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=oe(this,Kt(t),e,r);return n===cr?void 0:n},Lt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qt()},Lt.prototype.merge=function(){return re(this,void 0,arguments)},Lt.prototype.mergeWith=function(t){var e=ur.call(arguments,1);return re(this,t,e)},Lt.prototype.mergeIn=function(t){var e=ur.call(arguments,1);return this.updateIn(t,Qt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},Lt.prototype.mergeDeep=function(){return re(this,ne(void 0),arguments)},Lt.prototype.mergeDeepWith=function(t){var e=ur.call(arguments,1);return re(this,ne(t),e)},Lt.prototype.mergeDeepIn=function(t){var e=ur.call(arguments,1);return this.updateIn(t,Qt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},Lt.prototype.sort=function(t){return Ie(qt(this,t))},Lt.prototype.sortBy=function(t,e){return Ie(qt(this,e,t))},Lt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Lt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new n)},Lt.prototype.asImmutable=function(){return this.__ensureOwner()},Lt.prototype.wasAltered=function(){return this.__altered; -},Lt.prototype.__iterator=function(t,e){return new Pt(this,t,e)},Lt.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},Lt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Yt(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Lt.isMap=Tt;var Lr="@@__IMMUTABLE_MAP__@@",Tr=Lt.prototype;Tr[Lr]=!0,Tr[sr]=Tr.remove,Tr.removeIn=Tr.deleteIn,Wt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},Wt.prototype.update=function(t,e,n,o,u,s,a){for(var h=u===cr,f=this.entries,c=0,_=f.length;_>c&&!X(o,f[c][0]);c++);var p=_>c;if(p?f[c][1]===u:h)return this;if(r(a),(h||!p)&&r(s),!h||1!==f.length){if(!p&&!h&&f.length>=Br)return $t(t,f,o,u);var v=t&&t===this.ownerID,l=v?f:i(f);return p?h?c===_-1?l.pop():l[c]=l.pop():l[c]=[o,u]:l.push([o,u]),v?(this.entries=l,this):new Wt(t,l)}},Bt.prototype.get=function(t,e,r,n){void 0===e&&(e=et(r));var i=1<<((0===t?e:e>>>t)&fr),o=this.bitmap;return 0===(o&i)?n:this.nodes[ue(o&i-1)].get(t+ar,e,r,n)},Bt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=et(n));var s=(0===e?r:r>>>e)&fr,a=1<=Cr)return ee(t,_,h,s,v);if(f&&!v&&2===_.length&&Gt(_[1^c]))return _[1^c];if(f&&v&&1===_.length&&Gt(v))return v;var l=t&&t===this.ownerID,y=f?v?h:h^a:h|a,d=f?v?se(_,c,v,l):he(_,c,l):ae(_,c,v,l);return l?(this.bitmap=y,this.nodes=d,this):new Bt(t,y,d)},Ct.prototype.get=function(t,e,r,n){void 0===e&&(e=et(r));var i=(0===t?e:e>>>t)&fr,o=this.nodes[i];return o?o.get(t+ar,e,r,n):n},Ct.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=et(n));var s=(0===e?r:r>>>e)&fr,a=i===cr,h=this.nodes,f=h[s];if(a&&!f)return this;var c=Ft(f,t,e+ar,r,n,i,o,u);if(c===f)return this;var _=this.count;if(f){if(!c&&(_--,Jr>_))return te(t,h,_,s)}else _++;var p=t&&t===this.ownerID,v=se(h,s,c,p);return p?(this.count=_,this.nodes=v,this):new Ct(t,_,v)},Jt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},Jt.prototype.update=function(t,e,n,o,u,s,a){void 0===n&&(n=et(o));var h=u===cr;if(n!==this.keyHash)return h?this:(r(a),r(s),Zt(this,t,e,n,[o,u]));for(var f=this.entries,c=0,_=f.length;_>c&&!X(o,f[c][0]);c++);var p=_>c;if(p?f[c][1]===u:h)return this;if(r(a),(h||!p)&&r(s),h&&2===_)return new Nt(t,this.keyHash,f[1^c]);var v=t&&t===this.ownerID,l=v?f:i(f);return p?h?c===_-1?l.pop():l[c]=l.pop():l[c]=[o,u]:l.push([o,u]),v?(this.entries=l,this):new Jt(t,this.keyHash,l)},Nt.prototype.get=function(t,e,r,n){return X(r,this.entry[0])?this.entry[1]:n},Nt.prototype.update=function(t,e,n,i,o,u,s){var a=o===cr,h=X(i,this.entry[0]);return(h?o===this.entry[1]:a)?this:(r(s),a?void r(u):h?t&&t===this.ownerID?(this.entry[1]=o,this):new Nt(t,this.keyHash,[i,o]):(r(u),Zt(this,t,e,et(i),[i,o])))},Wt.prototype.iterate=Jt.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},Bt.prototype.iterate=Ct.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var o=r[e?i-n:n];if(o&&o.iterate(t,e)===!1)return!1}},Nt.prototype.iterate=function(t,e){return t(this.entry)},t(Pt,S),Pt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return Ht(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return Ht(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return Ht(t,o.entry);e=this._stack=Vt(o,e)}continue}e=this._stack=this._stack.__prev}return I()};var Wr,Br=hr/4,Cr=hr/2,Jr=hr/4;t(fe,Y),fe.of=function(){return this(arguments)},fe.prototype.toString=function(){return this.__toString("List [","]")},fe.prototype.get=function(t,e){if(t=u(this,t),t>=0&&t>>e&fr;if(n>=this.array.length)return new _e([],t);var i,o=0===n;if(e>0){var u=this.array[n];if(i=u&&u.removeBefore(t,e-ar,r),i===u&&o)return this}if(o&&!i)return this;var s=me(this,t);if(!o)for(var a=0;n>a;a++)s.array[a]=void 0;return i&&(s.array[n]=i),s},_e.prototype.removeAfter=function(t,e,r){if(r===(e?1<>>e&fr;if(n>=this.array.length)return this;var i;if(e>0){var o=this.array[n];if(i=o&&o.removeAfter(t,e-ar,r),i===o&&n===this.array.length-1)return this}var u=me(this,t);return u.array.splice(n+1),i&&(u.array[n]=i),u};var Hr,Vr={};t(Ie,Lt),Ie.of=function(){return this(arguments)},Ie.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ie.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},Ie.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):De()},Ie.prototype.set=function(t,e){return Me(this,t,e)},Ie.prototype.remove=function(t){return Me(this,t,cr)},Ie.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ie.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},Ie.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Ie.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?qe(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)},Ie.isOrderedMap=be,Ie.prototype[dr]=!0,Ie.prototype[sr]=Ie.prototype.remove;var Yr;t(Ee,Y),Ee.of=function(){return this(arguments)},Ee.prototype.toString=function(){return this.__toString("Stack [","]")},Ee.prototype.get=function(t,e){var r=this._head;for(t=u(this,t);r&&t--;)r=r.next;return r?r.value:e},Ee.prototype.peek=function(){return this._head&&this._head.value},Ee.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):xe(t,e)},Ee.prototype.pushAll=function(t){if(t=v(t),0===t.size)return this;st(t.size);var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):xe(e,r)},Ee.prototype.pop=function(){return this.slice(1)},Ee.prototype.unshift=function(){return this.push.apply(this,arguments)},Ee.prototype.unshiftAll=function(t){return this.pushAll(t)},Ee.prototype.shift=function(){return this.pop.apply(this,arguments)},Ee.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):ke()},Ee.prototype.slice=function(t,e){if(a(t,e,this.size))return this;var r=h(t,this.size),n=f(e,this.size);if(n!==this.size)return Y.prototype.slice.call(this,t,e);for(var i=this.size-r,o=this._head;r--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):xe(i,o)},Ee.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?xe(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ee.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},Ee.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var r=0,n=this._head;return new S(function(){if(n){var e=n.value;return n=n.next,z(t,r++,e)}return I()})},Ee.isStack=Oe;var Qr="@@__IMMUTABLE_STACK__@@",Xr=Ee.prototype;Xr[Qr]=!0,Xr.withMutations=Tr.withMutations,Xr.asMutable=Tr.asMutable,Xr.asImmutable=Tr.asImmutable,Xr.wasAltered=Tr.wasAltered;var Fr;t(Ae,Q),Ae.of=function(){return this(arguments)},Ae.fromKeys=function(t){return this(p(t).keySeq())},Ae.prototype.toString=function(){return this.__toString("Set {","}")},Ae.prototype.has=function(t){return this._map.has(t)},Ae.prototype.add=function(t){return Re(this,this._map.set(t,!0))},Ae.prototype.remove=function(t){return Re(this,this._map.remove(t))},Ae.prototype.clear=function(){return Re(this,this._map.clear())},Ae.prototype.union=function(){var t=ur.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var r=0;r1?" by "+this._step:"")+" ]"},Ye.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e},Ye.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e=e?new Ye(0,0):new Ye(this.get(t,this._end),this.get(e,this._end),this._step))},Ye.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&r=o;o++){if(t(i,o,this)===!1)return o+1;i+=e?-n:n}return o},Ye.prototype.__iterator=function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;return new S(function(){var u=i;return i+=e?-n:n,o>r?I():z(t,o++,u)})},Ye.prototype.equals=function(t){return t instanceof Ye?this._start===t._start&&this._end===t._end&&this._step===t._step:Ve(this,t)};var nn;t(Qe,k),Qe.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Qe.prototype.get=function(t,e){return this.has(t)?this._value:e},Qe.prototype.includes=function(t){return X(this._value,t)},Qe.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:new Qe(this._value,f(e,r)-h(t,r))},Qe.prototype.reverse=function(){return this},Qe.prototype.indexOf=function(t){return X(this._value,t)?0:-1},Qe.prototype.lastIndexOf=function(t){return X(this._value,t)?this.size:-1},Qe.prototype.__iterate=function(t,e){for(var r=0;rt?this.count():this.size);var n=this.slice(0,t);return Ot(this,1===r?n:n.concat(i(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.toKeyedSeq().findLastKey(t,e);return void 0===r?-1:r},first:function(){return this.get(0)},flatten:function(t){return Ot(this,zt(this,t,!1))},get:function(t,e){return t=u(this,t),0>t||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=u(this,t),t>=0&&(void 0!==this.size?this.size===1/0||ti;i++)n[i]=t[i+e];return n}function v(t){return void 0===t.size&&(t.size=t.__iterate(y)),t.size}function l(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return 0>e?v(t)+e:e}function y(){return!0}function d(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function m(t,e){return w(t,e,0)}function g(t,e){return w(t,e,e)}function w(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function S(t){this.next=t}function z(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function I(){return{value:void 0,done:!0}}function b(t){return!!M(t)}function q(t){return t&&"function"==typeof t.next}function D(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(zr&&t[zr]||t[Ir]);return"function"==typeof e?e:void 0}function E(t){return t&&"number"==typeof t.length}function O(t){return null===t||void 0===t?T():o(t)?t.toSeq():C(t)}function x(t){return null===t||void 0===t?T().toKeyedSeq():o(t)?u(t)?t.toSeq():t.fromEntrySeq():W(t)}function k(t){return null===t||void 0===t?T():o(t)?u(t)?t.entrySeq():t.toIndexedSeq():B(t)}function A(t){return(null===t||void 0===t?T():o(t)?u(t)?t.entrySeq():t:B(t)).toSetSeq()}function j(t){this._array=t,this.size=t.length}function K(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function R(t){this._iterable=t,this.size=t.length||t.size}function U(t){this._iterator=t,this._iteratorCache=[]}function L(t){return!(!t||!t[qr])}function T(){return Dr||(Dr=new j([]))}function W(t){var e=Array.isArray(t)?new j(t).fromEntrySeq():q(t)?new U(t).fromEntrySeq():b(t)?new R(t).fromEntrySeq():"object"==typeof t?new K(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function B(t){var e=J(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function C(t){var e=J(t)||"object"==typeof t&&new K(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function J(t){return E(t)?new j(t):q(t)?new U(t):b(t)?new R(t):void 0}function N(t,e,r,n){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var s=i[r?o-u:u];if(e(s[1],n?s[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,r)}function P(t,e,r,n){var i=t._cache;if(i){var o=i.length-1,u=0;return new S(function(){var t=i[r?o-u:u];return u++>o?I():z(e,n?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,r)}function H(t,e){return e?V(e,t,"",{"":t}):Y(t)}function V(t,e,r,n){return Array.isArray(e)?t.call(n,r,k(e).map(function(r,n){return V(t,r,n,e)})):Q(e)?t.call(n,r,x(e).map(function(r,n){return V(t,r,n,e)})):e}function Y(t){return Array.isArray(t)?k(t).map(Y).toList():Q(t)?x(t).map(Y).toMap():t}function Q(t){return t&&(t.constructor===Object||void 0===t.constructor)}function X(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return"function"==typeof t.equals&&"function"==typeof e.equals&&t.equals(e)?!0:!1}function F(t,e){if(t===e)return!0;if(!o(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||u(t)!==u(e)||s(t)!==s(e)||h(t)!==h(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!a(t);if(h(t)){var n=t.entries();return e.every(function(t,e){var i=n.next().value;return i&&X(i[1],t)&&(r||X(i[0],e))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var f=t;t=e,e=f}var c=!0,_=e.__iterate(function(e,n){return(r?t.has(e):i?X(e,t.get(n,yr)):X(t.get(n,yr),e))?void 0:(c=!1,!1)});return c&&t.size===_}function G(t,e){if(!(this instanceof G))return new G(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(Mr)return Mr;Mr=this}}function Z(t,e){if(!t)throw new Error(e)}function $(t,e,r){if(!(this instanceof $))return new $(t,e,r);if(Z(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,Math.ceil((e-t)/r-1)+1),0===this.size){if(Er)return Er;Er=this}}function tt(){throw TypeError("Abstract")}function et(){}function rt(){}function nt(){}function it(t){return t>>>1&1073741824|3221225471&t}function ot(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)t/=4294967295,r^=t;return it(r)}if("string"===e)return t.length>Ur?ut(t):st(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===e)return at(t);if("function"==typeof t.toString)return st(t.toString());throw new Error("Value type "+e+" cannot be hashed.")}function ut(t){var e=Wr[t];return void 0===e&&(e=st(t),Tr===Lr&&(Tr=0,Wr={}),Tr++,Wr[t]=e),e}function st(t){for(var e=0,r=0;r0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ft(t){Z(t!==1/0,"Cannot perform this action with an infinite size.")}function ct(t){return null===t||void 0===t?zt():_t(t)&&!h(t)?t:zt().withMutations(function(e){var n=r(t);ft(n.size),n.forEach(function(t,r){return e.set(r,t)})})}function _t(t){return!(!t||!t[Br])}function pt(t,e){this.ownerID=t,this.entries=e}function vt(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r}function lt(t,e,r){this.ownerID=t,this.count=e,this.nodes=r}function yt(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r}function dt(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r}function mt(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&wt(t._root)}function gt(t,e){return z(t,e[0],e[1])}function wt(t,e){return{node:t,index:0,__prev:e}}function St(t,e,r,n){var i=Object.create(Cr);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function zt(){return Jr||(Jr=St(0))}function It(t,e,r){var n,i;if(t._root){var o=f(dr),u=f(mr);if(n=bt(t._root,t.__ownerID,0,void 0,e,r,o,u),!u.value)return t;i=t.size+(o.value?r===yr?-1:1:0)}else{if(r===yr)return t;i=1,n=new pt(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?St(i,n):zt()}function bt(t,e,r,n,i,o,u,s){return t?t.update(e,r,n,i,o,u,s):o===yr?t:(c(s),c(u),new dt(e,n,[i,o]))}function qt(t){return t.constructor===dt||t.constructor===yt}function Dt(t,e,r,n,i){if(t.keyHash===n)return new yt(e,n,[t.entry,i]);var o,u=(0===r?t.keyHash:t.keyHash>>>r)&lr,s=(0===r?n:n>>>r)&lr,a=u===s?[Dt(t,e,r+pr,n,i)]:(o=new dt(e,n,i),s>u?[t,o]:[o,t]);return new vt(e,1<s;s++,a<<=1){var f=e[s];void 0!==f&&s!==n&&(i|=a,u[o++]=f)}return new vt(t,i,u)}function Ot(t,e,r,n,i){for(var o=0,u=new Array(vr),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new lt(t,o+1,u)}function xt(t,e,n){for(var i=[],u=0;u>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function Ut(t,e,r,n){var i=n?t:p(t);return i[e]=r,i}function Lt(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=new Array(i),u=0,s=0;i>s;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}function Tt(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,u=0;n>u;u++)u===e&&(o=1),i[u]=t[u+o];return i}function Wt(t){var e=Pt();if(null===t||void 0===t)return e;if(Bt(t))return t;var r=n(t),i=r.size;return 0===i?e:(ft(i),i>0&&vr>i?Nt(0,i,pr,null,new Ct(r.toArray())):e.withMutations(function(t){t.setSize(i),r.forEach(function(e,r){return t.set(r,e)})}))}function Bt(t){return!(!t||!t[Vr])}function Ct(t,e){this.array=t,this.ownerID=e}function Jt(t,e){function r(t,e,r){return 0===e?n(t,r):i(t,e,r)}function n(t,r){var n=r===s?a&&a.array:t&&t.array,i=r>o?0:o-r,h=u-r;return h>vr&&(h=vr),function(){if(i===h)return Xr;var t=e?--h:i++;return n&&n[t]}}function i(t,n,i){var s,a=t&&t.array,h=i>o?0:o-i>>n,f=(u-i>>n)+1;return f>vr&&(f=vr),function(){for(;;){if(s){var t=s();if(t!==Xr)return t;s=null}if(h===f)return Xr;var o=e?--f:h++;s=r(a&&a[o],n-pr,i+(o<=t.size||0>e)return t.withMutations(function(t){0>e?Xt(t,e).set(0,r):Xt(t,0,e+1).set(e,r)});e+=t._origin;var n=t._tail,i=t._root,o=f(mr);return e>=Gt(t._capacity)?n=Vt(n,t.__ownerID,0,e,r,o):i=Vt(i,t.__ownerID,t._level,e,r,o),o.value?t.__ownerID?(t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t):Nt(t._origin,t._capacity,t._level,i,n):t}function Vt(t,e,r,n,i,o){var u=n>>>r&lr,s=t&&u0){var h=t&&t.array[u],f=Vt(h,e,r-pr,n,i,o);return f===h?t:(a=Yt(t,e),a.array[u]=f,a)}return s&&t.array[u]===i?t:(c(o),a=Yt(t,e),void 0===i&&u===a.array.length-1?a.array.pop():a.array[u]=i,a)}function Yt(t,e){return e&&t&&e===t.ownerID?t:new Ct(t?t.array.slice():[],e)}function Qt(t,e){if(e>=Gt(t._capacity))return t._tail;if(e<1<0;)r=r.array[e>>>n&lr],n-=pr;return r}}function Xt(t,e,r){void 0!==e&&(e=0|e),void 0!==r&&(r=0|r);var n=t.__ownerID||new _,i=t._origin,o=t._capacity,u=i+e,s=void 0===r?o:0>r?o+r:i+r;if(u===i&&s===o)return t;if(u>=s)return t.clear();for(var a=t._level,h=t._root,f=0;0>u+f;)h=new Ct(h&&h.array.length?[void 0,h]:[],n),a+=pr,f+=1<=1<p?Qt(t,s-1):p>c?new Ct([],n):v;if(v&&p>c&&o>u&&v.array.length){h=Yt(h,n);for(var y=h,d=a;d>pr;d-=pr){var m=c>>>d&lr;y=y.array[m]=Yt(y.array[m],n)}y.array[c>>>pr&lr]=v}if(o>s&&(l=l&&l.removeAfter(n,0,s)),u>=p)u-=p,s-=p,a=pr,h=null,l=l&&l.removeBefore(n,0,u);else if(u>i||c>p){for(f=0;h;){var g=u>>>a&lr;if(g!==p>>>a&lr)break;g&&(f+=(1<i&&(h=h.removeBefore(n,a,u-f)),h&&c>p&&(h=h.removeAfter(n,a,p-f)),f&&(u-=f,s-=f)}return t.__ownerID?(t.size=s-u,t._origin=u,t._capacity=s,t._level=a,t._root=h,t._tail=l,t.__hash=void 0,t.__altered=!0,t):Nt(u,s,a,h,l)}function Ft(t,e,r){for(var i=[],u=0,s=0;su&&(u=h.size),o(a)||(h=h.map(function(t){return H(t)})),i.push(h)}return u>t.size&&(t=t.setSize(u)),jt(t,e,i)}function Gt(t){return vr>t?0:t-1>>>pr<=vr&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&s!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):te(n,i)}function ne(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ie(t){this._iter=t,this.size=t.size}function oe(t){this._iter=t,this.size=t.size}function ue(t){this._iter=t,this.size=t.size}function se(t){var e=Ee(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Oe,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===Sr){var n=t.__iterator(e,r);return new S(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===wr?gr:wr,r)},e}function ae(t,e,r){var n=Ee(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,yr);return o===yr?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return n(e.call(r,t,i,u),i,o)!==!1},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(Sr,i);return new S(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return z(n,s,e.call(r,u[1],s,t),i)})},n}function he(t,e){var r=Ee(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=se(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.includes=function(e){return t.includes(e)},r.cacheResult=Oe,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function fe(t,e,r,n){var i=Ee(t);return n&&(i.has=function(n){var i=t.get(n,yr);return i!==yr&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,yr);return o!==yr&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){return e.call(r,t,o,a)?(s++,i(t,n?o:s-1,u)):void 0},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(Sr,o),s=0;return new S(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,h=a[0],f=a[1];if(e.call(r,f,h,t))return z(i,n?h:s++,f,o)}})},i}function ce(t,e,r){var n=ct().asMutable();return t.__iterate(function(i,o){n.update(e.call(r,i,o,t),0,function(t){return t+1})}),n.asImmutable()}function _e(t,e,r){var n=u(t),i=(h(t)?Zt():ct()).asMutable();t.__iterate(function(o,u){i.update(e.call(r,o,u,t),function(t){return t=t||[],t.push(n?[u,o]:o),t})});var o=Me(t);return i.map(function(e){return be(t,o(e))})}function pe(t,e,r,n){var i=t.size;if(void 0!==e&&(e=0|e),void 0!==r&&(r=0|r),d(e,r,i))return t;var o=m(e,i),u=g(r,i);if(o!==o||u!==u)return pe(t.toSeq().cacheResult(),e,r,n);var s,a=u-o;a===a&&(s=0>a?0:a);var h=Ee(t);return h.size=0===s?s:t.size&&s||void 0,!n&&L(t)&&s>=0&&(h.get=function(e,r){return e=l(this,e),e>=0&&s>e?t.get(e+o,r):r}),h.__iterateUncached=function(e,r){var i=this;if(0===s)return 0;if(r)return this.cacheResult().__iterate(e,r);var u=0,a=!0,h=0;return t.__iterate(function(t,r){return a&&(a=u++s)return I();var t=i.next();return n||e===wr?t:e===gr?z(e,a-1,void 0,t):z(e,a-1,t.value[1],t)})},h}function ve(t,e,r){var n=Ee(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)}),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(Sr,i),s=!0;return new S(function(){if(!s)return I();var t=u.next();if(t.done)return t;var i=t.value,a=i[0],h=i[1];return e.call(r,h,a,o)?n===Sr?t:z(n,a,h,t):(s=!1,I())})},n}function le(t,e,r,n){var i=Ee(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,h){return s&&(s=e.call(r,t,o,h))?void 0:(a++,i(t,n?o:a-1,u))}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(Sr,o),a=!0,h=0;return new S(function(){var t,o,f;do{if(t=s.next(),t.done)return n||i===wr?t:i===gr?z(i,h++,void 0,t):z(i,h++,t.value[1],t);var c=t.value;o=c[0],f=c[1],a&&(a=e.call(r,f,o,u))}while(a);return i===Sr?t:z(i,o,f,t)})},i}function ye(t,e){var n=u(t),i=[t].concat(e).map(function(t){return o(t)?n&&(t=r(t)):t=n?W(t):B(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===i.length)return t;if(1===i.length){var a=i[0];if(a===t||n&&u(a)||s(t)&&s(a))return a}var h=new j(i);return n?h=h.toKeyedSeq():s(t)||(h=h.toSetSeq()),h=h.flatten(!0),h.size=i.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),h}function de(t,e,r){var n=Ee(t);return n.__iterateUncached=function(n,i){function u(t,h){var f=this;t.__iterate(function(t,i){return(!e||e>h)&&o(t)?u(t,h+1):n(t,r?i:s++,f)===!1&&(a=!0),!a},i)}var s=0,a=!1;return u(t,0),s},n.__iteratorUncached=function(n,i){var u=t.__iterator(n,i),s=[],a=0;return new S(function(){for(;u;){var t=u.next();if(t.done===!1){var h=t.value;if(n===Sr&&(h=h[1]),e&&!(s.length0}function Ie(t,r,n){var i=Ee(t);return i.size=new j(n).map(function(t){return t.size}).min(),i.__iterate=function(t,e){for(var r,n=this.__iterator(wr,e),i=0;!(r=n.next()).done&&t(r.value,i++,this)!==!1;);return i},i.__iteratorUncached=function(t,i){var o=n.map(function(t){return t=e(t),D(i?t.reverse():t)}),u=0,s=!1;return new S(function(){var e;return s||(e=o.map(function(t){return t.next()}),s=e.some(function(t){return t.done})),s?I():z(t,u++,r.apply(null,e.map(function(t){return t.value})))})},i}function be(t,e){return L(t)?e:t.constructor(e)}function qe(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function De(t){return ft(t.size),v(t)}function Me(t){return u(t)?r:s(t)?n:i}function Ee(t){return Object.create((u(t)?x:s(t)?k:A).prototype)}function Oe(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function xe(t,e){return t>e?1:e>t?-1:0}function ke(t){var r=D(t);if(!r){if(!E(t))throw new TypeError("Expected iterable or array-like: "+t);r=D(e(t))}return r}function Ae(t,e){var r,n=function(o){if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var u=Object.keys(t);Re(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=ct(o)},i=n.prototype=Object.create(Gr);return i.constructor=n,n}function je(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function Ke(t){return t._name||t.constructor.name||"Record"}function Re(t,e){try{e.forEach(Ue.bind(void 0,t))}catch(r){}}function Ue(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){Z(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function Le(t){return null===t||void 0===t?Ce():Te(t)&&!h(t)?t:Ce().withMutations(function(e){var r=i(t);ft(r.size),r.forEach(function(t){return e.add(t)})})}function Te(t){return!(!t||!t[Zr])}function We(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Be(t,e){var r=Object.create($r);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Ce(){return tn||(tn=Be(zt()))}function Je(t){return null===t||void 0===t?He():Ne(t)?t:He().withMutations(function(e){var r=i(t);ft(r.size),r.forEach(function(t){return e.add(t)})})}function Ne(t){return Te(t)&&h(t)}function Pe(t,e){var r=Object.create(en);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function He(){return rn||(rn=Pe(ee()))}function Ve(t){return null===t||void 0===t?Xe():Ye(t)?t:Xe().unshiftAll(t)}function Ye(t){return!(!t||!t[nn])}function Qe(t,e,r,n){var i=Object.create(on);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Xe(){return un||(un=Qe(0))}function Fe(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function Ge(t,e){return e}function Ze(t,e){return[e,t]}function $e(t){return function(){return!t.apply(this,arguments)}}function tr(t){return function(){return-t.apply(this,arguments)}}function er(t){return"string"==typeof t?JSON.stringify(t):t}function rr(){return p(arguments)}function nr(t,e){return e>t?1:t>e?-1:0}function ir(t){if(t.size===1/0)return 0;var e=h(t),r=u(t),n=e?1:0,i=t.__iterate(r?e?function(t,e){n=31*n+ur(ot(t),ot(e))|0}:function(t,e){n=n+ur(ot(t),ot(e))|0}:e?function(t){n=31*n+ot(t)|0}:function(t){n=n+ot(t)|0});return or(i,n)}function or(t,e){return e=xr(e,3432918353),e=xr(e<<15|e>>>-15,461845907),e=xr(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=xr(e^e>>>16,2246822507),e=xr(e^e>>>13,3266489909),e=it(e^e>>>16)}function ur(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var sr=Array.prototype.slice;t(r,e),t(n,e),t(i,e),e.isIterable=o,e.isKeyed=u,e.isIndexed=s,e.isAssociative=a,e.isOrdered=h,e.Keyed=r,e.Indexed=n,e.Set=i;var ar="@@__IMMUTABLE_ITERABLE__@@",hr="@@__IMMUTABLE_KEYED__@@",fr="@@__IMMUTABLE_INDEXED__@@",cr="@@__IMMUTABLE_ORDERED__@@",_r="delete",pr=5,vr=1<=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},j.prototype.__iterator=function(t,e){var r=this._array,n=r.length-1,i=0;return new S(function(){return i>n?I():z(t,i,r[e?n-i++:i++])})},t(K,x),K.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},K.prototype.has=function(t){return this._object.hasOwnProperty(t)},K.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,o=0;i>=o;o++){var u=n[e?i-o:o];if(t(r[u],u,this)===!1)return o+1}return o},K.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length-1,o=0;return new S(function(){var u=n[e?i-o:o];return o++>i?I():z(t,u,r[u])})},K.prototype[cr]=!0,t(R,k),R.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=D(r),i=0;if(q(n))for(var o;!(o=n.next()).done&&t(o.value,i++,this)!==!1;);return i},R.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=D(r);if(!q(n))return new S(I);var i=0;return new S(function(){var e=n.next();return e.done?e:z(t,i++,e.value)})},t(U,k),U.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;i=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return z(t,i,n[i++])})};var Dr;t(G,k),G.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},G.prototype.get=function(t,e){return this.has(t)?this._value:e},G.prototype.includes=function(t){return X(this._value,t)},G.prototype.slice=function(t,e){var r=this.size;return d(t,e,r)?this:new G(this._value,g(e,r)-m(t,r))},G.prototype.reverse=function(){return this},G.prototype.indexOf=function(t){return X(this._value,t)?0:-1},G.prototype.lastIndexOf=function(t){return X(this._value,t)?this.size:-1},G.prototype.__iterate=function(t,e){for(var r=0;r1?" by "+this._step:"")+" ]"},$.prototype.get=function(t,e){return this.has(t)?this._start+l(this,t)*this._step:e},$.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e=e?new $(0,0):new $(this.get(t,this._end),this.get(e,this._end),this._step))},$.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&r=o;o++){if(t(i,o,this)===!1)return o+1;i+=e?-n:n}return o},$.prototype.__iterator=function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;return new S(function(){var u=i;return i+=e?-n:n,o>r?I():z(t,o++,u)})},$.prototype.equals=function(t){return t instanceof $?this._start===t._start&&this._end===t._end&&this._step===t._step:F(this,t)};var Er;t(tt,e),t(et,tt),t(rt,tt),t(nt,tt),tt.Keyed=et,tt.Indexed=rt,tt.Set=nt;var Or,xr="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},kr=Object.isExtensible,Ar=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),jr="function"==typeof WeakMap;jr&&(Or=new WeakMap);var Kr=0,Rr="__immutablehash__";"function"==typeof Symbol&&(Rr=Symbol(Rr));var Ur=16,Lr=255,Tr=0,Wr={};t(ct,et),ct.prototype.toString=function(){return this.__toString("Map {","}")},ct.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},ct.prototype.set=function(t,e){return It(this,t,e)},ct.prototype.setIn=function(t,e){return this.updateIn(t,yr,function(){return e})},ct.prototype.remove=function(t){return It(this,t,yr)},ct.prototype.deleteIn=function(t){return this.updateIn(t,function(){return yr})},ct.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},ct.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=Kt(this,ke(t),e,r);return n===yr?void 0:n},ct.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):zt()},ct.prototype.merge=function(){return xt(this,void 0,arguments)},ct.prototype.mergeWith=function(t){var e=sr.call(arguments,1);return xt(this,t,e)},ct.prototype.mergeIn=function(t){var e=sr.call(arguments,1);return this.updateIn(t,zt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},ct.prototype.mergeDeep=function(){return xt(this,kt,arguments)},ct.prototype.mergeDeepWith=function(t){var e=sr.call(arguments,1);return xt(this,At(t),e)},ct.prototype.mergeDeepIn=function(t){var e=sr.call(arguments,1);return this.updateIn(t,zt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},ct.prototype.sort=function(t){return Zt(we(this,t))},ct.prototype.sortBy=function(t,e){return Zt(we(this,e,t))},ct.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},ct.prototype.asMutable=function(){ +return this.__ownerID?this:this.__ensureOwner(new _)},ct.prototype.asImmutable=function(){return this.__ensureOwner()},ct.prototype.wasAltered=function(){return this.__altered},ct.prototype.__iterator=function(t,e){return new mt(this,t,e)},ct.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},ct.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?St(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},ct.isMap=_t;var Br="@@__IMMUTABLE_MAP__@@",Cr=ct.prototype;Cr[Br]=!0,Cr[_r]=Cr.remove,Cr.removeIn=Cr.deleteIn,pt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},pt.prototype.update=function(t,e,r,n,i,o,u){for(var s=i===yr,a=this.entries,h=0,f=a.length;f>h&&!X(n,a[h][0]);h++);var _=f>h;if(_?a[h][1]===i:s)return this;if(c(u),(s||!_)&&c(o),!s||1!==a.length){if(!_&&!s&&a.length>=Nr)return Mt(t,a,n,i);var v=t&&t===this.ownerID,l=v?a:p(a);return _?s?h===f-1?l.pop():l[h]=l.pop():l[h]=[n,i]:l.push([n,i]),v?(this.entries=l,this):new pt(t,l)}},vt.prototype.get=function(t,e,r,n){void 0===e&&(e=ot(r));var i=1<<((0===t?e:e>>>t)&lr),o=this.bitmap;return 0===(o&i)?n:this.nodes[Rt(o&i-1)].get(t+pr,e,r,n)},vt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=ot(n));var s=(0===e?r:r>>>e)&lr,a=1<=Pr)return Ot(t,_,h,s,v);if(f&&!v&&2===_.length&&qt(_[1^c]))return _[1^c];if(f&&v&&1===_.length&&qt(v))return v;var l=t&&t===this.ownerID,y=f?v?h:h^a:h|a,d=f?v?Ut(_,c,v,l):Tt(_,c,l):Lt(_,c,v,l);return l?(this.bitmap=y,this.nodes=d,this):new vt(t,y,d)},lt.prototype.get=function(t,e,r,n){void 0===e&&(e=ot(r));var i=(0===t?e:e>>>t)&lr,o=this.nodes[i];return o?o.get(t+pr,e,r,n):n},lt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=ot(n));var s=(0===e?r:r>>>e)&lr,a=i===yr,h=this.nodes,f=h[s];if(a&&!f)return this;var c=bt(f,t,e+pr,r,n,i,o,u);if(c===f)return this;var _=this.count;if(f){if(!c&&(_--,Hr>_))return Et(t,h,_,s)}else _++;var p=t&&t===this.ownerID,v=Ut(h,s,c,p);return p?(this.count=_,this.nodes=v,this):new lt(t,_,v)},yt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},yt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=ot(n));var s=i===yr;if(r!==this.keyHash)return s?this:(c(u),c(o),Dt(this,t,e,r,[n,i]));for(var a=this.entries,h=0,f=a.length;f>h&&!X(n,a[h][0]);h++);var _=f>h;if(_?a[h][1]===i:s)return this;if(c(u),(s||!_)&&c(o),s&&2===f)return new dt(t,this.keyHash,a[1^h]);var v=t&&t===this.ownerID,l=v?a:p(a);return _?s?h===f-1?l.pop():l[h]=l.pop():l[h]=[n,i]:l.push([n,i]),v?(this.entries=l,this):new yt(t,this.keyHash,l)},dt.prototype.get=function(t,e,r,n){return X(r,this.entry[0])?this.entry[1]:n},dt.prototype.update=function(t,e,r,n,i,o,u){var s=i===yr,a=X(n,this.entry[0]);return(a?i===this.entry[1]:s)?this:(c(u),s?void c(o):a?t&&t===this.ownerID?(this.entry[1]=i,this):new dt(t,this.keyHash,[n,i]):(c(o),Dt(this,t,e,ot(n),[n,i])))},pt.prototype.iterate=yt.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},vt.prototype.iterate=lt.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var o=r[e?i-n:n];if(o&&o.iterate(t,e)===!1)return!1}},dt.prototype.iterate=function(t,e){return t(this.entry)},t(mt,S),mt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return gt(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return gt(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return gt(t,o.entry);e=this._stack=wt(o,e)}continue}e=this._stack=this._stack.__prev}return I()};var Jr,Nr=vr/4,Pr=vr/2,Hr=vr/4;t(Wt,rt),Wt.of=function(){return this(arguments)},Wt.prototype.toString=function(){return this.__toString("List [","]")},Wt.prototype.get=function(t,e){if(t=l(this,t),t>=0&&t>>e&lr;if(n>=this.array.length)return new Ct([],t);var i,o=0===n;if(e>0){var u=this.array[n];if(i=u&&u.removeBefore(t,e-pr,r),i===u&&o)return this}if(o&&!i)return this;var s=Yt(this,t);if(!o)for(var a=0;n>a;a++)s.array[a]=void 0;return i&&(s.array[n]=i),s},Ct.prototype.removeAfter=function(t,e,r){if(r===(e?1<>>e&lr;if(n>=this.array.length)return this;var i;if(e>0){var o=this.array[n];if(i=o&&o.removeAfter(t,e-pr,r),i===o&&n===this.array.length-1)return this}var u=Yt(this,t);return u.array.splice(n+1),i&&(u.array[n]=i),u};var Qr,Xr={};t(Zt,ct),Zt.of=function(){return this(arguments)},Zt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Zt.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},Zt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):ee()},Zt.prototype.set=function(t,e){return re(this,t,e)},Zt.prototype.remove=function(t){return re(this,t,yr)},Zt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Zt.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},Zt.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Zt.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?te(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)},Zt.isOrderedMap=$t,Zt.prototype[cr]=!0,Zt.prototype[_r]=Zt.prototype.remove;var Fr;t(ne,x),ne.prototype.get=function(t,e){return this._iter.get(t,e)},ne.prototype.has=function(t){return this._iter.has(t)},ne.prototype.valueSeq=function(){return this._iter.valueSeq()},ne.prototype.reverse=function(){var t=this,e=he(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},ne.prototype.map=function(t,e){var r=this,n=ae(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},ne.prototype.__iterate=function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?De(this):0,function(i){return t(i,e?--r:r++,n)}),e)},ne.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(wr,e),n=e?De(this):0;return new S(function(){var i=r.next();return i.done?i:z(t,e?--n:n++,i.value,i)})},ne.prototype[cr]=!0,t(ie,k),ie.prototype.includes=function(t){return this._iter.includes(t)},ie.prototype.__iterate=function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},ie.prototype.__iterator=function(t,e){var r=this._iter.__iterator(wr,e),n=0;return new S(function(){var e=r.next();return e.done?e:z(t,n++,e.value,e)})},t(oe,A),oe.prototype.has=function(t){return this._iter.includes(t)},oe.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},oe.prototype.__iterator=function(t,e){var r=this._iter.__iterator(wr,e);return new S(function(){var e=r.next();return e.done?e:z(t,e.value,e.value,e)})},t(ue,x),ue.prototype.entrySeq=function(){return this._iter.toSeq()},ue.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){if(e){qe(e);var n=o(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}},e)},ue.prototype.__iterator=function(t,e){var r=this._iter.__iterator(wr,e);return new S(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){qe(n);var i=o(n);return z(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}})},ie.prototype.cacheResult=ne.prototype.cacheResult=oe.prototype.cacheResult=ue.prototype.cacheResult=Oe,t(Ae,et),Ae.prototype.toString=function(){return this.__toString(Ke(this)+" {","}")},Ae.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},Ae.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},Ae.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=je(this,zt()))},Ae.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+Ke(this));var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:je(this,r)},Ae.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:je(this,e)},Ae.prototype.wasAltered=function(){return this._map.wasAltered()},Ae.prototype.__iterator=function(t,e){var n=this;return r(this._defaultValues).map(function(t,e){return n.get(e)}).__iterator(t,e)},Ae.prototype.__iterate=function(t,e){var n=this;return r(this._defaultValues).map(function(t,e){return n.get(e)}).__iterate(t,e)},Ae.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?je(this,e,t):(this.__ownerID=t,this._map=e,this)};var Gr=Ae.prototype;Gr[_r]=Gr.remove,Gr.deleteIn=Gr.removeIn=Cr.removeIn,Gr.merge=Cr.merge,Gr.mergeWith=Cr.mergeWith,Gr.mergeIn=Cr.mergeIn,Gr.mergeDeep=Cr.mergeDeep,Gr.mergeDeepWith=Cr.mergeDeepWith,Gr.mergeDeepIn=Cr.mergeDeepIn,Gr.setIn=Cr.setIn,Gr.update=Cr.update,Gr.updateIn=Cr.updateIn,Gr.withMutations=Cr.withMutations,Gr.asMutable=Cr.asMutable,Gr.asImmutable=Cr.asImmutable,t(Le,nt),Le.of=function(){return this(arguments)},Le.fromKeys=function(t){return this(r(t).keySeq())},Le.prototype.toString=function(){return this.__toString("Set {","}")},Le.prototype.has=function(t){return this._map.has(t)},Le.prototype.add=function(t){return We(this,this._map.set(t,!0))},Le.prototype.remove=function(t){return We(this,this._map.remove(t))},Le.prototype.clear=function(){return We(this,this._map.clear())},Le.prototype.union=function(){var t=sr.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var r=0;r=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):Qe(t,e)},Ve.prototype.pushAll=function(t){if(t=n(t),0===t.size)return this;ft(t.size);var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Qe(e,r)},Ve.prototype.pop=function(){return this.slice(1)},Ve.prototype.unshift=function(){return this.push.apply(this,arguments)},Ve.prototype.unshiftAll=function(t){return this.pushAll(t)},Ve.prototype.shift=function(){return this.pop.apply(this,arguments)},Ve.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Xe()},Ve.prototype.slice=function(t,e){if(d(t,e,this.size))return this;var r=m(t,this.size),n=g(e,this.size);if(n!==this.size)return rt.prototype.slice.call(this,t,e);for(var i=this.size-r,o=this._head;r--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Qe(i,o)},Ve.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Qe(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ve.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},Ve.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var r=0,n=this._head;return new S(function(){if(n){var e=n.value;return n=n.next,z(t,r++,e)}return I()})},Ve.isStack=Ye;var nn="@@__IMMUTABLE_STACK__@@",on=Ve.prototype;on[nn]=!0,on.withMutations=Cr.withMutations,on.asMutable=Cr.asMutable,on.asImmutable=Cr.asImmutable,on.wasAltered=Cr.wasAltered;var un;e.Iterator=S,Fe(e,{toArray:function(){ft(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new ie(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new ne(this,!0)},toMap:function(){return ct(this.toKeyedSeq())},toObject:function(){ft(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return Zt(this.toKeyedSeq())},toOrderedSet:function(){return Je(u(this)?this.valueSeq():this)},toSet:function(){return Le(u(this)?this.valueSeq():this)},toSetSeq:function(){return new oe(this)},toSeq:function(){return s(this)?this.toIndexedSeq():u(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Ve(u(this)?this.valueSeq():this)},toList:function(){return Wt(u(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){var t=sr.call(arguments,0);return be(this,ye(this,t))},includes:function(t){return this.some(function(e){return X(e,t)})},entries:function(){return this.__iterator(Sr)},every:function(t,e){ft(this.size);var r=!0;return this.__iterate(function(n,i,o){return t.call(e,n,i,o)?void 0:(r=!1,!1)}),r},filter:function(t,e){return be(this,fe(this,t,e,!0))},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},findEntry:function(t,e){var r;return this.__iterate(function(n,i,o){return t.call(e,n,i,o)?(r=[i,n],!1):void 0}),r},findLastEntry:function(t,e){return this.toSeq().reverse().findEntry(t,e)},forEach:function(t,e){return ft(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){ft(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?n.toString():""}),e},keys:function(){return this.__iterator(gr)},map:function(t,e){return be(this,ae(this,t,e))},reduce:function(t,e,r){ft(this.size);var n,i;return arguments.length<2?i=!0:n=e,this.__iterate(function(e,o,u){i?(i=!1,n=e):n=t.call(r,n,e,o,u)}),n},reduceRight:function(t,e,r){var n=this.toKeyedSeq().reverse();return n.reduce.apply(n,arguments)},reverse:function(){return be(this,he(this,!0))},slice:function(t,e){return be(this,pe(this,t,e,!0))},some:function(t,e){return!this.every($e(t),e)},sort:function(t){return be(this,we(this,t))},values:function(){return this.__iterator(wr)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return v(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return ce(this,t,e)},equals:function(t){return F(this,t)},entrySeq:function(){var t=this;if(t._cache)return new j(t._cache);var e=t.toSeq().map(Ze).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter($e(t),e)},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},first:function(){return this.find(y)},flatMap:function(t,e){return be(this,me(this,t,e))},flatten:function(t){return be(this,de(this,t,!0))},fromEntrySeq:function(){return new ue(this)},get:function(t,e){return this.find(function(e,r){return X(r,t)},void 0,e)},getIn:function(t,e){for(var r,n=this,i=ke(t);!(r=i.next()).done;){var o=r.value;if(n=n&&n.get?n.get(o,yr):yr,n===yr)return e}return n},groupBy:function(t,e){return _e(this,t,e)},has:function(t){return this.get(t,yr)!==yr},hasIn:function(t){return this.getIn(t,yr)!==yr},isSubset:function(t){return t="function"==typeof t.includes?t:e(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return t="function"==typeof t.isSubset?t:e(t),t.isSubset(this)},keySeq:function(){return this.toSeq().map(Ge).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return Se(this,t)},maxBy:function(t,e){return Se(this,e,t)},min:function(t){return Se(this,t?tr(t):nr)},minBy:function(t,e){return Se(this,e?tr(e):nr,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return be(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return be(this,le(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile($e(t),e)},sortBy:function(t,e){return be(this,we(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return be(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return be(this,ve(this,t,e))},takeUntil:function(t,e){return this.takeWhile($e(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=ir(this))}});var sn=e.prototype;sn[ar]=!0,sn[br]=sn.values,sn.__toJS=sn.toArray,sn.__toStringMapper=er,sn.inspect=sn.toSource=function(){return this.toString()},sn.chain=sn.flatMap,sn.contains=sn.includes,function(){try{Object.defineProperty(sn,"length",{get:function(){if(!e.noLengthWarning){var t;try{throw new Error}catch(r){t=r.stack}if(-1===t.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+t),this.size}}})}catch(t){}}(),Fe(r,{flip:function(){return be(this,se(this))},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLastKey:function(t,e){return this.toSeq().reverse().findKey(t,e)},keyOf:function(t){return this.findKey(function(e){return X(e,t)})},lastKeyOf:function(t){return this.findLastKey(function(e){return X(e,t)})},mapEntries:function(t,e){var r=this,n=0;return be(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return be(this,this.toSeq().flip().map(function(n,i){return t.call(e,n,i,r)}).flip())}});var an=r.prototype;an[hr]=!0,an[br]=sn.entries,an.__toJS=sn.toObject,an.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+er(t)},Fe(n,{toKeyedSeq:function(){return new ne(this,!1)},filter:function(t,e){return be(this,fe(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.toKeyedSeq().keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.toKeyedSeq().reverse().keyOf(t);return void 0===e?-1:e},reverse:function(){return be(this,he(this,!1))},slice:function(t,e){return be(this,pe(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=m(t,0>t?this.count():this.size);var n=this.slice(0,t);return be(this,1===r?n:n.concat(p(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.toKeyedSeq().findLastKey(t,e);return void 0===r?-1:r},first:function(){return this.get(0)},flatten:function(t){return be(this,de(this,t,!1))},get:function(t,e){return t=l(this,t),0>t||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=l(this,t),t>=0&&(void 0!==this.size?this.size===1/0||tr){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;nr)return t[0===n?0:n-1][1];return t[t.length-1][1]}}; -},{}],176:[function(require,module,exports){ +},{}],204:[function(require,module,exports){ "use strict";var reference=require("../../reference/latest.min.js"),validate=require("./parsed");module.exports=function(e){return validate(e,reference)}; -},{"../../reference/latest.min.js":179,"./parsed":177}],177:[function(require,module,exports){ +},{"../../reference/latest.min.js":207,"./parsed":205}],205:[function(require,module,exports){ "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&&no.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":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;i7&&e.constants&&n.constants("constants",e.constants),s.sort(function(e,r){return e.line-r.line}),s}; -},{"csscolorparser":9,"util":500}],178:[function(require,module,exports){ +},{"csscolorparser":12,"util":458}],206:[function(require,module,exports){ module.exports=require("./v8.json"); -},{"./v8.json":180}],179:[function(require,module,exports){ +},{"./v8.json":208}],207:[function(require,module,exports){ module.exports=require("./v8.min.json"); -},{"./v8.min.json":181}],180:[function(require,module,exports){ +},{"./v8.min.json":209}],208:[function(require,module,exports){ module.exports={ "$version": 8, "$root": { @@ -1912,1098 +2011,892 @@ module.exports={ } } -},{}],181:[function(require,module,exports){ +},{}],209:[function(require,module,exports){ module.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"}}} -},{}],182:[function(require,module,exports){ -(function (global){ -(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||a.defaults,this.rules=p.normal,this.options.gfm&&(this.options.tables?this.rules=p.tables:this.rules=p.gfm)}function t(e,t){if(this.options=t||a.defaults,this.links=e,this.rules=u.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=u.breaks:this.rules=u.gfm:this.options.pedantic&&(this.rules=u.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||a.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(){}function h(e){for(var t,n,r=1;rAn error occured:

"+s(c.message+"",!0)+"
";throw c}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=l(p.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,u,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,u=0;c>u;u++)h=i[u],a=h.length,h=h.replace(/^ *([*+-]|\d+\.) +/,""),~h.indexOf("\n ")&&(a-=h.length,h=this.options.pedantic?h.replace(/^ {1,4}/gm,""):h.replace(new RegExp("^ {1,"+a+"}","gm"),"")),this.options.smartLists&&u!==c-1&&(o=p.bullet.exec(i[u+1])[0],l===o||l.length>1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=l(u.link)("inside",u._inside)("href",u._href)(),u.reflink=l(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:l(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:l(u.br)("{2,}","*")(),text:l(u.gfm.text)("{2,}","*")()}),t.rules=u,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;r>s;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
'+(n?e:s(e,!0))+"\n
\n":"
"+(n?e:s(e,!0))+"\n
"},n.prototype.blockquote=function(e){return"
\n"+e+"
\n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var l='
    "},n.prototype.image=function(e,t,n){var r=''+n+'":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",l="";for(n="",e=0;eo;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>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.pos127;);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=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))}}; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./buffer":185}],187:[function(require,module,exports){ -"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}; - -},{}],188:[function(require,module,exports){ -"use strict";function r(r,e,a){if(e=e||{},!a&&isChildren(e)&&(a=e,e={}),e.isRendered===!1)return null;if(processClasses(e),Array.isArray(a)&&1===a.length&&(a=a[0]),!Array.isArray(a))return React.createElement(r,e,a);var t=createArguments(r,e,a);return React.createElement.apply(React,t)}function processClasses(r){var e=r.classSet;if(e){var a=r.className;if(a&&"string"==typeof a){var t=a.match(/\S+/g);if(!t)return;for(var n=0;ns;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.lengthi;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=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}(); - -},{}],190:[function(require,module,exports){ -"use strict";var React=require("react"),Immutable=require("immutable"),window=require("global/window"),r=require("r-dom"),WebGLHeatmap=require("webgl-heatmap");module.exports=React.createClass({displayName:"ExampleOverlay",propTypes:{locations:React.PropTypes.oneOfType([React.PropTypes.array,React.PropTypes.instanceOf(Immutable.List)]),latLngAccessor:React.PropTypes.func,intensityAccessor:React.PropTypes.func,sizeAccessor:React.PropTypes.func},getDefaultProps:function(){return{latLngAccessor:function(e){return[e.latitude,e.longitude]},intensityAccessor:function(e){return.1},sizeAccessor:function(e){return 40}}},componentDidMount:function(){var e=this.getDOMNode();this._heatmap=new WebGLHeatmap({canvas:e,intensityToAlpha:!0,alphaRange:[0,.1]}),this._redraw()},componentWillUnmount:function(){this._heatmap=null},componentDidUpdate:function(){this._redraw()},_redraw:function(){var e=this._heatmap,t=this.props.project;e.clear(),e.adjustSize(),this.props.locations.forEach(function(s){var r=this.props.sizeAccessor(s),i=this.props.intensityAccessor(s),o=t(this.props.latLngAccessor(s));e.addPoint(o.x,o.y,r,i)},this),e.update(),e.display()},render:function(){var e=window.devicePixelRatio||1;return r.canvas({ref:"overlay",width:this.props.width*e,height:this.props.height*e,style:{width:this.props.width+"px",height:this.props.height+"px",position:"absolute",pointerEvents:"none",left:0,top:0}})}}); - -},{"global/window":32,"immutable":173,"r-dom":188,"react":478,"webgl-heatmap":491}],191:[function(require,module,exports){ -"use strict";function Buffer(t){t?(this.array=t.array,this.pos=t.pos):(this.array=new ArrayBuffer(this.defaultLength),this.length=this.defaultLength,this.setupViews())}module.exports=Buffer,Buffer.prototype={pos:0,itemSize:4,defaultLength:8192,arrayType:"ARRAY_BUFFER",get index(){return this.pos/this.itemSize},setupViews:function(){this.ubytes=new Uint8Array(this.array),this.bytes=new Int8Array(this.array),this.ushorts=new Uint16Array(this.array),this.shorts=new Int16Array(this.array)},bind:function(t){var e=t[this.arrayType];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.array.slice(0,this.pos),t.STATIC_DRAW),this.array=null)},destroy:function(t){this.buffer&&t.deleteBuffer(this.buffer)},resize:function(){if(this.lengthu||u>=e||0>i||i>=e)){var l=this.buffers.circleVertex.index-this.elementGroups.current.vertexStartIndex;this.buffers.circleVertex.add(u,i,-1,-1),this.buffers.circleVertex.add(u,i,1,-1),this.buffers.circleVertex.add(u,i,1,1),this.buffers.circleVertex.add(u,i,-1,1),this.elementGroups.elementBuffer.add(l,l+1,l+2),this.elementGroups.elementBuffer.add(l,l+3,l+2),this.elementGroups.current.vertexLength+=4,this.elementGroups.current.elementLength+=2}}}; +},{"../style/layout_properties":252,"../style/style_declaration_set":258,"./buffer":211,"./circle_bucket":212,"./element_groups":213,"./fill_bucket":215,"./line_bucket":216,"./symbol_bucket":217,"feature-filter":41}],211:[function(require,module,exports){ +"use strict";function Buffer(e){if(this.type=e.type,e.arrayBuffer)this.capacity=e.capacity,this.arrayBuffer=e.arrayBuffer,this.attributes=e.attributes,this.itemSize=e.itemSize,this.length=e.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 t=this.type===Buffer.BufferType.VERTEX?Buffer.VERTEX_ATTRIBUTE_ALIGNMENT:1;this.attributes=e.attributes.map(function(e){var r={};return r.name=e.name,r.components=e.components||1,r.type=e.type||Buffer.AttributeType.UNSIGNED_BYTE,r.size=r.type.size*r.components,r.offset=this.itemSize,this.itemSize=align(r.offset+r.size,t),assert(!isNaN(this.itemSize)),assert(!isNaN(r.size)),assert(r.type.name in Buffer.AttributeType),r},this),this._createPushMethod(),this._refreshViews()}}function align(e,t){t=t||1;var r=e%t;return 1!==t&&0!==r&&(e+=t-r),e}var assert=require("assert");Buffer.prototype.bind=function(e){var t=e[this.type];this.buffer?e.bindBuffer(t,this.buffer):(this.buffer=e.createBuffer(),e.bindBuffer(t,this.buffer),e.bufferData(t,this.arrayBuffer.slice(0,this.length*this.itemSize),e.STATIC_DRAW),this.arrayBuffer=null)},Buffer.prototype.destroy=function(e){this.buffer&&e.deleteBuffer(this.buffer)},Buffer.prototype.setAttribPointers=function(e,t,r){for(var i=0;i this.capacity) { this._resize(this.capacity * 1.5); }\n";for(var r=0;ru||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}}}; -},{"../style/layout_properties":243,"../style/style_declaration_set":249,"./circle_bucket":202,"./fill_bucket":206,"./line_bucket":207,"./symbol_bucket":208,"feature-filter":13}],204:[function(require,module,exports){ -"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){(!this.current||this.current.vertexLength+e>65535)&&(this.current=new ElementGroup(this.vertexBuffer.index,this.elementBuffer&&this.elementBuffer.index,this.secondElementBuffer&&this.secondElementBuffer.index),this.groups.push(this.current))}; +},{"../util/util":304,"./bucket":210}],213:[function(require,module,exports){ +"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}; -},{}],205:[function(require,module,exports){ +},{}],214:[function(require,module,exports){ "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=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=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;oe.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=2&&(n.x!==e[0].x||n.y!==e[0].y)&&(u.add(d,l,r),i.elementLength++),a>=1&&(s.add(l,r),i.secondElementLength++),l=r}}; +},{"../util/util":304,"point-geometry":310,"rbush":313,"vector-tile":459}],215:[function(require,module,exports){ +"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=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}}; -},{"./element_groups":204}],207:[function(require,module,exports){ -"use strict";function LineBucket(e,t){this.buffers=e,this.elementGroups=new ElementGroups(e.lineVertex,e.lineElement),this.layoutProperties=t}var ElementGroups=require("./element_groups");module.exports=LineBucket,LineBucket.prototype.addFeatures=function(){for(var e=this.features,t=0;t2&&e[n-1].equals(e[n-2]);)n--;if(!(e.length<2)){"bevel"===t&&(i=1.05);var u=e[0],h=e[n-1],d=u.equals(h);if(this.elementGroups.makeRoomFor(10*n),2!==n||!d){var a,l,o,f,m,p,x,v=r,c=d?"butt":r,V=1,b=0,_=!0;this.e1=this.e2=this.e3=-1,d&&(a=e[n-2],m=u.sub(a)._unit()._perp());for(var y=0;n>y;y++)if(o=d&&y===n-1?e[1]:e[y+1],!o||!e[y].equals(o)){m&&(f=m),a&&(l=a),a=e[y],l&&(b+=a.dist(l)),m=o?o.sub(a)._unit()._perp():f,f=f||m;var L=f.add(m)._unit(),C=L.x*m.x+L.y*m.y,g=1/C,k=l&&o,G=k?t:o?v:c;if(k&&"round"===G&&(s>g?G="miter":2>=g&&(G="fakeround")),"miter"===G&&g>i&&(G="bevel"),"bevel"===G&&(g>2&&(G="flipbevel"),i>g&&(G="miter")),"miter"===G)L._mult(g),this.addCurrentVertex(a,V,b,L,0,0,!1);else if("flipbevel"===G){if(g>100)L=m.clone();else{var B=f.x*m.y-f.y*m.x>0?-1:1,q=g*f.add(m).mag()/f.sub(m).mag();L._perp()._mult(q*B)}this.addCurrentVertex(a,V,b,L,0,0,!1),V=-V}else if("bevel"===G||"fakeround"===G){var P=V*(f.x*m.y-f.y*m.x)>0,S=-Math.sqrt(g*g-1);if(P?(x=0,p=S):(p=0,x=S),_||this.addCurrentVertex(a,V,b,f,p,x,!1),"fakeround"===G){for(var E,F=Math.floor(8*(.5-(C-.5))),I=0;F>I;I++)E=m.mult((I+1)/(F+1))._add(f)._unit(),this.addPieSliceVertex(a,V,b,E,P);this.addPieSliceVertex(a,V,b,L,P);for(var M=F-1;M>=0;M--)E=f.mult((M+1)/(F+1))._add(m)._unit(),this.addPieSliceVertex(a,V,b,E,P)}o&&this.addCurrentVertex(a,V,b,m,-p,-x,!1)}else"butt"===G?(_||this.addCurrentVertex(a,V,b,f,0,0,!1),o&&this.addCurrentVertex(a,V,b,m,0,0,!1)):"square"===G?(_||(this.addCurrentVertex(a,V,b,f,1,1,!1),this.e1=this.e2=-1,V=1),o&&this.addCurrentVertex(a,V,b,m,-1,-1,!1)):"round"===G&&(_||(this.addCurrentVertex(a,V,b,f,0,0,!1),this.addCurrentVertex(a,V,b,f,1,1,!0),this.e1=this.e2=-1,V=1),o&&(this.addCurrentVertex(a,V,b,m,-1,-1,!0),this.addCurrentVertex(a,V,b,m,0,0,!1)));_=!1}}}},LineBucket.prototype.addCurrentVertex=function(e,t,r,i,s,n,u){var h,d=u?1:0,a=this.buffers.lineVertex,l=this.buffers.lineElement,o=this.elementGroups.current,f=this.elementGroups.current.vertexStartIndex;h=i.mult(t),s&&h._sub(i.perp()._mult(s)),this.e3=a.add(e,h,d,0,r)-f,this.e1>=0&&this.e2>=0&&(l.add(this.e1,this.e2,this.e3),o.elementLength++),this.e1=this.e2,this.e2=this.e3,h=i.mult(-t),n&&h._sub(i.perp()._mult(n)),this.e3=a.add(e,h,d,1,r)-f,this.e1>=0&&this.e2>=0&&(l.add(this.e1,this.e2,this.e3),o.elementLength++),this.e1=this.e2,this.e2=this.e3,o.vertexLength+=2},LineBucket.prototype.addPieSliceVertex=function(e,t,r,i,s){var n=this.buffers.lineVertex,u=this.buffers.lineElement,h=this.elementGroups.current,d=this.elementGroups.current.vertexStartIndex,a=s;i=i.mult(t*(s?-1:1)),this.e3=n.add(e,i,0,a,r)-d,h.vertexLength+=1,this.e1>=0&&this.e2>=0&&(u.add(this.e1,this.e2,this.e3),h.elementLength++),s?this.e2=this.e3:this.e1=this.e3}; +},{"../util/util":304,"./bucket":210}],216:[function(require,module,exports){ +"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","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)","linesofar / 128","linesofar % 128"]}]}},LineBucket.prototype.addFeature=function(e){for(var t=e.loadGeometry(),i=this.layoutProperties,r=0;r2&&e[s-1].equals(e[s-2]);)s--;if(!(e.length<2)){"bevel"===t&&(r=1.05);var u=e[0],a=e[s-1],d=u.equals(a);if(this.makeRoomFor("line",10*s),2!==s||!d){var h,l,o,x,p,m,f,c=i,v=d?"butt":i,L=1,y=0,V=!0;this.e1=this.e2=this.e3=-1,d&&(h=e[s-2],p=u.sub(h)._unit()._perp());for(var _=0;s>_;_++)if(o=d&&_===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,B=1/k,C=l&&o,E=C?t:o?c:v;if(C&&"round"===E&&(n>B?E="miter":2>=B&&(E="fakeround")),"miter"===E&&B>r&&(E="bevel"),"bevel"===E&&(B>2&&(E="flipbevel"),r>B&&(E="miter")),"miter"===E)b._mult(B),this.addCurrentVertex(h,L,y,b,0,0,!1);else if("flipbevel"===E){if(B>100)b=p.clone();else{var g=x.x*p.y-x.y*p.x>0?-1:1,S=B*x.add(p).mag()/x.sub(p).mag();b._perp()._mult(S*g)}this.addCurrentVertex(h,L,y,b,0,0,!1),L=-L}else if("bevel"===E||"fakeround"===E){var q=L*(x.x*p.y-x.y*p.x)>0,T=-Math.sqrt(B*B-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 M=P-1;M>=0;M--)A=x.mult((M+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 a,d=u?1:0,h=this.elementGroups.line.current;h.vertexLength+=2,a=r.mult(t),n&&a._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(e,a,d,0,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,a=r.mult(-t),s&&a._sub(r.perp()._mult(s)),this.e3=this.addLineVertex(e,a,d,1,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,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}; -},{"./element_groups":204}],208:[function(require,module,exports){ -"use strict";function SymbolBucket(e,t,o,i,s){this.buffers=e,this.layoutProperties=t,this.overscaling=o,this.zoom=i,this.collisionDebug=s;var n=512*o,a=4096;this.tilePixelRatio=a/n,this.compareText={},this.symbolInstances=[]}function SymbolInstance(e,t,o,i,s,n,a,l,r,c,h,u){this.x=e.x,this.y=e.y,this.hasText=!!o,this.hasIcon=!!i,this.hasText&&(this.glyphQuads=n?getGlyphQuads(e,o,a,t,s,r):[],this.textCollisionFeature=new CollisionFeature(t,e,o,a,l,r)),this.hasIcon&&(this.iconQuads=n?getIconQuads(e,i,c,t,s,u):[],this.iconCollisionFeature=new CollisionFeature(t,e,i,c,h,u))}var 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"),resolveIcons=require("../symbol/resolve_icons"),mergeLines=require("../symbol/mergelines"),shapeText=Shaping.shapeText,shapeIcon=Shaping.shapeIcon,getGlyphQuads=Quads.getGlyphQuads,getIconQuads=Quads.getIconQuads,clipLine=require("../symbol/clip_line"),Point=require("point-geometry"),CollisionFeature=require("../symbol/collision_feature");module.exports=SymbolBucket,SymbolBucket.prototype.needsPlacement=!0,SymbolBucket.prototype.addFeatures=function(e){var t=this.layoutProperties,o=this.features,i=this.textFeatures,s=.5,n=.5;switch(t["text-anchor"]){case"right":case"top-right":case"bottom-right":s=1;break;case"left":case"top-left":case"bottom-left":s=0}switch(t["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}for(var a="right"===t["text-justify"]?1:"left"===t["text-justify"]?0:.5,l=24,r=t["text-line-height"]*l,c="line"!==t["symbol-placement"]?t["text-max-width"]*l:0,h=t["text-letter-spacing"]*l,u=[t["text-offset"][0]*l,t["text-offset"][1]*l],m=t["text-font"].join(","),p=[],x=0;xS;S++){var P=I[S];if(!(t&&g&&this.anchorIsTooClose(t.text,f,P))){var M=!(P.x<0||P.x>4096||P.y<0||P.y>4096);if(!h||M){var k=M||d;this.symbolInstances.push(new SymbolInstance(P,v,t,o,i,k,a,u,x,r,m,y))}}}},SymbolBucket.prototype.anchorIsTooClose=function(e,t,o){var i=this.compareText;if(e in i){for(var s=i[e],n=s.length-1;n>=0;n--)if(o.dist(s[n])=f&&this.addSymbols(t.glyphVertex,t.glyphElement,i.text,p.glyphQuads,f,s["text-keep-upright"],a,e.angle)),y&&(s["icon-ignore-placement"]||e.insertCollisionFeature(p.iconCollisionFeature,b),n>=b&&this.addSymbols(t.iconVertex,t.iconElement,i.icon,p.iconQuads,b,s["icon-keep-upright"],l,e.angle))}o&&this.addToDebugBuffers(e)},SymbolBucket.prototype.addSymbols=function(e,t,o,i,s,n,a,l){o.makeRoomFor(4*i.length);for(var r=o.current,c=this.zoom,h=Math.max(Math.log(s)/Math.LN2+c,0),u=0;u3*Math.PI/2))){var y=m.tl,d=m.tr,g=m.bl,f=m.br,b=m.tex,v=m.anchorPoint,I=Math.max(c+Math.log(m.minScale)/Math.LN2,h),S=Math.min(c+Math.log(m.maxScale)/Math.LN2,25);if(!(I>=S)){I===h&&(I=0);var F=e.index-r.vertexStartIndex;e.add(v.x,v.y,y.x,y.y,b.x,b.y,I,S,h),e.add(v.x,v.y,d.x,d.y,b.x+b.w,b.y,I,S,h),e.add(v.x,v.y,g.x,g.y,b.x,b.y+b.h,I,S,h),e.add(v.x,v.y,f.x,f.y,b.x+b.w,b.y+b.h,I,S,h),r.vertexLength+=4,t.add(F,F+1,F+2),t.add(F+1,F+2,F+3),r.elementLength+=2}}}},SymbolBucket.prototype.getDependencies=function(e,t,o){function i(e){return e||s?o(e):void(s=!0)}var s=!1;this.getTextDependencies(e,t,i),this.getIconDependencies(e,t,i)},SymbolBucket.prototype.getIconDependencies=function(e,t,o){function i(e,t){return e?o(e):(this.icons=t,void o())}if(this.layoutProperties["icon-image"]){var s=this.features,n=resolveIcons(s,this.layoutProperties);n.length?t.send("get icons",{icons:n},i.bind(this)):o()}else o()},SymbolBucket.prototype.getTextDependencies=function(e,t,o){var i=this.features,s=this.layoutProperties["text-font"],n=this.stacks=e.stacks;void 0===n[s]&&(n[s]={});var a=n[s],l=resolveText(i,this.layoutProperties,a);this.textFeatures=l.textFeatures,t.send("get glyphs",{uid:e.uid,fontstack:s,codepoints:l.codepoints},function(e,t){if(e)return o(e);for(var i in t)a[i]=t[i];o()})},SymbolBucket.prototype.addToDebugBuffers=function(e){this.elementGroups.collisionBox=new ElementGroups(this.buffers.collisionBoxVertex),this.elementGroups.collisionBox.makeRoomFor(0);for(var t=this.buffers.collisionBoxVertex,o=-e.angle,i=e.yStretch,s=0;sn;n++){var a=this.symbolInstances[s][0===n?"textCollisionFeature":"iconCollisionFeature"];if(a)for(var l=a.boxes,r=0;rS;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])=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;c3*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;os;s++){var n=this.symbolInstances[a][0===s?"textCollisionFeature":"iconCollisionFeature"];if(n)for(var r=n.boxes,l=0;l90||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.convert=function(t){return t instanceof LngLat?t:Array.isArray(t)?new LngLat(t[0],t[1]):t}; +},{}],219:[function(require,module,exports){ +"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}; -},{"../util/util":296}],211:[function(require,module,exports){ -"use strict";function LngLatBounds(t,n){if(t)for(var e=n?[t,n]:t,s=0,i=e.length;i>s;s++)this.extend(e[s])}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}},LngLatBounds.convert=function(t){return!t||t instanceof LngLatBounds?t:new LngLatBounds(t)}; +},{"../util/util":304}],220:[function(require,module,exports){ +"use strict";function LngLatBounds(t,n){if(t)for(var e=n?[t,n]:t,s=0,r=e.length;r>s;s++)this.extend(e[s])}module.exports=LngLatBounds;var LngLat=require("./lng_lat");LngLatBounds.prototype={extend:function(t){var n,e,s=this._sw,r=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||r?(s.lng=Math.min(n.lng,s.lng),s.lat=Math.min(n.lat,s.lat),r.lng=Math.max(e.lng,r.lng),r.lat=Math.max(e.lat,r.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)}; -},{"./lng_lat":210}],212:[function(require,module,exports){ -"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.zoom=0,this.center=new LngLat(0,0),this.angle=0,this._altitude=1.5,this._pitch=0}var LngLat=require("./lng_lat"),Point=require("point-geometry"),Coordinate=require("./coordinate"),wrap=require("../util/util").wrap,interp=require("../util/interpolate"),vec4=require("gl-matrix").vec4,mat4=require("gl-matrix").mat4;module.exports=Transform,Transform.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom=t,this.zoom=Math.max(this.zoom,t)},get maxZoom(){return this._maxZoom},set 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){this.angle=-wrap(t,-180,180)*Math.PI/180},get pitch(){return this._pitch/Math.PI*180},set pitch(t){this._pitch=Math.min(60,t)/180*Math.PI},get altitude(){return this._altitude},set altitude(t){this._altitude=Math.max(.75,t)},get zoom(){return this._zoom},set zoom(t){t=Math.min(Math.max(t,this.minZoom),this.maxZoom),this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain()},get center(){return this._center},set center(t){this._center=t,this._constrain()},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.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),o=mat4.invert(new Float64Array(16),n);if(!o)throw new Error("failed to invert matrix");var e=vec4.transformMat4([],[t.x,t.y,0,1],o),a=vec4.transformMat4([],[t.x,t.y,1,1],o),r=e[3],h=a[3],s=e[0]/r,c=a[0]/h,u=e[1]/r,l=a[1]/h,m=e[2]/r,g=a[2]/h,f=m===g?0:(i-m)/(g-m);return new Coordinate(interp(s,c,f),interp(u,l,f),this.tileZoom)},coordinatePoint:function(t){var i=this.coordinatePointMatrix(t.zoom),n=vec4.transformMat4([],[t.column,t.row,0,1],i);return new Point(n[0]/n[3],n[1]/n[3])},coordinatePointMatrix:function(t){var i=this.getProjMatrix(),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;this.latRange&&(t=this.latY(this.latRange[1]),i=this.latY(this.latRange[0]),e=i-tu-l&&(h=t+l),u+l>i&&(h=i-l)}if(this.lngRange){var m=this.x,g=s.x/2;n>m-g&&(r=n+g),m+g>o&&(r=o-g)}(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._constraining=!1}},getProjMatrix: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;return 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]),t}}; +},{"./lng_lat":219}],221:[function(require,module,exports){ +"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-tl-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}}; -},{"../util/interpolate":292,"../util/util":296,"./coordinate":209,"./lng_lat":210,"gl-matrix":21,"point-geometry":187}],213:[function(require,module,exports){ +},{"../util/interpolate":300,"../util/util":304,"./coordinate":218,"./lng_lat":219,"gl-matrix":49,"point-geometry":310}],222:[function(require,module,exports){ "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}; -},{}],214:[function(require,module,exports){ +},{}],223:[function(require,module,exports){ "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}}); -},{"./geo/lng_lat":210,"./geo/lng_lat_bounds":211,"./source/geojson_source":229,"./source/image_source":231,"./source/video_source":238,"./style/style":246,"./ui/control/attribution":269,"./ui/control/control":270,"./ui/control/navigation":271,"./ui/map":281,"./ui/popup":282,"./util/ajax":284,"./util/browser":285,"./util/config":289,"./util/evented":290,"./util/util":296,"point-geometry":187}],215:[function(require,module,exports){ +},{"./geo/lng_lat":219,"./geo/lng_lat_bounds":220,"./source/geojson_source":238,"./source/image_source":240,"./source/video_source":247,"./style/style":255,"./ui/control/attribution":277,"./ui/control/control":278,"./ui/control/navigation":279,"./ui/map":289,"./ui/popup":290,"./util/ajax":292,"./util/browser":293,"./util/config":297,"./util/evented":298,"./util/util":304,"point-geometry":310}],224:[function(require,module,exports){ "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; -},{"gl-matrix":21}],216:[function(require,module,exports){ -"use strict";function drawCircles(e,r,i,a){if(a.buffers){i=e.translateMatrix(i,a,r.paint["circle-translate"],r.paint["circle-translate-anchor"]);var t=a.elementGroups[r.ref||r.id];if(t){var l=e.gl;l.disable(l.STENCIL_TEST),l.switchShader(e.circleShader,i,a.exMatrix);var c=a.buffers.circleVertex,n=e.circleShader,s=a.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;o0&&(u=i.paint["line-gap-width"]/2+.5*o,l=i.paint["line-width"],m=u-o/2);var _=m+l+o/2+s,h=i.paint["line-color"],d=t.transform.scale/(1<0&&(u=i.paint["line-gap-width"]/2+.5*o,f=i.paint["line-width"],m=u-o/2);var _=m+f+o/2+s,h=i.paint["line-color"],d=t.transform.scale/(1<0?1/(1-t):1+t}function saturationFactor(t){return t>0?1-1/(1.001-t):-t}function getOpacities(t,r,e,a){if(!t.source)return[1,0];var i=(new Date).getTime(),o=e.paint["raster-fade-duration"],n=(i-t.timeAdded)/o,u=r?(i-r.timeAdded)/o:-1,s=t.source._pyramid.coveringZoomLevel(a),c=r?Math.abs(r.coord.z-s)>Math.abs(t.coord.z-s):!1,f=[];!r||c?(f[0]=util.clamp(n,0,1),f[1]=1-f[0]):(f[0]=util.clamp(1-u,0,1),f[1]=1-f[0]);var d=e.paint["raster-opacity"];return f[0]*=d,f[1]*=d,f}var util=require("../util/util");module.exports=drawRaster; +},{"../util/browser":293,"gl-matrix":49}],230:[function(require,module,exports){ +"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; -},{"../util/util":296}],222:[function(require,module,exports){ -"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.text.groups.length&&drawSymbol(e,t,r,a,o.text,"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,f,u,s=e.transform,d="map"===t.layout[i+"-rotation-alignment"],h=d;h?(m=mat4.create(),f=a.tileExtent/a.tileSize/Math.pow(2,e.transform.zoom-a.coord.z),u=1/Math.cos(s._pitch)):(m=mat4.clone(a.exMatrix),f=e.transform.altitude,u=1),mat4.scale(m,m,[f,f,1]);var p=t.paint[i+"-size"],g=p/defaultSizes[i];mat4.scale(m,m,[g,g,1]);var S,c,x,b,v=Math.sqrt(s.height*s.height/4*(1+s.altitude*s.altitude)),_=s.height/2*Math.tan(s._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,x=a.buffers.glyphElement,b=[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,x=a.buffers.iconElement,b=[e.spriteAtlas.width/4,e.spriteAtlas.height/4]),l.switchShader(S,r,m),l.uniform1i(S.u_texture,0),l.uniform2fv(S.u_texsize,b),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,N,M;if(x.bind(l),n){var A=8,L=1.19,R=6,G=.105*defaultSizes[i]/p/browser.devicePixelRatio;l.uniform1f(S.u_gamma,G*u),l.uniform4fv(S.u_color,t.paint[i+"-color"]),l.uniform1f(S.u_buffer,.75);for(var D=0;D3&&this.frameHistory[1].time+tr&&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})}; -},{}],225:[function(require,module,exports){ +},{}],234:[function(require,module,exports){ "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;athis.height)return console.warn("LineAtlas out of space"),null;for(var a=0,r=0;r=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;pu;)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=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<0?e.pop():null}; -},{"../util/browser":285,"./draw_background":215,"./draw_circle":216,"./draw_debug":218,"./draw_fill":219,"./draw_line":220,"./draw_raster":221,"./draw_symbol":222,"./draw_vertices":223,"./frame_history":224,"./gl_util":225,"gl-matrix":21}],228:[function(require,module,exports){ -"use strict";var glify=void 0;module.exports={debug:{vertex:"precision mediump float;attribute vec2 a_pos;uniform mat4 u_matrix;void main(){gl_Position=u_matrix*vec4(a_pos,step(32767.,a_pos.x),1);}",fragment:"precision mediump float;uniform vec4 u_color;void main(){gl_FragColor=u_color;}"},dot:{vertex:"precision mediump float;uniform mat4 u_matrix;uniform float u_size;attribute vec2 a_pos;void main(){gl_Position=u_matrix*vec4(a_pos,0,1);gl_PointSize=u_size;}",fragment:"precision mediump float;uniform vec4 u_color;uniform float u_blur;void main(){float a,b;a=length(gl_PointCoord-.5);b=smoothstep(.5,.5-u_blur,a);gl_FragColor=u_color*b;}"},fill:{vertex:"precision mediump float;attribute vec2 a_pos;uniform mat4 u_matrix;void main(){gl_Position=u_matrix*vec4(a_pos,0,1);}",fragment:"precision mediump float;uniform vec4 u_color;void main(){gl_FragColor=u_color;}"},circle:{vertex:"precision mediump float;uniform float u_size;attribute vec2 a_pos;uniform mat4 u_matrix,u_exmatrix;varying vec2 a;void main(){a=vec2(mod(a_pos,2.)*2.-1.);vec4 b=u_exmatrix*vec4(a*u_size,0,0);gl_Position=u_matrix*vec4(floor(a_pos*.5),0,1);gl_Position+=b*gl_Position.w;}",fragment:"precision mediump float;uniform vec4 u_color;uniform float u_blur,u_size;varying vec2 a;void main(){float b=smoothstep(1.-u_blur,1.,length(a));gl_FragColor=u_color*(1.-b);}"},line:{vertex:"precision mediump float;attribute vec2 a_pos;attribute vec4 a_data;uniform highp mat4 u_matrix;uniform float u_ratio,u_extra;uniform vec2 u_linewidth;uniform mat2 u_antialiasingmatrix;varying vec2 a;varying float b,c;void main(){vec2 d,e;d=a_data.xy;e=mod(a_pos,2.);e.y=sign(e.y-.5);a=e;vec4 f=vec4(u_linewidth.s*d*.015873016,0,0);gl_Position=u_matrix*vec4(floor(a_pos*.5)+f.xy/u_ratio,0,1);float g,h,i;g=gl_Position.y/gl_Position.w;h=length(d)/length(u_antialiasingmatrix*d);i=1./(1.-min(g*u_extra,.9));c=i*h;}",fragment:"precision mediump float;uniform vec2 u_linewidth;uniform vec4 u_color;uniform float u_blur;varying vec2 a;varying float b,c;void main(){float d,e,f;d=length(a)*u_linewidth.s;e=u_blur*c;f=clamp(min(d-(u_linewidth.t-e),u_linewidth.s-d)/e,0.,1.);gl_FragColor=u_color*f;}"},linepattern:{vertex:"precision mediump float;attribute vec2 a_pos;attribute vec4 a_data;uniform highp mat4 u_matrix;uniform float u_ratio,u_extra;uniform vec2 u_linewidth;uniform vec4 u_color;uniform mat2 u_antialiasingmatrix;varying vec2 a;varying float b,c;void main(){vec2 d,f,g,h;d=a_data.xy;float e,i,j,k;e=a_data.z*128.+a_data.w;f=mod(a_pos,2.);f.y=sign(f.y-.5);a=f;g=d*.015873016;h=u_linewidth.s*g;gl_Position=u_matrix*vec4(floor(a_pos*.5)+h.xy/u_ratio,0,1);b=e;i=gl_Position.y/gl_Position.w;j=length(d)/length(u_antialiasingmatrix*d);k=1./(1.-min(i*u_extra,.9));c=k*j;}",fragment:"precision mediump float;uniform vec2 u_linewidth,u_pattern_size_a,u_pattern_size_b,u_pattern_tl_a,u_pattern_br_a,u_pattern_tl_b,u_pattern_br_b;uniform float u_point,u_blur,u_fade,u_opacity;uniform sampler2D u_image;varying vec2 a;varying float b,c;void main(){float d,e,f,g,h,i,j;d=length(a)*u_linewidth.s;e=u_blur*c;f=clamp(min(d-(u_linewidth.t-e),u_linewidth.s-d)/e,0.,1.);g=mod(b/u_pattern_size_a.x,1.);h=mod(b/u_pattern_size_b.x,1.);i=.5+a.y*u_linewidth.s/u_pattern_size_a.y;j=.5+a.y*u_linewidth.s/u_pattern_size_b.y;vec2 k,l;k=mix(u_pattern_tl_a,u_pattern_br_a,vec2(g,i));l=mix(u_pattern_tl_b,u_pattern_br_b,vec2(h,j));vec4 m=mix(texture2D(u_image,k),texture2D(u_image,l),u_fade);f*=u_opacity;gl_FragColor=m*f;}"},linesdfpattern:{vertex:"precision mediump float;attribute vec2 a_pos;attribute vec4 a_data;uniform highp mat4 u_matrix;uniform vec2 u_linewidth,u_patternscale_a,u_patternscale_b;uniform float u_ratio,u_tex_y_a,u_tex_y_b,u_extra;uniform mat2 u_antialiasingmatrix;varying vec2 a,b,c;varying float d;void main(){vec2 e,g;e=a_data.xy;float f,i,j,k;f=a_data.z*128.+a_data.w;g=mod(a_pos,2.);g.y=sign(g.y-.5);a=g;vec4 h=vec4(u_linewidth.s*e*.015873016,0,0);gl_Position=u_matrix*vec4(floor(a_pos*.5)+h.xy/u_ratio,0,1);b=vec2(f*u_patternscale_a.x,g.y*u_patternscale_a.y+u_tex_y_a);c=vec2(f*u_patternscale_b.x,g.y*u_patternscale_b.y+u_tex_y_b);i=gl_Position.y/gl_Position.w;j=length(e)/length(u_antialiasingmatrix*e);k=1./(1.-min(i*u_extra,.9));d=k*j;}",fragment:"precision mediump float;uniform vec2 u_linewidth;uniform vec4 u_color;uniform float u_blur,u_sdfgamma,u_mix;uniform sampler2D u_image;varying vec2 a,b,c;varying float d;void main(){float e,f,g,h,i,j;e=length(a)*u_linewidth.s;f=u_blur*d;g=clamp(min(e-(u_linewidth.t-f),u_linewidth.s-e)/f,0.,1.);h=texture2D(u_image,b).a;i=texture2D(u_image,c).a;j=mix(h,i,u_mix);g*=smoothstep(.5-u_sdfgamma,.5+u_sdfgamma,j);gl_FragColor=u_color*g;}"},outline:{vertex:"precision mediump float;attribute vec2 a_pos;uniform highp mat4 u_matrix;uniform vec2 u_world;varying vec2 a;void main(){gl_Position=u_matrix*vec4(a_pos,0,1);a=(gl_Position.xy/gl_Position.w+1.)/2.*u_world;}",fragment:"precision mediump float;uniform vec4 u_color;varying vec2 a;void main(){float b,c;b=length(a-gl_FragCoord.xy);c=smoothstep(1.,0.,b);gl_FragColor=u_color*c;}"},pattern:{vertex:"precision mediump float;uniform mat4 u_matrix;uniform mat3 u_patternmatrix_a,u_patternmatrix_b;attribute vec2 a_pos;varying vec2 a,b;void main(){gl_Position=u_matrix*vec4(a_pos,0,1);a=(u_patternmatrix_a*vec3(a_pos,1)).xy;b=(u_patternmatrix_b*vec3(a_pos,1)).xy;}",fragment:"precision mediump float;uniform float u_opacity,u_mix;uniform vec2 u_pattern_tl_a,u_pattern_br_a,u_pattern_tl_b,u_pattern_br_b;uniform sampler2D u_image;varying vec2 a,b;void main(){vec2 c,d,f,g;c=mod(a,1.);d=mix(u_pattern_tl_a,u_pattern_br_a,c);vec4 e,h;e=texture2D(u_image,d);f=mod(b,1.);g=mix(u_pattern_tl_b,u_pattern_br_b,f);h=texture2D(u_image,g);gl_FragColor=mix(e,h,u_mix)*u_opacity;}"},raster:{vertex:"precision mediump float;uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent,u_buffer_scale;attribute vec2 a_pos,a_texture_pos;varying vec2 a,b;void main(){gl_Position=u_matrix*vec4(a_pos,0,1);a=(a_texture_pos/32767.-.5)/u_buffer_scale+.5;b=a*u_scale_parent+u_tl_parent;}",fragment:"precision mediump float;uniform float u_opacity0,u_opacity1,u_brightness_low,u_brightness_high,u_saturation_factor,u_contrast_factor;uniform sampler2D u_image0,u_image1;varying vec2 a,b;uniform vec3 u_spin_weights;void main(){vec4 c,d,e;c=texture2D(u_image0,a);d=texture2D(u_image1,b);e=c*u_opacity0+d*u_opacity1;vec3 f,h,i;f=e.rgb;f=vec3(dot(f,u_spin_weights.xyz),dot(f,u_spin_weights.zxy),dot(f,u_spin_weights.yzx));float g=(e.r+e.g+e.b)/3.;f+=(g-f)*u_saturation_factor;f=(f-.5)*u_contrast_factor+.5;h=vec3(u_brightness_low);i=vec3(u_brightness_high);gl_FragColor=vec4(mix(h,i,f),e.a);}"},icon:{vertex:"precision mediump float;attribute vec2 a_pos,a_offset;attribute vec4 a_data1,a_data2;uniform highp mat4 u_matrix;uniform mat4 u_exmatrix;uniform float u_zoom,u_fadedist,u_minfadezoom,u_maxfadezoom,u_fadezoom,u_opacity,u_extra;uniform bool u_skewed;uniform vec2 u_texsize;varying vec2 a;varying float b;void main(){vec2 c,e;c=a_data1.xy;float d,f,g,h,i,j;d=a_data1[2];e=a_data2.st;f=e[0];g=e[1];h=10.;i=2.-step(f,u_zoom)-(1.-step(g,u_zoom));j=clamp((u_fadezoom-d)/u_fadedist,0.,1.);if(u_fadedist>=0.)b=j;else b=1.-j;if(u_maxfadezoom=d)b=1.;i+=step(b,0.);if(u_skewed){vec4 k=u_exmatrix*vec4(a_offset/64.,0,0);gl_Position=u_matrix*vec4(a_pos+k.xy,0,1);gl_Position.z+=i*gl_Position.w;}else{vec4 k=u_exmatrix*vec4(a_offset/64.,i,0);gl_Position=u_matrix*vec4(a_pos,0,1)+k;}a=c/u_texsize;b*=u_opacity;}",fragment:"precision mediump float;uniform sampler2D u_texture;varying vec2 a;varying float b;void main(){gl_FragColor=texture2D(u_texture,a)*b;}"},sdf:{vertex:"precision mediump float;attribute vec2 a_pos,a_offset;attribute vec4 a_data1,a_data2;uniform highp mat4 u_matrix;uniform mat4 u_exmatrix;uniform float u_zoom,u_fadedist,u_minfadezoom,u_maxfadezoom,u_fadezoom,u_extra;uniform bool u_skewed;uniform vec2 u_texsize;varying vec2 a;varying float b,c;void main(){vec2 d,f;d=a_data1.xy;float e,g,h,i,j,k,l;e=a_data1[2];f=a_data2.st;g=f[0];h=f[1];i=2.-step(g,u_zoom)-(1.-step(h,u_zoom));j=clamp((u_fadezoom-e)/u_fadedist,0.,1.);if(u_fadedist>=0.)b=j;else b=1.-j;if(u_maxfadezoom=e)b=1.;i+=step(b,0.);if(u_skewed){vec4 k=u_exmatrix*vec4(a_offset/64.,0,0);gl_Position=u_matrix*vec4(a_pos+k.xy,0,1);gl_Position.z+=i*gl_Position.w;}else{vec4 k=u_exmatrix*vec4(a_offset/64.,i,0);gl_Position=u_matrix*vec4(a_pos,0,1)+k;}k=gl_Position.y/gl_Position.w;l=1./(1.-k*u_extra);c=l;a=d/u_texsize;}",fragment:"precision mediump float;uniform sampler2D u_texture;uniform vec4 u_color;uniform float u_buffer,u_gamma;varying vec2 a;varying float b,c;void main(){float d,e,f;d=u_gamma*c;e=texture2D(u_texture,a).a;f=smoothstep(u_buffer-d,u_buffer+d,e)*b;gl_FragColor=u_color*f;}"},collisionbox:{vertex:"precision mediump float;attribute vec2 a_pos,a_extrude,a_data;uniform mat4 u_matrix;uniform float u_scale;varying float a,b;void main(){gl_Position=u_matrix*vec4(a_pos+a_extrude/u_scale,0,1);a=a_data.x;b=a_data.y;}",fragment:"precision mediump float;uniform float u_zoom,u_maxzoom;varying float a,b;void main(){float c=.5;gl_FragColor=vec4(0,1,0,1)*c;if(b>u_zoom)gl_FragColor=vec4(1,0,0,1)*c;if(u_zoom>=a)gl_FragColor=vec4(0,0,0,1)*c*.25;if(b>=u_maxzoom)gl_FragColor=vec4(0,0,1,1)*c*.2;}"}}; +},{"../util/browser":293,"./draw_background":224,"./draw_circle":225,"./draw_debug":227,"./draw_fill":228,"./draw_line":229,"./draw_raster":230,"./draw_symbol":231,"./draw_vertices":232,"./frame_history":233,"./gl_util":234,"gl-matrix":49}],237:[function(require,module,exports){ +"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 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 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 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 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;\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\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 // 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) + 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;\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_linesofar = a_data.z * 128.0 + a_data.w;\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 // 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) + 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;\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_linesofar = a_data.z * 128.0 + a_data.w;\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 // 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) + 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 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 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 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"}}; -},{}],229:[function(require,module,exports){ -"use strict";function GeoJSONSource(i){i=i||{},this._data=i.data,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),this.geojsonVtOptions={maxZoom:this.maxzoom},void 0!==i.buffer&&(this.geojsonVtOptions.buffer=i.buffer),void 0!==i.tolerance&&(this.geojsonVtOptions.tolerance=i.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)})}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(i){return this._data=i,this._dirty=!0,this.fire("change"),this.map&&this.update(this.map.transform),this},onAdd:function(i){this.map=i},loaded:function(){return this._loaded&&this._pyramid.loaded()},update:function(i){this._dirty&&this._updateData(),this._loaded&&this._pyramid.update(this.used,i)},reload:function(){this._loaded&&this._pyramid.reload()},render:Source._renderTiles,featuresAt:Source._vectorFeaturesAt,featuresIn:Source._vectorFeaturesIn,_updateData:function(){this._dirty=!1;var i=this._data;"string"==typeof i&&(i=urlResolve(window.location.href,i)),this.workerID=this.dispatcher.send("parse geojson",{data:i,tileSize:512,source:this.id,geojsonVtOptions:this.geojsonVtOptions},function(i){return i?void this.fire("error",{error:i}):(this._loaded=!0,this._pyramid.reload(),void this.fire("change"))}.bind(this))},_loadTile:function(i){var t=i.coord.z>this.maxzoom?Math.pow(2,i.coord.z-this.maxzoom):1,e={uid:i.uid,coord:i.coord,zoom:i.coord.z,maxZoom:this.maxzoom,tileSize:512,source:this.id,overscaling:t,angle:this.map.transform.angle,pitch:this.map.transform.pitch,collisionDebug:this.map.collisionDebug};i.workerID=this.dispatcher.send("load geojson tile",e,function(t,e){if(i.unloadVectorData(this.map.painter),!i.aborted){if(t)return void this.fire("tile.error",{tile:i});i.loadVectorData(e),this.fire("tile.load",{tile:i})}}.bind(this),this.workerID)},_abortTile:function(i){i.aborted=!0},_addTile:function(i){this.fire("tile.add",{tile:i})},_removeTile:function(i){this.fire("tile.remove",{tile:i})},_unloadTile:function(i){i.unloadVectorData(this.map.painter),this.glyphAtlas.removeGlyphs(i.uid),this.dispatcher.send("remove tile",{uid:i.uid,source:this.id},null,i.workerID)}}); +},{"path":307}],238:[function(require,module,exports){ +"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&&(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){return e?void this.fire("error",{error:e}):(this._loaded=!0,this._pyramid.reload(),void 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)}}); -},{"../util/evented":290,"../util/util":296,"./source":233,"./tile_pyramid":236,"resolve-url":479}],230:[function(require,module,exports){ +},{"../util/evented":298,"../util/util":304,"./source":242,"./tile_pyramid":245,"resolve-url":454}],239:[function(require,module,exports){ "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=0),assert(i>=0),assert(r>=0),isNaN(o)&&(o=0),this.z=+t,this.x=+i,this.y=+r,this.w=+o,o*=2,0>o&&(o=-1*o-1);var e=1<i.row){var r=t;t=i,i=r}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,r,o,e){var s=Math.max(r,Math.floor(i.y0)),n=Math.min(o,Math.ceil(i.y1));if(t.x0===i.x0&&t.y0===i.y0?t.x0+i.dy/t.dy*t.dx0,y=i.dx<0,x=s;n>x;x++){var c=a*Math.max(0,Math.min(t.dy,x+l-t.y0))+t.x0,u=d*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,r,o,e,s){var n,h=edge(t,i),a=edge(i,r),d=edge(r,t);h.dy>a.dy&&(n=h,h=a,a=n),h.dy>d.dy&&(n=h,h=d,d=n),a.dy>d.dy&&(n=a,a=d,d=n),h.dy&&scanSpans(d,h,o,e,s),a.dy&&scanSpans(d,a,o,e,s)}var assert=require("assert");module.exports=TileCoord,TileCoord.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},TileCoord.fromID=function(t){var i=t%32,r=1<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,r=2*this.x,o=2*this.y;return[new TileCoord(i,r,o,this.w),new TileCoord(i,r+1,o,this.w),new TileCoord(i,r,o+1,this.w),new TileCoord(i,r+1,o+1,this.w)]},TileCoord.cover=function(t,i,r){function o(t,i,o){var n,h,a;if(o>=0&&e>=o)for(n=t;i>n;n++)h=(n%e+e)%e,a=new TileCoord(r,h,o,Math.floor(n/e)),s[a.id]=a}var e=1<this.maxzoom&&(t=this.maxzoom);var o=i,r=o.locationCoordinate(o.center)._zoomTo(t),n=new Point(r.column-.5,r.row-.5);return TileCoord.cover(t,[o.pointCoordinate(new Point(0,0))._zoomTo(t),o.pointCoordinate(new Point(o.width,0))._zoomTo(t),o.pointCoordinate(new Point(o.width,o.height))._zoomTo(t),o.pointCoordinate(new Point(0,o.height))._zoomTo(t)],this.reparseOverscaled?e:t).sort(function(i,t){return n.dist(i)-n.dist(t)})},findLoadedChildren:function(i,t,e){for(var o=!0,r=i.z,n=i.children(this.maxzoom),s=0;sr&&this.findLoadedChildren(n[s],t,e))}return o},findLoadedParent:function(i,t,e){for(var o=i.z-1;o>=t;o--){i=i.parent(this.maxzoom);var r=this._tiles[i.id];if(r&&r.loaded)return e[i.id]=!0,r}},update:function(i,t,e){var o,r,n,s=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),d=util.clamp(s-10,this.minzoom,this.maxzoom),a=util.clamp(s+1,this.minzoom,this.maxzoom),h={},l=(new Date).getTime();this._coveredTiles={};var m=i?this.coveringTiles(t):[];for(o=0;ol-(e||0)&&(this.findLoadedChildren(r,a,h)?(this._coveredTiles[u]=!0,h[u]=!0):this.findLoadedParent(r,d,h));var c=util.keysDifference(this._tiles,h);for(o=0;othis.maxzoom?Math.pow(2,o-this.maxzoom):1;t=new Tile(e,this.tileSize*r),this._load(t)}return t.uses++,this._tiles[i.id]=t,this._add(t,i),t},removeTile:function(i){var t=this._tiles[i];t&&(t.uses--,delete this._tiles[i],this._remove(t),t.uses>0||(t.loaded?this._cache.add(t.coord.wrapped().id,t):(this._abort(t),this._unload(t))))},clearTiles:function(){for(var i in this._tiles)this.removeTile(i);this._cache.reset()},tileAt:function(i){for(var t=this.orderedIDs(),e=0;e=0&&r.x=0&&r.y=0&&n[1].y>=0&&t.push({tile:r,minX:n[0].x,maxX:n[1].x,minY:n[0].y,maxY:n[1].y})}return t}}; +},{"assert":7}],245:[function(require,module,exports){ +"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)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(ithis.maxzoom&&(i=this.maxzoom);var o=e,r=o.locationCoordinate(o.center)._zoomTo(i),n=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 n.dist(e)-n.dist(i)})},findLoadedChildren:function(e,i,t){var o=!1;for(var r in this._tiles){var n=this._tiles[r];if(!(t[r]||!n.loaded||n.coord.z<=e.z||n.coord.z>i)){var s=Math.pow(2,Math.min(n.coord.z,this.maxzoom)-Math.min(e.z,this.maxzoom));if(Math.floor(n.coord.x/s)===e.x&&Math.floor(n.coord.y/s)===e.y)for(t[r]=!0,o=!0;n&&n.coord.z-1>e.z;){var d=n.coord.parent(this.maxzoom).id;n=this._tiles[d],n&&n.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,n,s=(this.roundZoom?Math.round:Math.floor)(this.getZoom(i)),d=util.clamp(s-10,this.minzoom,this.maxzoom),a=util.clamp(s+3,this.minzoom,this.maxzoom),h={},l=(new Date).getTime();this._coveredTiles={};var m=e?this.coveringTiles(i):[];for(o=0;ol-(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;othis.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=0&&r.x=0&&r.y=0&&n[1].y>=0&&i.push({tile:r,minX:n[0].x,maxX:n[1].x,minY:n[0].y,maxY:n[1].y})}return i}}; -},{"../util/mru_cache":294,"../util/util":296,"./tile":234,"./tile_coord":235,"point-geometry":187}],237:[function(require,module,exports){ -"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");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()},redoPlacement:function(){if(this._pyramid)for(var e=this._pyramid.orderedIDs(),i=0;ithis.maxzoom?Math.pow(2,e.coord.z-this.maxzoom):1,t={url:e.coord.url(this.tiles,this.maxzoom),uid:e.uid,coord:e.coord,zoom:e.coord.z,maxZoom:this.maxzoom,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});e.loadVectorData(t),e.redoWhenDone&&(e.redoWhenDone=!1,this._redoTilePlacement(e)),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)},_redoTilePlacement:function(e){function i(i,t){e.reloadSymbolData(t,this.map.painter),this.fire("tile.load",{tile:e}),e.redoingPlacement=!1,e.redoWhenDone&&(this._redoTilePlacement(e),e.redoWhenDone=!1)}return!e.loaded||e.redoingPlacement?void(e.redoWhenDone=!0):(e.redoingPlacement=!0,void this.dispatcher.send("redo placement",{uid:e.uid,source:this.id,angle:this.map.transform.angle,pitch:this.map.transform.pitch,collisionDebug:this.map.collisionDebug},i.bind(this),e.workerID))}}); +},{"../util/mru_cache":302,"../util/util":304,"./tile":243,"./tile_coord":244,"point-geometry":310}],246:[function(require,module,exports){ +"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");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:e.coord.url(this.tiles,this.maxzoom),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});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)}}); -},{"../util/evented":290,"../util/util":296,"./source":233}],238:[function(require,module,exports){ +},{"../util/evented":298,"../util/util":304,"./source":242}],247:[function(require,module,exports){ "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,[])}}); -},{"../geo/lng_lat":210,"../util/ajax":284,"../util/evented":290,"../util/util":296,"./tile":234,"point-geometry":187}],239:[function(require,module,exports){ +},{"../geo/lng_lat":219,"../util/ajax":292,"../util/evented":298,"../util/util":304,"./tile":243,"point-geometry":310}],248:[function(require,module,exports){ "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],s=a.redoPlacement(e.angle,e.pitch,e.collisionDebug);s.result&&r(null,s.result,s.transferables)}else i&&i[o]&&(i[o].angle=e.angle)},"parse geojson":function(e,r){var t=function(t,i){return t?r(t):(this.geoJSONIndexes[e.source]=geojsonvt(i,e.geojsonVtOptions),void 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,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,[])}}); -},{"../util/actor":283,"../util/ajax":284,"../util/util":296,"./geojson_wrapper":230,"./worker_tile":240,"geojson-vt":16,"pbf":186,"vector-tile":482}],240:[function(require,module,exports){ -"use strict";function WorkerTile(e){this.coord=e.coord,this.uid=e.uid,this.zoom=e.zoom,this.maxZoom=e.maxZoom,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=e.overscaling,this.angle=e.angle,this.pitch=e.pitch,this.collisionDebug=e.collisionDebug,this.stacks={}}var FeatureTree=require("../data/feature_tree"),CollisionTile=require("../symbol/collision_tile"),BufferSet=require("../data/buffer/buffer_set"),createBucket=require("../data/create_bucket");module.exports=WorkerTile,WorkerTile.prototype.parse=function(e,t,r,i){function s(e,t){for(var r=0;r=x)){var y=f.layout.visibility;if("none"!==y)if(c=createBucket(f,h,this.zoom,this.overscaling,this.collisionDebug),c.layers=[f.id],v[c.id]=c,m.push(c),e.layers){var k=f["source-layer"];g[k]||(g[k]={}),g[k][c.id]=c}else g[c.id]=c}}}for(l=0;l=0;l--)c=m[l],c.needsPlacement&&(D?D.next=c:c.previousPlaced=!0,D=c),c.getDependencies&&c.getDependencies(this,r,o(c)),c.needsPlacement||c.getDependencies||n(d,c)},WorkerTile.prototype.redoPlacement=function(e,t,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=e,{};for(var i=new BufferSet,s=[],o={},n=new CollisionTile(e,t),a=this.bucketsInOrder,l=a.length-1;l>=0;l--){var u=a[l];"symbol"===u.type&&(u.placeFeatures(n,i,r),o[u.id]=u.elementGroups)}for(var f in i)s.push(i[f].array);return{result:{elementGroups:o,buffers:i},transferables:s}}; +},{"../util/actor":291,"../util/ajax":292,"../util/util":304,"./geojson_wrapper":239,"./worker_tile":249,"geojson-vt":44,"pbf":309,"vector-tile":459}],249:[function(require,module,exports){ +"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=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=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;a0){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)}}; -},{"../data/buffer/buffer_set":192,"../data/create_bucket":203,"../data/feature_tree":205,"../symbol/collision_tile":258}],241:[function(require,module,exports){ +},{"../data/bucket":210,"../data/feature_tree":214,"../symbol/collision_tile":267}],250:[function(require,module,exports){ "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})}; -},{}],242:[function(require,module,exports){ +},{}],251:[function(require,module,exports){ "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;a1!==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}; -},{"../util/ajax":284,"../util/browser":285,"../util/evented":290,"../util/mapbox":293}],243:[function(require,module,exports){ +},{"../util/ajax":292,"../util/browser":293,"../util/evented":298,"../util/mapbox":301}],252:[function(require,module,exports){ "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}); -},{"./reference":245}],244:[function(require,module,exports){ +},{"./reference":254}],253:[function(require,module,exports){ "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}); -},{"./reference":245,"csscolorparser":9}],245:[function(require,module,exports){ +},{"./reference":254,"csscolorparser":12}],254:[function(require,module,exports){ "use strict";module.exports=require("mapbox-gl-style-spec/reference/latest"); -},{"mapbox-gl-style-spec/reference/latest":178}],246:[function(require,module,exports){ -"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 i=0;iMath.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(i){i.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){var i=[],s=null;t.layer&&(t.layerIds=Array.isArray(t.layer)?t.layer:[t.layer]),util.asyncEach(Object.keys(this.sources),function(r,o){var a=this.sources[r];a.featuresAt(e,t,function(e,t){t&&(i=i.concat(t)),e&&(s=e),o()})}.bind(this),function(){return s?r(s):void r(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))},featuresIn:function(e,t,r){var i=[],s=null;t.layer&&(t.layer={id:t.layer}),util.asyncEach(Object.keys(this.sources),function(r,o){var a=this.sources[r];a.featuresIn(e,t,function(e,t){t&&(i=i.concat(t)),e&&(s=e),o()})}.bind(this),function(){return s?r(s):void r(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,i=this.spriteAtlas;r.loaded()?(i.setSprite(r),i.addIcons(e.icons,t)):r.on("load",function(){i.setSprite(r),i.addIcons(e.icons,t)})},"get glyphs":function(e,t){this.glyphSource.getSimpleGlyphs(e.fontstack,e.codepoints,e.uid,t)}}); +},{"mapbox-gl-style-spec/reference/latest":206}],255:[function(require,module,exports){ +"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;sMath.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){var s=[],i=null;t.layer&&(t.layerIds=Array.isArray(t.layer)?t.layer:[t.layer]),util.asyncEach(Object.keys(this.sources),function(r,o){var a=this.sources[r];a.featuresAt(e,t,function(e,t){t&&(s=s.concat(t)),e&&(i=e),o()})}.bind(this),function(){return i?r(i):void r(null,s.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))},featuresIn:function(e,t,r){var s=[],i=null;t.layer&&(t.layer={id:t.layer}),util.asyncEach(Object.keys(this.sources),function(r,o){var a=this.sources[r];a.featuresIn(e,t,function(e,t){t&&(s=s.concat(t)),e&&(i=e),o()})}.bind(this),function(){return i?r(i):void r(null,s.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)}}); -},{"../render/line_atlas":226,"../symbol/glyph_atlas":260,"../symbol/glyph_source":261,"../symbol/sprite_atlas":267,"../util/ajax":284,"../util/browser":285,"../util/dispatcher":287,"../util/evented":290,"../util/mapbox":293,"../util/util":296,"./animation_loop":241,"./image_sprite":242,"./style_batch":247,"./style_layer":250,"mapbox-gl-style-spec/lib/validate/latest":176}],247:[function(require,module,exports){ -"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._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; +},{"../render/line_atlas":235,"../symbol/glyph_atlas":269,"../symbol/glyph_source":270,"../symbol/sprite_atlas":275,"../util/ajax":292,"../util/browser":293,"../util/dispatcher":295,"../util/evented":298,"../util/mapbox":301,"../util/util":304,"./animation_loop":250,"./image_sprite":251,"./style_batch":256,"./style_layer":259,"mapbox-gl-style-spec/lib/validate/latest":204}],256:[function(require,module,exports){ +"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; -},{"../source/source":233,"./style_layer":250}],248:[function(require,module,exports){ -"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.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={}; +},{"../source/source":242,"./style_layer":259}],257:[function(require,module,exports){ +"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={}; -},{"../util/util":296,"csscolorparser":9,"mapbox-gl-function":175}],249:[function(require,module,exports){ +},{"../util/util":304,"csscolorparser":12,"mapbox-gl-function":203}],258:[function(require,module,exports){ "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)}; -},{"../util/util":296,"./reference":245,"./style_declaration":248}],250:[function(require,module,exports){ +},{"../util/util":304,"./reference":254,"./style_declaration":257}],259:[function(require,module,exports){ "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.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"]))}}; -},{"../util/util":296,"./layout_properties":243,"./paint_properties":244,"./style_declaration_set":249,"./style_transition":251}],251:[function(require,module,exports){ +},{"../util/util":304,"./layout_properties":252,"./paint_properties":253,"./style_declaration_set":258,"./style_transition":260}],260:[function(require,module,exports){ "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(),et?{x:-1,y:-1}:(this.free.splice(t,1),i.we&&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})}; -},{}],254:[function(require,module,exports){ +},{}],263:[function(require,module,exports){ "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; -},{}],255:[function(require,module,exports){ +},{}],264:[function(require,module,exports){ "use strict";function clipLine(x,y,n,e,t){for(var i=[],o=0;o=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; -},{"point-geometry":187}],256:[function(require,module,exports){ +},{"point-geometry":310}],265:[function(require,module,exports){ "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; -},{}],257:[function(require,module,exports){ +},{}],266:[function(require,module,exports){ "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}; -},{"./collision_box":256,"point-geometry":187}],258:[function(require,module,exports){ +},{"./collision_box":265,"point-geometry":310}],267:[function(require,module,exports){ "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;ox.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;ir-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;sc+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; -},{"../symbol/anchor":252,"../util/interpolate":292,"./check_max_angle":254}],260:[function(require,module,exports){ +},{"../symbol/anchor":261,"../util/interpolate":300,"./check_max_angle":263}],269:[function(require,module,exports){ "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;ru;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;e65535)return r("gyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var i=this.loading[t];if(i[e])i[e].push(r);else{i[e]=[r];var l=256*e+"-"+(256*e+255),a=glyphUrl(t,l,this.url);getArrayBuffer(a,function(t,r){for(var l=!t&&new Glyphs(new Protobuf(new Uint8Array(r))),a=0;a65535)return r("gyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var i=this.loading[t];if(i[e])i[e].push(r);else{i[e]=[r];var l=256*e+"-"+(256*e+255),a=glyphUrl(t,l,this.url);getArrayBuffer(a,function(t,r){for(var l=!t&&new Glyphs(new Protobuf(new Uint8Array(r))),a=0;ae&&(o=!o),o&&i++;var h=new Point(a.x,a.y),l=n[i],s=1/0;e=Math.abs(e);for(var m=minScale;;){var u=h.dist(l),c=e/u,g=Math.atan2(l.y-h.y,l.x-h.x);if(o||(g+=Math.PI),r&&(g+=Math.PI),t.push({anchorPoint:h,offset:r?Math.PI:0,minScale:c,maxScale:s,angle:(g+2*Math.PI)%(2*Math.PI)}),m>=c)break;for(h=l;h.equals(l);)if(i+=o?1:-1,l=n[i],!l)return c;var M=l.sub(h)._unit();h=h.sub(M._mult(u)),s=c}return m}var Point=require("point-geometry");module.exports={getIconQuads:getIconQuads,getGlyphQuads:getGlyphQuads};var minScale=.5; - -},{"point-geometry":187}],264:[function(require,module,exports){ -"use strict";function resolveIcons(e,r){for(var o=[],s=0,n=e.length;n>s;s++){var t=resolveTokens(e[s].properties,r["icon-image"]);t&&o.indexOf(t)<0&&o.push(t)}return o}var resolveTokens=require("../util/token");module.exports=resolveIcons; +},{}],272:[function(require,module,exports){ +"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+1e&&(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; -},{"../util/token":295}],265:[function(require,module,exports){ -"use strict";function resolveText(e,r,t){for(var o=[],s=[],n=0,u=e.length;u>n;n++){var a=resolveTokens(e[n].properties,r["text-field"]);if(a){a=a.toString();var l=r["text-transform"];"uppercase"===l?a=a.toLocaleUpperCase():"lowercase"===l&&(a=a.toLocaleLowerCase());for(var i=0,v=a.length;v>i;i++)s.push(a.charCodeAt(i));o[n]=a}else o[n]=null}return s=uniq(s,t),{textFeatures:o,codepoints:s}}function uniq(e,r){var t,o=[];e.sort(sortNumbers);for(var s=0;ss;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;ve&&null!==s){var g=p[s+1].x;c=Math.max(g,c);for(var v=s+1;u>=v;v++)p[v].y+=n,p[v].x-=g;a&&justifyLine(p,i,l,s-1,a),l=s+1,s=null,r+=g,f++}breakable[d.codePoint]&&(s=u)}var x=p[p.length-1],y=x.x+i[x.codePoint].advance;c=Math.max(c,y);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;le&&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=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(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=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=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,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())z?-1:1;B=Math.abs(Math.log(z/b))/l,T=function(){return 0},x=function(t){return Math.exp(j*l*t)}}return t.duration=1e3*B/v,this.zooming=!0,h!==c&&(this.rotating=!0),this.fire("movestart"),this._ease(function(t){var i=t*B,e=T(i);r.zoom=a+r.scaleZoom(1/x(i)),r.center=r.unproject(g.add(d.sub(g).mult(e)),p),c!==h&&(r.bearing=interpolate(h,c,t)),this.fire("move").fire("zoom"),c!==h&&this.fire("rotate")},function(){this.zooming=!1,this.rotating=!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)=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,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())z?-1:1;B=Math.abs(Math.log(z/b))/l,T=function(){return 0},x=function(t){return Math.exp(j*l*t)}}return t.duration=1e3*B/v,this.zooming=!0,h!==c&&(this.rotating=!0),this.fire("movestart"),this._ease(function(t){var i=t*B,e=T(i);r.zoom=a+r.scaleZoom(1/x(i)),r.center=r.unproject(g.add(d.sub(g).mult(e)),p),c!==h&&(r.bearing=interpolate(h,c,t)),this.fire("move").fire("zoom"),c!==h&&this.fire("rotate")},function(){this.zooming=!1,this.rotating=!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)o?-5:o>window.screen.width-2?5:(o-this._prevX)/4;this._map.setBearing(this._map.getBearing()-s),this._prevX=t.screenX,this._moved=!0,t.preventDefault()},_onCompassUp:function(){document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),DOM.enableDrag(),this._moved&&(this._moved=!1,DOM.suppressClick()),this._map.snapToNorth()},_createButton:function(t,o){var s=DOM.create("button",t,this._container);return s.addEventListener("click",function(){o()}),s},_drawNorth:function(){var t=20,o=8,s=26,e=this._map.transform.angle+Math.PI/2,i=this._compassCtx;this._compassCanvas.width=this._compassCanvas.width,i.translate(s,s),i.rotate(e),i.beginPath(),i.fillStyle="#000",i.lineTo(0,-o),i.lineTo(-t,0),i.lineTo(0,o),i.fill(),i.beginPath(),i.fillStyle="#bbb",i.moveTo(0,0),i.lineTo(0,o),i.lineTo(t,0),i.lineTo(0,-o),i.fill(),i.beginPath(),i.strokeStyle="#fff",i.lineWidth=4,i.moveTo(0,-o),i.lineTo(0,o),i.stroke()}}); +},{}],279:[function(require,module,exports){ +"use strict";function Navigation(t){util.setOptions(this,t)}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",s=this._container=DOM.create("div",o+"-group",t.getContainer());return 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(),s},_onCompassDown:function(t){DOM.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._prevX=t.screenX,t.stopPropagation()},_onCompassMove:function(t){var o=t.screenX,s=2>o?-5:o>window.screen.width-2?5:(o-this._prevX)/4;this._map.setBearing(this._map.getBearing()-s),this._prevX=t.screenX,this._moved=!0,t.preventDefault()},_onCompassUp:function(){document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),DOM.enableDrag(),this._moved?(this._moved=!1,DOM.suppressClick()):this._map.setPitch(0),this._map.snapToNorth()},_createButton:function(t,o){var s=DOM.create("button",t,this._container);return s.addEventListener("click",function(){o()}),s},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}}); -},{"../../util/dom":288,"../../util/util":296,"./control":270}],272:[function(require,module,exports){ -"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||1===o.which&&1===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._map.fire("boxzoomstart"));var s=Math.min(e.x,t.x),n=Math.max(e.x,t.x),i=Math.min(e.y,t.y),a=Math.max(e.y,t.y);DOM.setTransform(this._box,"translate("+s+"px,"+i+"px)"),this._box.style.width=n-s+"px",this._box.style.height=a-i+"px"},_onMouseUp:function(o){var e=this._startPos,t=DOM.mousePos(this._el,o),s=new LngLatBounds(this._map.unproject(e),this._map.unproject(t));this._finish(),this._map.fitBounds(s,{linear:!0}).fire("boxzoomend",{boxZoomBounds:s})},_onKeyDown:function(o){27===o.keyCode&&(this._finish(),this._map.fire("boxzoomcancel"))},_finish:function(){this._box&&(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.parentNode.removeChild(this._box),this._box=null,DOM.enableDrag())}}; +},{"../../util/dom":296,"../../util/util":304,"./control":278}],280:[function(require,module,exports){ +"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||1===o.which&&1===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._map.fire("boxzoomstart"));var s=Math.min(e.x,t.x),n=Math.max(e.x,t.x),i=Math.min(e.y,t.y),a=Math.max(e.y,t.y);DOM.setTransform(this._box,"translate("+s+"px,"+i+"px)"),this._box.style.width=n-s+"px",this._box.style.height=a-i+"px"},_onMouseUp:function(o){var e=this._startPos,t=DOM.mousePos(this._el,o),s=new LngLatBounds(this._map.unproject(e),this._map.unproject(t));this._finish(),(e.x!==t.x||e.y!==t.y)&&this._map.fitBounds(s,{linear:!0}).fire("boxzoomend",{boxZoomBounds:s})},_onKeyDown:function(o){27===o.keyCode&&(this._finish(),this._map.fire("boxzoomcancel"))},_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()}}; -},{"../../geo/lng_lat_bounds":211,"../../util/dom":288,"../../util/util":296}],273:[function(require,module,exports){ -"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(Math.round(this._map.getZoom())+1,{around:o.lngLat})}}; +},{"../../geo/lng_lat_bounds":220,"../../util/dom":296,"../../util/util":304}],281:[function(require,module,exports){ +"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(Math.round(this._map.getZoom())+(o.originalEvent.shiftKey?-1:1),{around:o.lngLat})}}; -},{}],274:[function(require,module,exports){ +},{}],282:[function(require,module,exports){ "use strict";function DragPan(e){this._map=e,this._el=e.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,!1),this._el.addEventListener("touchstart",this._onDown,!1)},disable:function(){this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown)},_onDown:function(e){this._startPos=this._pos=DOM.mousePos(this._el,e),this._inertia=[[Date.now(),this._pos]],e.touches?1===e.touches.length&&(document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onTouchEnd,!1)):(document.addEventListener("mousemove",this._onMove,!1),document.addEventListener("mouseup",this._onMouseUp,!1))},_onMove:function(e){var t=this._map;if(!(t.boxZoom.active||t.dragRotate.active||e.touches&&e.touches.length>1)){this.active=!0;var n=DOM.mousePos(this._el,e),i=this._inertia,o=Date.now();for(i.push([o,n]);i.length>2&&o-i[0][0]>50;)i.shift();t.stop(),t.transform.setLocationAtPoint(t.transform.pointLocation(this._pos),n),t.fire("move"),this._pos=n,e.preventDefault()}},_onUp:function(){var e=this._inertia;if(e.length<2)return void this._map.fire("moveend");var t=e[e.length-1],n=e[0],i=t[1].sub(n[1]),o=(t[0]-n[0])/1e3,s=i.mult(inertiaLinearity/o),a=s.mag();a>inertiaMaxSpeed&&(a=inertiaMaxSpeed,s._unit()._mult(a));var r=a/(inertiaDeceleration*inertiaLinearity),u=s.mult(-r/2);this._map.panBy(u,{duration:1e3*r,easing:inertiaEasing,noMoveStart:!0}),this.active=!1},_onMouseUp:function(){this._onUp(),document.removeEventListener("mousemove",this._onMove,!1),document.removeEventListener("mouseup",this._onMouseUp,!1)},_onTouchEnd:function(){this._onUp(),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd)}}; -},{"../../util/dom":288,"../../util/util":296}],275:[function(require,module,exports){ +},{"../../util/dom":296,"../../util/util":304}],283:[function(require,module,exports){ "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,DragRotate.prototype={enable:function(){this._el.addEventListener("contextmenu",this._onContextMenu,!1)},disable:function(){this._el.removeEventListener("contextmenu",this._onContextMenu)},_onContextMenu:function(t){this._map.stop(),this._startPos=this._pos=DOM.mousePos(this._el,t),document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("mouseup",this._onMouseUp,!1),t.preventDefault()},_onMouseMove:function(t){var e=this._startPos,o=this._pos,n=DOM.mousePos(this._el,t),i=this._map,s=i.transform.centerPoint,r=e.sub(s),u=r.mag();this.active=!0,i.rotating||(i.fire("movestart"),i.rotating=!0),200>u&&(s=e.add(new Point(-200,0)._rotate(r.angle())));var a=o.sub(s).angleWith(n.sub(s))/Math.PI*180;i.transform.bearing=i.getBearing()-a,i.fire("move").fire("rotate"),clearTimeout(this._timeout),this._timeout=setTimeout(this._onTimeout,200),this._pos=n},_onTimeout:function(){var t=this._map;t.rotating=!1,t.snapToNorth(),t.rotating||(t._rerender(),t.fire("moveend"))},_onMouseUp:function(){this.active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("mouseup",this._onMouseUp,!1)}}; -},{"../../util/dom":288,"../../util/util":296,"point-geometry":187}],276:[function(require,module,exports){ -"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;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 a=this._map;switch(e.keyCode){case 61:case 107:case 171:case 187:a.zoomTo(Math.round(a.getZoom())+(e.shiftKey?2:1));break;case 189:case 109:case 173:a.zoomTo(Math.round(a.getZoom())-(e.shiftKey?2:1));break;case 37:e.shiftKey?a.setBearing(a.getBearing()-rotateDelta):a.panBy([-panDelta,0]);break;case 39:e.shiftKey?a.setBearing(a.getBearing()+rotateDelta):a.panBy([panDelta,0]);break;case 38:a.panBy([0,-panDelta]);break;case 40:a.panBy([0,panDelta])}}}}; +},{"../../util/dom":296,"../../util/util":304,"point-geometry":310}],284:[function(require,module,exports){ +"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])}}}}; -},{}],277:[function(require,module,exports){ +},{}],285:[function(require,module,exports){ "use strict";function Pinch(t){this._map=t,this._el=t.getCanvasContainer(),util.bindHandlers(this)}var DOM=require("../../util/dom"),util=require("../../util/util");module.exports=Pinch,Pinch.prototype={enable:function(){this._el.addEventListener("touchstart",this._onStart,!1)},disable:function(){this._el.removeEventListener("touchstart",this._onStart)},_onStart:function(t){if(2===t.touches.length){var e=DOM.mousePos(this._el,t.touches[0]),s=DOM.mousePos(this._el,t.touches[1]);this._startVec=e.sub(s),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]),s=DOM.mousePos(this._el,t.touches[1]),n=e.add(s).div(2),o=e.sub(s),i=o.mag()/this._startVec.mag(),a=180*o.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(n)}),t.preventDefault()}},_onEnd:function(){this._map.snapToNorth(),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd)}}; -},{"../../util/dom":288,"../../util/util":296}],278:[function(require,module,exports){ +},{"../../util/dom":296,"../../util/util":304}],286:[function(require,module,exports){ "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)})}}; -},{"../../util/browser":285,"../../util/dom":288,"../../util/util":296}],279:[function(require,module,exports){ +},{"../../util/browser":293,"../../util/dom":296,"../../util/util":304}],287:[function(require,module,exports){ "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)}}; -},{"../util/util":296}],280:[function(require,module,exports){ +},{"../util/util":304}],288:[function(require,module,exports){ "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"),pinch:require("./handler/pinch")},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._startPos=DOM.mousePos(this._el,e)},_onMouseUp:function(e){!this._contextMenuFired||this._map.dragRotate.active||this._map.dragPan.active||this._fireEvent("contextmenu",e),this._contextMenuFired=null},_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.active&&!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(){this._contextMenuFired=!0},_fireEvent:function(e,t){var n=DOM.mousePos(this._el,t);this._map.fire(e,{lngLat:this._map.unproject(n),point:n,originalEvent:t})}}; -},{"../util/dom":288,"../util/util":296,"./handler/box_zoom":272,"./handler/dblclick_zoom":273,"./handler/drag_pan":274,"./handler/drag_rotate":275,"./handler/keyboard":276,"./handler/pinch":277,"./handler/scroll_zoom":278}],281:[function(require,module,exports){ -"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),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,pinch:!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;ithis._map.transform.height-o?["bottom"]:[],t.xthis._map.transform.width-e/2&&i.push("right"),i=0===i.length?"bottom":i.join("-"),this.options.anchor=i}var n={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 n)s.remove("mapboxgl-popup-anchor-"+a);s.add("mapboxgl-popup-anchor-"+i),DOM.setTransform(this._container,n[i]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}}); -},{"../geo/lng_lat":210,"../util/dom":288,"../util/evented":290,"../util/util":296}],283:[function(require,module,exports){ +},{"../geo/lng_lat":219,"../util/dom":296,"../util/evented":298,"../util/util":304}],291:[function(require,module,exports){ "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(""===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:"",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)}}; -},{}],284:[function(require,module,exports){ -"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){e&&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=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=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;te;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=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=2?"@2x.$1":".$1"):e}; -},{"./browser":285,"./config":289}],294:[function(require,module,exports){ +},{"./browser":293,"./config":297}],302:[function(require,module,exports){ "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}; -},{}],295:[function(require,module,exports){ +},{}],303:[function(require,module,exports){ "use strict";function resolveTokens(e,n){return n.replace(/{([^{}()\[\]<>$=:;.,^]+)}/g,function(n,r){return r in e?e[r]:""})}module.exports=resolveTokens; -},{}],296:[function(require,module,exports){ -"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=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/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(){}function h(e){for(var t,n,r=1;rAn error occured:

    "+s(c.message+"",!0)+"
    ";throw c}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=l(p.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,u,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,u=0;c>u;u++)h=i[u],a=h.length,h=h.replace(/^ *([*+-]|\d+\.) +/,""),~h.indexOf("\n ")&&(a-=h.length,h=this.options.pedantic?h.replace(/^ {1,4}/gm,""):h.replace(new RegExp("^ {1,"+a+"}","gm"),"")),this.options.smartLists&&u!==c-1&&(o=p.bullet.exec(i[u+1])[0],l===o||l.length>1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=l(u.link)("inside",u._inside)("href",u._href)(),u.reflink=l(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:l(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:l(u.br)("{2,}","*")(),text:l(u.gfm.text)("{2,}","*")()}),t.rules=u,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;r>s;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:s(e,!0))+"\n
    \n":"
    "+(n?e:s(e,!0))+"\n
    "},n.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var l='
    "},n.prototype.image=function(e,t,n){var r=''+n+'":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",l="";for(n="",e=0;e=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=-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=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;ut&&(t=r.length+t),r.substr(t,e)}; -},{"./map.react":301}],300:[function(require,module,exports){ -"use strict";function mousePos(e,o){var t=e.getBoundingClientRect();return o=o.touches?o.touches[0]:o,new Point(o.clientX-t.left-e.clientLeft,o.clientY-t.top-e.clientTop)}var React=require("react"),MapboxGL=require("mapbox-gl"),Point=MapboxGL.Point,document=require("global/document"),window=require("global/window"),r=require("r-dom"),noop=require("./noop"),ua="undefined"!=typeof window.navigator?window.navigator.userAgent.toLowerCase():"",firefox=-1!==ua.indexOf("firefox"),MapInteractions=React.createClass({displayName:"MapInteractions",PropTypes:{width:React.PropTypes.number.isRequired,height:React.PropTypes.number.isRequired,onMouseDown:React.PropTypes.func,onMouseDrag:React.PropTypes.func,onMouseUp:React.PropTypes.func,onZoom:React.PropTypes.func,onZoomEnd:React.PropTypes.func},getDefaultProps:function(){return{onMouseDown:noop,onMouseDrag:noop,onMouseUp:noop,onZoom:noop,onZoomEnd:noop}},getInitialState:function(){return{startPos:null,pos:null,mouseWheelPos:null}},_getMousePos:function(e){var o=this.refs.container.getDOMNode();return mousePos(o,e)},_onMouseDown:function(e){var o=this._getMousePos(e);this.setState({startPos:o,pos:o}),this.props.onMouseDown({pos:o}),document.addEventListener("mousemove",this._onMouseDrag,!1),document.addEventListener("mouseup",this._onMouseUp,!1)},_onMouseDrag:function(e){var o=this._getMousePos(e);this.setState({pos:o}),this.props.onMouseDrag({pos:o})},_onMouseUp:function(e){document.removeEventListener("mousemove",this._onMouseDrag,!1),document.removeEventListener("mouseup",this._onMouseUp,!1);var o=this._getMousePos(e);this.setState({pos:o}),this.props.onMouseUp({pos:o})},_onMouseMove:function(e){var o=this._getMousePos(e);this.props.onMouseMove({pos:o})},_onWheel:function(e){e.stopPropagation(),e.preventDefault();var o=e.deltaY;firefox&&e.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(o/=window.devicePixelRatio),e.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(o*=40);var t=this.state.mouseWheelType,s=this.state.mouseWheelTimeout,n=this.state.mouseWheelLastValue,i=this.state.mouseWheelTime,u=(window.performance||Date).now(),r=u-(i||0),a=this._getMousePos(e);i=u,0!==o&&o%4.000244140625===0?(t="wheel",o=Math.floor(o/4)):0!==o&&Math.abs(o)<4?t="trackpad":r>400?(t=null,n=o,s=window.setTimeout(function(){var e="wheel";this._zoom(-this.state.mouseWheelLastValue,this.state.mouseWheelPos),this.setState({mouseWheelType:e})}.bind(this),40)):this._type||(t=Math.abs(r*o)<200?"trackpad":"wheel",s&&(window.clearTimeout(s),s=null,o+=n)),e.shiftKey&&o&&(o/=4),t&&this._zoom(-o,a),this.setState({mouseWheelTime:i,mouseWheelPos:a,mouseWheelType:t,mouseWheelTimeout:s,mouseWheelLastValue:n})},_zoom:function(e,o){var t=2/(1+Math.exp(-Math.abs(e/100)));0>e&&0!==t&&(t=1/t),this.props.onZoom({pos:o,scale:t}),window.clearTimeout(this._zoomEndTimeout),this._zoomEndTimeout=window.setTimeout(function(){this.props.onZoomEnd()}.bind(this),200)},render:function(){return r.div({ref:"container",onMouseMove:this._onMouseMove,onMouseDown:this._onMouseDown,onWheel:this._onWheel,style:{width:this.props.width,height:this.props.height,position:"relative"}},this.props.children)}});module.exports=MapInteractions; +}).call(this,require('_process')) +},{"_process":311}],308:[function(require,module,exports){ +"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;no?e+o:o}function unproject(t,e){return t.pointLocation(MapboxGL.Point.convert(e))}function getBBoxFromTransform(t,e,o){return[unproject(t,[0,0]),unproject(t,[e,o])]}function cloneTransform(t){var e=new Transform(t._minZoom,t._maxZoom);return e.latRange=t.latRange,e.width=t.width,e.height=t.height,e.zoom=t.zoom,e.center=t.center,e.angle=t.angle,e.altitude=t.altitude,e.pitch=t.pitch,e}var assert=require("assert"),React=require("react"),debounce=require("debounce"),r=require("r-dom"),d3=require("d3"),noop=require("./noop"),assign=require("object-assign"),Immutable=require("immutable"),MapboxGL=require("mapbox-gl"),LngLatBounds=MapboxGL.LngLatBounds,Point=MapboxGL.Point,Transform=require("mapbox-gl/js/geo/transform"),vec4=require("gl-matrix").vec4,config=require("./config"),MapInteractions=require("./map-interactions.react"),MapGL=React.createClass({displayName:"MapGL",shouldComponentUpdate:function(t,e){var o=Object.keys(t).reduce(function(e,o){var r=t[o]===this.props[o];return e&&r}.bind(this),!0);return o?(o=Object.keys(e).reduce(function(t,o){var r=e[o]===this.state[o];return t&&r}.bind(this),!0),!o):!0},propTypes:{latitude:React.PropTypes.number.isRequired,longitude:React.PropTypes.number.isRequired,zoom:React.PropTypes.number.isRequired,mapStyle:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.instanceOf(Immutable.Map)]),mapboxApiAccessToken:React.PropTypes.string,onChangeViewport:React.PropTypes.func,width:React.PropTypes.number.isRequired,height:React.PropTypes.number.isRequired,isDragging:React.PropTypes.bool,startDragLatLng:React.PropTypes.array,onHoverFeatures:React.PropTypes.func,attributionControl:React.PropTypes.bool,onClickFeatures:React.PropTypes.func},getDefaultProps:function(){return{mapStyle:"mapbox://styles/mapbox/light-v8",onChangeViewport:noop,mapboxApiAccessToken:config.DEFAULTS.MAPBOX_API_ACCESS_TOKEN,attributionControl:!0}},getInitialState:function(){var t={},e=this._updateStateFromProps(t,this.props),o=assign({},t,e);return o},componentWillReceiveProps:function(t){var e=this._updateStateFromProps(this.state,t);this.setState(e)},_updateStateFromProps:function(t,e){var o={latitude:e.latitude,longitude:e.longitude,zoom:e.zoom,width:e.width,height:e.height,mapStyle:e.mapStyle,startLatLng:e.startDragLatLng&&new MapboxGL.LngLat(e.startDragLatLng[1],e.startDragLatLng[0])};return assign(o,{prevLatitude:t.latitude,prevLongitude:t.longitude,prevZoom:t.zoom,prevWidth:t.width,prevHeight:t.height,prevMapStyle:t.mapStyle}),MapboxGL.accessToken=e.mapboxApiAccessToken,o},_onChangeViewport:function(t){var e=this._getMap(),o=this.props.width,r=this.props.height,n=getBBoxFromTransform(e.transform,o,r),i=e.getCenter(),a=this.state.startLatLng,s=assign({latitude:i.lat,longitude:i.lng,zoom:e.getZoom(),bbox:n,isDragging:this.props.isDragging,startDragLatLng:a&&[a.lat,a.lng]},t);s.longitude=mod(s.longitude+180,360)-180,this.props.onChangeViewport(s)},_getMap:function(){return this._map},componentDidMount:function(){var t;t=this.props.mapStyle instanceof Immutable.Map?this.props.mapStyle.toJS():this.props.mapStyle;var e=new MapboxGL.Map({container:this.refs.mapboxMap.getDOMNode(),center:[this.state.longitude,this.state.latitude],zoom:this.state.zoom,style:t,interactive:!1});d3.select(e.getCanvas()).style("outline","none"),this._map=e,this._updateMapViewport(),this._onChangeViewport()},_updateMapViewport:function(){var t=this.state;(t.latitude!==t.prevLatitude||t.longitude!==t.prevLongitude||t.zoom!==t.prevZoom)&&this._getMap().jumpTo({center:[t.longitude,t.latitude],zoom:t.zoom,bearing:0,pitch:0}),(t.width!==t.prevWidth||t.height!==t.prevHeight)&&this._resizeMap()},_resizeMap:debounce(function(){var t=this._getMap();t.resize()},100),_diffSources:function(t,e){var o=t.get("sources"),r=e.get("sources"),n=[],i=[],a=[],s=o.keySeq().toArray(),p=r.keySeq().toArray();return s.forEach(function(t){var e=r.get(t);e?e.equals(o.get(t))||i.push({id:t,source:r.get(t)}):a.push({id:t,source:o.get(t)})}),p.forEach(function(t){var e=o.get(t);e||n.push({id:t,source:r.get(t)})}),{enter:n,update:i,exit:a}},_diffLayers:function(t,e){var o=t.get("layers"),r=e.get("layers"),n=[],i=[],a={},s={};return r.forEach(function(t,e){var o=t.get("id"),n=r.get(e+1);s[o]={layer:t,id:o,before:n?n.get("id"):null,enter:!0}}),o.forEach(function(t,e){var r=t.get("id"),n=o.get(e+1);a[r]={layer:t,id:r,before:n?n.get("id"):null},s[r]?s[r].enter=!1:i.push(a[r])}),r.reverse().forEach(function(t){var e=t.get("id");a[e]&&a[e].layer.equals(s[e].layer)&&a[e].before===s[e].before||n.push(s[e])}),{updates:n,exiting:i}},_setDiffStyle:function(t,e){function o(t){return t.map(function(){return!0})["delete"]("layers")["delete"]("sources").toJS()}function r(){var o=Object.keys(i),r=Object.keys(a);return o.length!==r.length?!0:r.some(function(o){return t.get(o)!==e.get(o)})?!0:!1}var n=this._getMap(),i=t&&o(t)||{},a=o(e);if(!t||r())return void n.setStyle(e.toJS());var s=this._diffSources(t,e),p=this._diffLayers(t,e);return p.updates.some(function(t){return t.layer.get("ref")})?void n.setStyle(e.toJS()):void n.batch(function(){s.enter.forEach(function(t){n.addSource(t.id,t.source.toJS())}),s.update.forEach(function(t){n.removeSource(t.id),n.addSource(t.id,t.source.toJS())}),s.exit.forEach(function(t){n.removeSource(t.id)}),p.exiting.forEach(function(t){n.style.getLayer(t.id)&&n.removeLayer(t.id)}),p.updates.forEach(function(t){t.enter||n.removeLayer(t.id),n.addLayer(t.layer.toJS(),t.before)})})},_updateMapStyle:function(){var t=this.state.mapStyle;t!==this.state.prevMapStyle&&(t instanceof Immutable.Map?this._setDiffStyle(this.state.prevMapStyle,t):this._getMap().setStyle(t))},componentDidUpdate:function(){this._updateMapViewport(),this._updateMapStyle()},_onMouseDown:function(t){var e=this._getMap(),o=unproject(e.transform,t.pos);this._onChangeViewport({isDragging:!0,startDragLatLng:[o.lat,o.lng]})},_onMouseDrag:function(t){var e=t.pos,o=this._getMap(),r=this.props.width,n=this.props.height,i=cloneTransform(o.transform);assert(this.state.startLatLng,"`startDragLatLng` prop is required for mouse drag behavior."),i.setLocationAtPoint(this.state.startLatLng,e);var a=getBBoxFromTransform(i,r,n);this._onChangeViewport({latitude:i.center.lat,longitude:i.center.lng,zoom:i.zoom,bbox:a,isDragging:!0})},_onMouseMove:function(t){var e=this._getMap(),o=t.pos;this.props.onHoverFeatures&&e.featuresAt([o.x,o.y],{},function(t,e){if(t)throw t;e.length&&this.props.onHoverFeatures(e)}.bind(this))},_onMouseUp:function(t){var e=this._getMap(),o=this.props.width,r=this.props.height,n=cloneTransform(e.transform);if(this._onChangeViewport({latitude:n.center.lat,longitude:n.center.lng,zoom:n.zoom,isDragging:!1,bbox:getBBoxFromTransform(n,o,r)}),this.props.onClickFeatures){var i=t.pos;e.featuresAt([i.x,i.y],{radius:15},function(t,e){if(t)throw t;e.length&&this.props.onClickFeatures(e)}.bind(this))}},_onZoom:function(t){var e=this._getMap(),o=this.props,r=cloneTransform(e.transform),n=unproject(r,t.pos);r.zoom=r.scaleZoom(e.transform.scale*t.scale),r.setLocationAtPoint(n,t.pos),this._onChangeViewport({latitude:r.center.lat,longitude:r.center.lng,zoom:r.zoom,isDragging:!0,bbox:getBBoxFromTransform(r,o.width,o.height)})},_onZoomEnd:function(){this._onChangeViewport({isDragging:!1})},_renderOverlays:function(t){function e(t){var e=s,o=vec4.transformMat4([],[t.column,t.row,0,1],e);return new Point(o[0]/o[3],o[1]/o[3])}function o(o){return e(t.locationCoordinate(o))}function n(t){return o(new MapboxGL.LngLat(t[1],t[0]))}var i=[],a=t.tileZoom,s=t.coordinatePointMatrix(a);return React.Children.forEach(this.props.children,function(e){e&&i.push(React.cloneElement(e,{width:this.props.width,height:this.props.height,isDragging:this.props.isDragging,project:n,unproject:unproject.bind(null,t)}))},this),r.div({className:"overlays",style:{position:"absolute",left:0,top:0}},i)},render:function(){var t=this.props,e=assign({},t.style,{width:t.width,height:t.height,cursor:this.props.isDragging?config.CURSOR.GRABBING:config.CURSOR.GRAB}),o=new Transform;return o.width=t.width,o.height=t.height,o.zoom=this.props.zoom,o.center.lat=this.props.latitude,o.center.lng=this.props.longitude,r.div({style:assign({},this.props.style,{width:this.props.width,height:this.props.height})},[r(MapInteractions,{onMouseDown:this._onMouseDown,onMouseDrag:this._onMouseDrag,onMouseUp:this._onMouseUp,onMouseMove:this._onMouseMove,onZoom:this._onZoom,onZoomEnd:this._onZoomEnd,width:this.props.width,height:this.props.height},[r.div({ref:"mapboxMap",style:e,className:t.className}),this._renderOverlays(o)])])}});MapGL.fitBounds=function(t,e,o,r){var n=new LngLatBounds([o[0].reverse(),o[1].reverse()]);r=r||{};var i="undefined"==typeof r.padding?0:r.padding,a=Point.convert([0,0]),s=new Transform;s.width=t,s.height=e;var p=s.project(n.getNorthWest()),u=s.project(n.getSouthEast()),h=u.sub(p),g=(s.width-2*i-2*Math.abs(a.x))/h.x,c=(s.height-2*i-2*Math.abs(a.y))/h.y,d=s.unproject(p.add(u).div(2)),l=s.scaleZoom(s.scale*Math.min(g,c));return{latitude:d.lat,longitude:d.lng,zoom:l}},module.exports=MapGL; +},{"ieee754":200}],309:[function(require,module,exports){ +(function (global){ +"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>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.pos127;);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=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))}}; -},{"./config":298,"./map-interactions.react":300,"./noop":302,"assert":495,"d3":10,"debounce":11,"gl-matrix":21,"immutable":173,"mapbox-gl":214,"mapbox-gl/js/geo/transform":212,"object-assign":297,"r-dom":188,"react":478}],302:[function(require,module,exports){ -"use strict";module.exports=function(){}; +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./buffer":308}],310:[function(require,module,exports){ +"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}; -},{}],303:[function(require,module,exports){ -"use strict";var assign=require("object-assign"),React=require("react"),Immutable=require("immutable"),r=require("r-dom"),transform=require("svg-transform"),document=require("global/document"),nop=require("nop"),config=require("../config"),mouse=require("../utils").relativeMousePosition,DraggablePointsOverlay=React.createClass({displayName:"DraggablePointsOverlay",PropTypes:{width:React.PropTypes.number.isRequired,height:React.PropTypes.number.isRequired,points:React.PropTypes.instanceOf(Immutable.List),project:React.PropTypes.func.isRequired,unproject:React.PropTypes.func.isRequired,isDragging:React.PropTypes.bool,keyAccessor:React.PropTypes.func,locationAccessor:React.PropTypes.func,onAddPoint:React.PropTypes.func,onUpdatePoint:React.PropTypes.func,renderPoint:React.PropTypes.func},getDefaultProps:function(){return{keyAccessor:function(e){return e.get("id")},locationAccessor:function(e){return e.get("location").toArray()},onAddPoint:nop,onUpdatePoint:nop,renderPoint:nop,isDragging:!1}},getInitialState:function(){return{draggedPointKey:null}},_onDragStart:function(e,t){t.stopPropagation(),document.addEventListener("mousemove",this._onDrag,!1),document.addEventListener("mouseup",this._onDragEnd,!1),this.setState({draggedPointKey:this.props.keyAccessor(e)})},_onDrag:function(e){e.stopPropagation();var t=mouse(this.refs.container.getDOMNode(),e),o=this.props.unproject(t);this.props.onUpdatePoint({key:this.state.draggedPointKey,location:[o.lat,o.lng]})},_onDragEnd:function(e){e.stopPropagation(),document.removeEventListener("mousemove",this._onDrag,!1),document.removeEventListener("mouseup",this._onDragEnd,!1),this.setState({draggedPoint:null})},_addPoint:function(e){e.stopPropagation(),e.preventDefault();var t=mouse(this.refs.container.getDOMNode(),e),o=this.props.unproject(t);this.props.onAddPoint([o.lat,o.lng])},render:function(){var e=this.props.points;return r.svg({ref:"container",width:this.props.width,height:this.props.height,style:assign({pointerEvents:"all",position:"absolute",left:0,top:0,cursor:this.props.isDragging?config.CURSOR.GRABBING:config.CURSOR.GRAB},this.props.style),onContextMenu:this._addPoint},[r.g({style:{cursor:"pointer"}},e.map(function(e,t){var o=this.props.project(this.props.locationAccessor(e)),n=[o.x,o.y];return r.g({key:t,transform:transform([{translate:n}]),onMouseDown:this._onDragStart.bind(this,e),style:{pointerEvents:"all"}},this.props.renderPoint.call(this,e,n))},this))])}});module.exports=DraggablePointsOverlay; +},{}],311:[function(require,module,exports){ +function 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=[];++queueIndex1)for(var r=1;r=0&&a[0]-i=0&&a[1]-is;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 f(t,i){return t[0]<=i[0]&&t[1]<=i[1]&&i[2]<=t[2]&&i[3]<=t[3]}function c(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,f,c,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)),f=Math.min(n,Math.floor(e+(r-o)*s/r+l)),x(t,u,f,e,h)),c=t[e],o=i,d=n,p(t,i,e),h(t[n],c)>0&&p(t,i,n);d>o;){for(p(t,o,d),o++,d--;h(t[o],c)<0;)o++;for(;h(t[d],c)>0;)d--}0===h(t[i],c)?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(!c(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,c(t,a)&&(i.leaf?n.push(o):f(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(!c(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,c(t,o)){if(i.leaf||f(t,o))return!0;a.push(r)}i=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.lengthi;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=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,leaf:!1};var s,l,u,f,c=Math.ceil(o/a),x=c*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,c,this.compareMinY),l=s;u>=l;l+=c)f=Math.min(l+c-1,u),r.children.push(this._build(t,l,f,h-1));return i(r,this.toBBox),r},_chooseSubtree:function(t,i,n,e){for(var h,r,o,s,u,f,c,d;;){if(e.push(i),i.leaf||e.length-1===n)break;for(c=d=1/0,h=0,r=i.children.length;r>h;h++)o=i.children[h],u=a(o.bbox),f=l(t,o.bbox)-u,d>f?(d=f,c=c>u?u:c,s=o):f===d&&c>u&&(c=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,bbox:null,leaf:!1};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,bbox:null,leaf:!1},i(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,e){var h,r,o,s,l,f,c,d;for(f=c=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),f>s?(f=s,d=h,c=c>l?l:c):s===f&&c>l&&(c=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),f=n(t,e-i,e,l),c=s(u)+s(f);for(o=i;e-i>o;o++)a=t.children[o],h(u,t.leaf?l(a):a.bbox),c+=s(u);for(o=e-i-1;o>=i;o--)a=t.children[o],h(f,t.leaf?l(a):a.bbox),c+=s(f);return c},_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}(); -},{}],306:[function(require,module,exports){ -module.exports=require("./lib/ReactWithAddons"); +},{}],314:[function(require,module,exports){ +module.exports=require("react/lib/ReactComponentWithPureRenderMixin"); -},{"./lib/ReactWithAddons":406}],307:[function(require,module,exports){ -"use strict";var focusNode=require("./focusNode"),AutoFocusMixin={componentDidMount:function(){this.props.autoFocus&&focusNode(this.getDOMNode())}};module.exports=AutoFocusMixin; +},{"react/lib/ReactComponentWithPureRenderMixin":355}],315:[function(require,module,exports){ +"use strict";module.exports=require("react/lib/ReactDOM"); -},{"./focusNode":440}],308:[function(require,module,exports){ -"use strict";function isPresto(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function isKeypressCommand(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function getCompositionEventType(e){switch(e){case topLevelTypes.topCompositionStart:return eventTypes.compositionStart;case topLevelTypes.topCompositionEnd:return eventTypes.compositionEnd;case topLevelTypes.topCompositionUpdate:return eventTypes.compositionUpdate}}function isFallbackCompositionStart(e,t){return e===topLevelTypes.topKeyDown&&t.keyCode===START_KEYCODE}function isFallbackCompositionEnd(e,t){switch(e){case topLevelTypes.topKeyUp:return-1!==END_KEYCODES.indexOf(t.keyCode);case topLevelTypes.topKeyDown:return t.keyCode!==START_KEYCODE;case topLevelTypes.topKeyPress:case topLevelTypes.topMouseDown:case topLevelTypes.topBlur:return!0;default:return!1}}function getDataFromCustomEvent(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function extractCompositionEvent(e,t,o,n){var p,s;if(canUseCompositionEvent?p=getCompositionEventType(e):currentComposition?isFallbackCompositionEnd(e,n)&&(p=eventTypes.compositionEnd):isFallbackCompositionStart(e,n)&&(p=eventTypes.compositionStart),!p)return null;useFallbackCompositionData&&(currentComposition||p!==eventTypes.compositionStart?p===eventTypes.compositionEnd&¤tComposition&&(s=currentComposition.getData()):currentComposition=FallbackCompositionState.getPooled(t));var i=SyntheticCompositionEvent.getPooled(p,o,n);if(s)i.data=s;else{var r=getDataFromCustomEvent(n);null!==r&&(i.data=r)}return EventPropagators.accumulateTwoPhaseDispatches(i),i}function getNativeBeforeInputChars(e,t){switch(e){case topLevelTypes.topCompositionEnd:return getDataFromCustomEvent(t);case topLevelTypes.topKeyPress:var o=t.which;return o!==SPACEBAR_CODE?null:(hasSpaceKeypress=!0,SPACEBAR_CHAR);case topLevelTypes.topTextInput:var n=t.data;return n===SPACEBAR_CHAR&&hasSpaceKeypress?null:n;default:return null}}function getFallbackBeforeInputChars(e,t){if(currentComposition){if(e===topLevelTypes.topCompositionEnd||isFallbackCompositionEnd(e,t)){var o=currentComposition.getData();return FallbackCompositionState.release(currentComposition),currentComposition=null,o}return null}switch(e){case topLevelTypes.topPaste:return null;case topLevelTypes.topKeyPress:return t.which&&!isKeypressCommand(t)?String.fromCharCode(t.which):null;case topLevelTypes.topCompositionEnd:return useFallbackCompositionData?null:t.data;default:return null}}function extractBeforeInputEvent(e,t,o,n){var p;if(p=canUseTextInputEvent?getNativeBeforeInputChars(e,n):getFallbackBeforeInputChars(e,n),!p)return null;var s=SyntheticInputEvent.getPooled(eventTypes.beforeInput,o,n);return s.data=p,EventPropagators.accumulateTwoPhaseDispatches(s),s}var EventConstants=require("./EventConstants"),EventPropagators=require("./EventPropagators"),ExecutionEnvironment=require("./ExecutionEnvironment"),FallbackCompositionState=require("./FallbackCompositionState"),SyntheticCompositionEvent=require("./SyntheticCompositionEvent"),SyntheticInputEvent=require("./SyntheticInputEvent"),keyOf=require("./keyOf"),END_KEYCODES=[9,13,27,32],START_KEYCODE=229,canUseCompositionEvent=ExecutionEnvironment.canUseDOM&&"CompositionEvent"in window,documentMode=null;ExecutionEnvironment.canUseDOM&&"documentMode"in document&&(documentMode=document.documentMode);var canUseTextInputEvent=ExecutionEnvironment.canUseDOM&&"TextEvent"in window&&!documentMode&&!isPresto(),useFallbackCompositionData=ExecutionEnvironment.canUseDOM&&(!canUseCompositionEvent||documentMode&&documentMode>8&&11>=documentMode),SPACEBAR_CODE=32,SPACEBAR_CHAR=String.fromCharCode(SPACEBAR_CODE),topLevelTypes=EventConstants.topLevelTypes,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]}},hasSpaceKeypress=!1,currentComposition=null,BeforeInputEventPlugin={eventTypes:eventTypes,extractEvents:function(e,t,o,n){return[extractCompositionEvent(e,t,o,n),extractBeforeInputEvent(e,t,o,n)]}};module.exports=BeforeInputEventPlugin; +},{"react/lib/ReactDOM":358}],316:[function(require,module,exports){ +"use strict";function ToObject(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function ownEnumerableKeys(e){var r=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e))),r.filter(function(r){return propIsEnumerable.call(e,r)})}var propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=Object.assign||function(e,r){for(var t,n,o=ToObject(e),c=1;c-1}};module.exports=CSSCore; +},{}],317:[function(require,module,exports){ +"use strict";var browser=require("bowser").browser,prefix=browser.webkit?"-webkit-":browser.gecko?"-moz-":"",config={DEFAULTS:{},MAPBOX_API_ACCESS_TOKEN:null,CURSOR:{GRABBING:prefix+"grabbing",GRAB:prefix+"grab"}};module.exports=config; -}).call(this,require('_process')) -},{"./invariant":456,"_process":498}],310:[function(require,module,exports){ -"use strict";function prefixKey(o,r){return o+r.charAt(0).toUpperCase()+r.substring(1)}var isUnitlessNumber={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0},prefixes=["Webkit","ms","Moz","O"];Object.keys(isUnitlessNumber).forEach(function(o){prefixes.forEach(function(r){isUnitlessNumber[prefixKey(r,o)]=isUnitlessNumber[o]})});var shorthandPropertyExpansions={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},CSSProperty={isUnitlessNumber:isUnitlessNumber,shorthandPropertyExpansions:shorthandPropertyExpansions};module.exports=CSSProperty; +},{"bowser":8}],318:[function(require,module,exports){ +"use strict";module.exports=require("./map.react"); -},{}],311:[function(require,module,exports){ +},{"./map.react":320}],319:[function(require,module,exports){ +"use strict";function mousePos(e,o){var t=e.getBoundingClientRect();return o=o.touches?o.touches[0]:o,new Point(o.clientX-t.left-e.clientLeft,o.clientY-t.top-e.clientTop)}var React=require("react"),MapboxGL=require("mapbox-gl"),Point=MapboxGL.Point,document=require("global/document"),window=require("global/window"),r=require("r-dom"),noop=require("./noop"),ua="undefined"!=typeof window.navigator?window.navigator.userAgent.toLowerCase():"",firefox=-1!==ua.indexOf("firefox"),MapInteractions=React.createClass({displayName:"MapInteractions",PropTypes:{width:React.PropTypes.number.isRequired,height:React.PropTypes.number.isRequired,onMouseDown:React.PropTypes.func,onMouseDrag:React.PropTypes.func,onMouseUp:React.PropTypes.func,onZoom:React.PropTypes.func,onZoomEnd:React.PropTypes.func},getDefaultProps:function(){return{onMouseDown:noop,onMouseDrag:noop,onMouseUp:noop,onZoom:noop,onZoomEnd:noop}},getInitialState:function(){return{startPos:null,pos:null,mouseWheelPos:null}},_getMousePos:function(e){var o=this.refs.container;return mousePos(o,e)},_onMouseDown:function(e){var o=this._getMousePos(e);this.setState({startPos:o,pos:o}),this.props.onMouseDown({pos:o}),document.addEventListener("mousemove",this._onMouseDrag,!1),document.addEventListener("mouseup",this._onMouseUp,!1)},_onMouseDrag:function(e){var o=this._getMousePos(e);this.setState({pos:o}),this.props.onMouseDrag({pos:o})},_onMouseUp:function(e){document.removeEventListener("mousemove",this._onMouseDrag,!1),document.removeEventListener("mouseup",this._onMouseUp,!1);var o=this._getMousePos(e);this.setState({pos:o}),this.props.onMouseUp({pos:o})},_onMouseMove:function(e){var o=this._getMousePos(e);this.props.onMouseMove({pos:o})},_onWheel:function(e){e.stopPropagation(),e.preventDefault();var o=e.deltaY;firefox&&e.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(o/=window.devicePixelRatio),e.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(o*=40);var t=this.state.mouseWheelType,s=this.state.mouseWheelTimeout,n=this.state.mouseWheelLastValue,i=this.state.mouseWheelTime,u=(window.performance||Date).now(),r=u-(i||0),a=this._getMousePos(e);i=u,0!==o&&o%4.000244140625===0?(t="wheel",o=Math.floor(o/4)):0!==o&&Math.abs(o)<4?t="trackpad":r>400?(t=null,n=o,s=window.setTimeout(function(){var e="wheel";this._zoom(-this.state.mouseWheelLastValue,this.state.mouseWheelPos),this.setState({mouseWheelType:e})}.bind(this),40)):this._type||(t=Math.abs(r*o)<200?"trackpad":"wheel",s&&(window.clearTimeout(s),s=null,o+=n)),e.shiftKey&&o&&(o/=4),t&&this._zoom(-o,a),this.setState({mouseWheelTime:i,mouseWheelPos:a,mouseWheelType:t,mouseWheelTimeout:s,mouseWheelLastValue:n})},_zoom:function(e,o){var t=2/(1+Math.exp(-Math.abs(e/100)));0>e&&0!==t&&(t=1/t),this.props.onZoom({pos:o,scale:t}),window.clearTimeout(this._zoomEndTimeout),this._zoomEndTimeout=window.setTimeout(function(){this.props.onZoomEnd()}.bind(this),200)},render:function(){return r.div({ref:"container",onMouseMove:this._onMouseMove,onMouseDown:this._onMouseDown,onWheel:this._onWheel,style:{width:this.props.width,height:this.props.height,position:"relative"}},this.props.children)}});module.exports=MapInteractions; + +},{"./noop":321,"global/document":59,"global/window":60,"mapbox-gl":223,"r-dom":312,"react":453}],320:[function(require,module,exports){ +"use strict";function mod(t,e){var o=t%e;return 0>o?e+o:o}function unprojectFromTransform(t,e){return t.pointLocation(Point.convert(e))}function cloneTransform(t){var e=new Transform(t._minZoom,t._maxZoom);return e.latRange=t.latRange,e.width=t.width,e.height=t.height,e.zoom=t.zoom,e.center=t.center,e.angle=t.angle,e.altitude=t.altitude,e.pitch=t.pitch,e}var assert=require("assert"),React=require("react"),r=require("r-dom"),d3=require("d3"),assign=require("object-assign"),Immutable=require("immutable"),mapboxgl=require("mapbox-gl"),LngLatBounds=mapboxgl.LngLatBounds,Point=mapboxgl.Point,Transform=require("mapbox-gl/js/geo/transform"),config=require("./config"),MapInteractions=require("./map-interactions.react"),MapGL=React.createClass({displayName:"MapGL",shouldComponentUpdate:function(t,e){var o=Object.keys(t).reduce(function(e,o){var r=t[o]===this.props[o];return e&&r}.bind(this),!0);return o?(o=Object.keys(e).reduce(function(t,o){var r=e[o]===this.state[o];return t&&r}.bind(this),!0),!o):!0},propTypes:{latitude:React.PropTypes.number.isRequired,longitude:React.PropTypes.number.isRequired,zoom:React.PropTypes.number.isRequired,mapStyle:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.instanceOf(Immutable.Map)]),mapboxApiAccessToken:React.PropTypes.string,onChangeViewport:React.PropTypes.func,width:React.PropTypes.number.isRequired,height:React.PropTypes.number.isRequired,isDragging:React.PropTypes.bool,startDragLngLat:React.PropTypes.array,onHoverFeatures:React.PropTypes.func,attributionControl:React.PropTypes.bool,onClickFeatures:React.PropTypes.func,preserveDrawingBuffer:React.PropTypes.bool},getDefaultProps:function(){return{mapStyle:"mapbox://styles/mapbox/light-v8",onChangeViewport:null,mapboxApiAccessToken:config.DEFAULTS.MAPBOX_API_ACCESS_TOKEN,preserveDrawingBuffer:!1,attributionControl:!0}},getInitialState:function(){var t={},e=this._updateStateFromProps(t,this.props),o=assign({},t,e);return o},componentWillReceiveProps:function(t){var e=this._updateStateFromProps(this.state,t);this.setState(e)},_cursor:function(){var t=this.props.onChangeViewport||this.props.onClickFeature||this.props.onHoverFeatures;return t?this.props.isDragging?config.CURSOR.GRABBING:config.CURSOR.GRAB:"inherit"},_updateStateFromProps:function(t,e){var o={latitude:e.latitude,longitude:e.longitude,zoom:e.zoom,width:e.width,height:e.height,mapStyle:e.mapStyle,startDragLngLat:e.startDragLngLat&&e.startDragLngLat.slice()};return assign(o,{prevLatitude:t.latitude,prevLongitude:t.longitude,prevZoom:t.zoom,prevWidth:t.width,prevHeight:t.height,prevMapStyle:t.mapStyle}),mapboxgl.accessToken=e.mapboxApiAccessToken,o},_onChangeViewport:function(t){var e=this._getMap(),o=e.getCenter(),r=assign({latitude:o.lat,longitude:o.lng,zoom:e.getZoom(),isDragging:this.props.isDragging,startDragLngLat:this.state.startDragLngLat},t);r.longitude=mod(r.longitude+180,360)-180,this.props.onChangeViewport(r)},_getMap:function(){return this._map},componentDidMount:function(){var t;t=this.props.mapStyle instanceof Immutable.Map?this.props.mapStyle.toJS():this.props.mapStyle;var e=new mapboxgl.Map({container:this.refs.mapboxMap,center:[this.state.longitude,this.state.latitude],zoom:this.state.zoom,style:t,interactive:!1,preserveDrawingBuffer:this.props.preserveDrawingBuffer});d3.select(e.getCanvas()).style("outline","none"),this._map=e,this._updateMapViewport()},_updateMapViewport:function(){var t=this.state;(t.latitude!==t.prevLatitude||t.longitude!==t.prevLongitude||t.zoom!==t.prevZoom)&&this._getMap().jumpTo({center:[t.longitude,t.latitude],zoom:t.zoom,bearing:0,pitch:0}),(t.width!==t.prevWidth||t.height!==t.prevHeight)&&this._resizeMap()},_resizeMap:function(){var t=this._getMap();t.resize()},_diffSources:function(t,e){var o=t.get("sources"),r=e.get("sources"),i=[],n=[],a=[],s=o.keySeq().toArray(),p=r.keySeq().toArray();return s.forEach(function(t){var e=r.get(t);e?e.equals(o.get(t))||n.push({id:t,source:r.get(t)}):a.push({id:t,source:o.get(t)})}),p.forEach(function(t){var e=o.get(t);e||i.push({id:t,source:r.get(t)})}),{enter:i,update:n,exit:a}},_diffLayers:function(t,e){var o=t.get("layers"),r=e.get("layers"),i=[],n=[],a={},s={};return r.forEach(function(t,e){var o=t.get("id"),i=r.get(e+1);s[o]={layer:t,id:o,before:i?i.get("id"):null,enter:!0}}),o.forEach(function(t,e){var r=t.get("id"),i=o.get(e+1);a[r]={layer:t,id:r,before:i?i.get("id"):null},s[r]?s[r].enter=!1:n.push(a[r])}),r.reverse().forEach(function(t){var e=t.get("id");a[e]&&a[e].layer.equals(s[e].layer)&&a[e].before===s[e].before||i.push(s[e])}),{updates:i,exiting:n}},_setDiffStyle:function(t,e){function o(t){return t.map(function(){return!0})["delete"]("layers")["delete"]("sources").toJS()}function r(){var o=Object.keys(n),r=Object.keys(a);return o.length!==r.length?!0:r.some(function(o){return t.get(o)!==e.get(o)})?!0:!1}var i=this._getMap(),n=t&&o(t)||{},a=o(e);if(!t||r())return void i.setStyle(e.toJS());var s=this._diffSources(t,e),p=this._diffLayers(t,e);return p.updates.some(function(t){return t.layer.get("ref")})?void i.setStyle(e.toJS()):void i.batch(function(){s.enter.forEach(function(t){i.addSource(t.id,t.source.toJS())}),s.update.forEach(function(t){i.removeSource(t.id),i.addSource(t.id,t.source.toJS())}),s.exit.forEach(function(t){i.removeSource(t.id)}),p.exiting.forEach(function(t){i.style.getLayer(t.id)&&i.removeLayer(t.id)}),p.updates.forEach(function(t){t.enter||i.removeLayer(t.id),i.addLayer(t.layer.toJS(),t.before)})})},_updateMapStyle:function(){var t=this.state.mapStyle;t!==this.state.prevMapStyle&&(t instanceof Immutable.Map?this._setDiffStyle(this.state.prevMapStyle,t):this._getMap().setStyle(t))},componentDidUpdate:function(){this._updateMapViewport(),this._updateMapStyle()},_onMouseDown:function(t){var e=this._getMap(),o=unprojectFromTransform(e.transform,t.pos);this._onChangeViewport({isDragging:!0,startDragLngLat:[o.lng,o.lat]})},_onMouseDrag:function(t){if(this.props.onChangeViewport){var e=t.pos,o=this._getMap(),r=cloneTransform(o.transform);assert(this.state.startDragLngLat,"`startDragLngLat` prop is required for mouse drag behavior to calculate where to position the map."),r.setLocationAtPoint(this.state.startDragLngLat,e),this._onChangeViewport({latitude:r.center.lat,longitude:r.center.lng,zoom:r.zoom,isDragging:!0})}},_onMouseMove:function(t){var e=this._getMap(),o=t.pos;this.props.onHoverFeatures&&e.featuresAt([o.x,o.y],{radius:1},function(t,e){if(t)throw t;e.length&&this.props.onHoverFeatures(e)}.bind(this))},_onMouseUp:function(t){var e=this._getMap(),o=cloneTransform(e.transform);if(this._onChangeViewport({latitude:o.center.lat,longitude:o.center.lng,zoom:o.zoom,isDragging:!1}),this.props.onClickFeatures){var r=t.pos;e.featuresAt([r.x,r.y],{radius:15},function(t,e){if(t)throw t;e.length&&this.props.onClickFeatures(e)}.bind(this))}},_onZoom:function(t){var e=this._getMap(),o=cloneTransform(e.transform),r=unprojectFromTransform(o,t.pos);o.zoom=o.scaleZoom(e.transform.scale*t.scale),o.setLocationAtPoint(r,t.pos),this._onChangeViewport({latitude:o.center.lat,longitude:o.center.lng,zoom:o.zoom,isDragging:!0})},_onZoomEnd:function(){this._onChangeViewport({isDragging:!1})},render:function(){var t=this.props,e=assign({},t.style,{width:t.width,height:t.height,cursor:this._cursor()}),o=new Transform;o.width=t.width,o.height=t.height,o.zoom=this.props.zoom,o.center.lat=this.props.latitude,o.center.lng=this.props.longitude;var i=[r.div({ref:"mapboxMap",style:e,className:t.className}),r.div({className:"overlays",style:{position:"absolute",left:0,top:0}},this.props.children)];return this.props.onChangeViewport&&(i=[r(MapInteractions,{onMouseDown:this._onMouseDown,onMouseDrag:this._onMouseDrag,onMouseUp:this._onMouseUp,onMouseMove:this._onMouseMove,onZoom:this._onZoom,onZoomEnd:this._onZoomEnd,width:this.props.width,height:this.props.height},i)]),r.div({style:assign({},this.props.style,{width:this.props.width,height:this.props.height})},i)}});MapGL.fitBounds=function(t,e,o,r){var i=new LngLatBounds([o[0].reverse(),o[1].reverse()]);r=r||{};var n="undefined"==typeof r.padding?0:r.padding,a=Point.convert([0,0]),s=new Transform;s.width=t,s.height=e;var p=s.project(i.getNorthWest()),u=s.project(i.getSouthEast()),g=u.sub(p),h=(s.width-2*n-2*Math.abs(a.x))/g.x,c=(s.height-2*n-2*Math.abs(a.y))/g.y,l=s.unproject(p.add(u).div(2)),d=s.scaleZoom(s.scale*Math.min(h,c));return{latitude:l.lat,longitude:l.lng,zoom:d}},module.exports=MapGL; + +},{"./config":317,"./map-interactions.react":319,"assert":7,"d3":13,"immutable":201,"mapbox-gl":223,"mapbox-gl/js/geo/transform":221,"object-assign":316,"r-dom":312,"react":453}],321:[function(require,module,exports){ +"use strict";module.exports=function(){}; + +},{}],322:[function(require,module,exports){ +"use strict";var React=require("react"),window=require("global/window"),d3=require("d3"),r=require("r-dom"),Immutable=require("immutable"),COMPOSITE_TYPES=require("canvas-composite-types"),ViewportMercator=require("viewport-mercator-project"),ScatterplotOverlay=React.createClass({displayName:"ScatterplotOverlay",propTypes:{width:React.PropTypes.number.isRequired,height:React.PropTypes.number.isRequired,latitude:React.PropTypes.number.isRequired,longitude:React.PropTypes.number.isRequired,zoom:React.PropTypes.number.isRequired,isDragging:React.PropTypes.bool.isRequired,locations:React.PropTypes.instanceOf(Immutable.List).isRequired,lngLatAccessor:React.PropTypes.func.isRequired,renderWhileDragging:React.PropTypes.bool,globalOpacity:React.PropTypes.number.isRequired,dotRadius:React.PropTypes.number.isRequired,dotFill:React.PropTypes.string.isRequired,compositeOperation:React.PropTypes.oneOf(COMPOSITE_TYPES).isRequired},getDefaultProps:function(){return{lngLatAccessor:function(e){return[e.get(0),e.get(1)]},renderWhileDragging:!0,dotRadius:4,dotFill:"#1FBAD6",globalOpacity:1,compositeOperation:"source-over"}},componentDidMount:function(){this._redraw()},componentDidUpdate:function(){this._redraw()},_redraw:function(){var e=window.devicePixelRatio||1,t=this.refs.overlay,r=t.getContext("2d"),i=this.props,o=this.props.dotRadius,s=this.props.dotFill;r.save(),r.scale(e,e),r.clearRect(0,0,i.width,i.height),r.globalCompositeOperation=this.props.compositeOperation;var p=ViewportMercator(this.props);!this.props.renderWhileDragging&&this.props.isDragging||!this.props.locations||this.props.locations.forEach(function(e){var t=p.project(this.props.lngLatAccessor(e)),a=[d3.round(t[0],1),d3.round(t[1],1)];a[0]+o>=0&&a[0]-o=0&&a[1]-o8&&11>=documentMode),SPACEBAR_CODE=32,SPACEBAR_CHAR=String.fromCharCode(SPACEBAR_CODE),topLevelTypes=EventConstants.topLevelTypes,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]}},hasSpaceKeypress=!1,currentComposition=null,BeforeInputEventPlugin={eventTypes:eventTypes,extractEvents:function(e,t,o,n,p){return[extractCompositionEvent(e,t,o,n,p),extractBeforeInputEvent(e,t,o,n,p)]}};module.exports=BeforeInputEventPlugin; + +},{"./EventConstants":336,"./EventPropagators":340,"./FallbackCompositionState":341,"./SyntheticCompositionEvent":413,"./SyntheticInputEvent":417,"fbjs/lib/ExecutionEnvironment":15,"fbjs/lib/keyOf":33}],325:[function(require,module,exports){ +"use strict";function prefixKey(o,r){return o+r.charAt(0).toUpperCase()+r.substring(1)}var isUnitlessNumber={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0},prefixes=["Webkit","ms","Moz","O"];Object.keys(isUnitlessNumber).forEach(function(o){prefixes.forEach(function(r){isUnitlessNumber[prefixKey(r,o)]=isUnitlessNumber[o]})});var shorthandPropertyExpansions={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},CSSProperty={isUnitlessNumber:isUnitlessNumber,shorthandPropertyExpansions:shorthandPropertyExpansions};module.exports=CSSProperty; + +},{}],326:[function(require,module,exports){ (function (process){ -"use strict";var CSSProperty=require("./CSSProperty"),ExecutionEnvironment=require("./ExecutionEnvironment"),camelizeStyleName=require("./camelizeStyleName"),dangerousStyleValue=require("./dangerousStyleValue"),hyphenateStyleName=require("./hyphenateStyleName"),memoizeStringOnly=require("./memoizeStringOnly"),warning=require("./warning"),processStyleName=memoizeStringOnly(function(e){return hyphenateStyleName(e)}),styleFloatAccessor="cssFloat";if(ExecutionEnvironment.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(styleFloatAccessor="styleFloat"),"production"!==process.env.NODE_ENV)var badVendoredStyleNamePattern=/^(?:webkit|moz|o)[A-Z]/,badStyleValueWithSemicolonPattern=/;\s*$/,warnedStyleNames={},warnedStyleValues={},warnHyphenatedStyleName=function(e){warnedStyleNames.hasOwnProperty(e)&&warnedStyleNames[e]||(warnedStyleNames[e]=!0,"production"!==process.env.NODE_ENV?warning(!1,"Unsupported style property %s. Did you mean %s?",e,camelizeStyleName(e)):null)},warnBadVendoredStyleName=function(e){warnedStyleNames.hasOwnProperty(e)&&warnedStyleNames[e]||(warnedStyleNames[e]=!0,"production"!==process.env.NODE_ENV?warning(!1,"Unsupported vendor-prefixed style property %s. Did you mean %s?",e,e.charAt(0).toUpperCase()+e.slice(1)):null)},warnStyleValueWithSemicolon=function(e,r){warnedStyleValues.hasOwnProperty(r)&&warnedStyleValues[r]||(warnedStyleValues[r]=!0,"production"!==process.env.NODE_ENV?warning(!1,'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.',e,r.replace(badStyleValueWithSemicolonPattern,"")):null)},warnValidStyle=function(e,r){e.indexOf("-")>-1?warnHyphenatedStyleName(e):badVendoredStyleNamePattern.test(e)?warnBadVendoredStyleName(e):badStyleValueWithSemicolonPattern.test(r)&&warnStyleValueWithSemicolon(e,r)};var CSSPropertyOperations={createMarkupForStyles:function(e){var r="";for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];"production"!==process.env.NODE_ENV&&warnValidStyle(t,n),null!=n&&(r+=processStyleName(t)+":",r+=dangerousStyleValue(t,n)+";")}return r||null},setValueForStyles:function(e,r){var t=e.style;for(var n in r)if(r.hasOwnProperty(n)){"production"!==process.env.NODE_ENV&&warnValidStyle(n,r[n]);var a=dangerousStyleValue(n,r[n]);if("float"===n&&(n=styleFloatAccessor),a)t[n]=a;else{var o=CSSProperty.shorthandPropertyExpansions[n];if(o)for(var l in o)t[l]="";else t[n]=""}}}};module.exports=CSSPropertyOperations; +"use strict";var CSSProperty=require("./CSSProperty"),ExecutionEnvironment=require("fbjs/lib/ExecutionEnvironment"),ReactPerf=require("./ReactPerf"),camelizeStyleName=require("fbjs/lib/camelizeStyleName"),dangerousStyleValue=require("./dangerousStyleValue"),hyphenateStyleName=require("fbjs/lib/hyphenateStyleName"),memoizeStringOnly=require("fbjs/lib/memoizeStringOnly"),warning=require("fbjs/lib/warning"),processStyleName=memoizeStringOnly(function(e){return hyphenateStyleName(e)}),hasShorthandPropertyBug=!1,styleFloatAccessor="cssFloat";if(ExecutionEnvironment.canUseDOM){var tempStyle=document.createElement("div").style;try{tempStyle.font=""}catch(e){hasShorthandPropertyBug=!0}void 0===document.documentElement.style.cssFloat&&(styleFloatAccessor="styleFloat")}if("production"!==process.env.NODE_ENV)var badVendoredStyleNamePattern=/^(?:webkit|moz|o)[A-Z]/,badStyleValueWithSemicolonPattern=/;\s*$/,warnedStyleNames={},warnedStyleValues={},warnHyphenatedStyleName=function(e){warnedStyleNames.hasOwnProperty(e)&&warnedStyleNames[e]||(warnedStyleNames[e]=!0,"production"!==process.env.NODE_ENV?warning(!1,"Unsupported style property %s. Did you mean %s?",e,camelizeStyleName(e)):void 0)},warnBadVendoredStyleName=function(e){warnedStyleNames.hasOwnProperty(e)&&warnedStyleNames[e]||(warnedStyleNames[e]=!0,"production"!==process.env.NODE_ENV?warning(!1,"Unsupported vendor-prefixed style property %s. Did you mean %s?",e,e.charAt(0).toUpperCase()+e.slice(1)):void 0)},warnStyleValueWithSemicolon=function(e,t){warnedStyleValues.hasOwnProperty(t)&&warnedStyleValues[t]||(warnedStyleValues[t]=!0,"production"!==process.env.NODE_ENV?warning(!1,'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.',e,t.replace(badStyleValueWithSemicolonPattern,"")):void 0)},warnValidStyle=function(e,t){e.indexOf("-")>-1?warnHyphenatedStyleName(e):badVendoredStyleNamePattern.test(e)?warnBadVendoredStyleName(e):badStyleValueWithSemicolonPattern.test(t)&&warnStyleValueWithSemicolon(e,t)};var CSSPropertyOperations={createMarkupForStyles:function(e){var t="";for(var r in e)if(e.hasOwnProperty(r)){var a=e[r];"production"!==process.env.NODE_ENV&&warnValidStyle(r,a),null!=a&&(t+=processStyleName(r)+":",t+=dangerousStyleValue(r,a)+";")}return t||null},setValueForStyles:function(e,t){var r=e.style;for(var a in t)if(t.hasOwnProperty(a)){"production"!==process.env.NODE_ENV&&warnValidStyle(a,t[a]);var n=dangerousStyleValue(a,t[a]);if("float"===a&&(a=styleFloatAccessor),n)r[a]=n;else{var o=hasShorthandPropertyBug&&CSSProperty.shorthandPropertyExpansions[a];if(o)for(var l in o)r[l]="";else r[a]=""}}}};ReactPerf.measureMethods(CSSPropertyOperations,"CSSPropertyOperations",{setValueForStyles:"setValueForStyles"}),module.exports=CSSPropertyOperations; }).call(this,require('_process')) -},{"./CSSProperty":310,"./ExecutionEnvironment":327,"./camelizeStyleName":427,"./dangerousStyleValue":434,"./hyphenateStyleName":454,"./memoizeStringOnly":465,"./warning":477,"_process":498}],312:[function(require,module,exports){ +},{"./CSSProperty":325,"./ReactPerf":394,"./dangerousStyleValue":428,"_process":311,"fbjs/lib/ExecutionEnvironment":15,"fbjs/lib/camelizeStyleName":17,"fbjs/lib/hyphenateStyleName":28,"fbjs/lib/memoizeStringOnly":35,"fbjs/lib/warning":40}],327:[function(require,module,exports){ (function (process){ -"use strict";function CallbackQueue(){this._callbacks=null,this._contexts=null}var PooledClass=require("./PooledClass"),assign=require("./Object.assign"),invariant=require("./invariant");assign(CallbackQueue.prototype,{enqueue:function(t,l){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(t),this._contexts.push(l)},notifyAll:function(){var t=this._callbacks,l=this._contexts;if(t){"production"!==process.env.NODE_ENV?invariant(t.length===l.length,"Mismatched list of contexts in callback queue"):invariant(t.length===l.length),this._callbacks=null,this._contexts=null;for(var s=0,e=t.length;e>s;s++)t[s].call(l[s]);t.length=0,l.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),PooledClass.addPoolingTo(CallbackQueue),module.exports=CallbackQueue; +"use strict";function CallbackQueue(){this._callbacks=null,this._contexts=null}var PooledClass=require("./PooledClass"),assign=require("./Object.assign"),invariant=require("fbjs/lib/invariant");assign(CallbackQueue.prototype,{enqueue:function(t,l){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(t),this._contexts.push(l)},notifyAll:function(){var t=this._callbacks,l=this._contexts;if(t){t.length!==l.length?"production"!==process.env.NODE_ENV?invariant(!1,"Mismatched list of contexts in callback queue"):invariant(!1):void 0,this._callbacks=null,this._contexts=null;for(var s=0;s8));var isInputEventSupported=!1;ExecutionEnvironment.canUseDOM&&(isInputEventSupported=isEventSupported("input")&&(!("documentMode"in document)||document.documentMode>9));var newValueProp={get:function(){return activeElementValueProp.get.call(this)},set:function(e){activeElementValue=""+e,activeElementValueProp.set.call(this,e)}},ChangeEventPlugin={eventTypes:eventTypes,extractEvents:function(e,t,n,a){var o,l;if(shouldUseChangeEvent(t)?doesChangeEventBubble?o=getTargetIDForChangeEvent:l=handleEventsForChangeEventIE8:isTextInputElement(t)?isInputEventSupported?o=getTargetIDForInputEvent:(o=getTargetIDForInputEventIE,l=handleEventsForInputEventIE):shouldUseClickEvent(t)&&(o=getTargetIDForClickEvent),o){var u=o(e,t,n);if(u){var v=SyntheticEvent.getPooled(eventTypes.change,u,a);return EventPropagators.accumulateTwoPhaseDispatches(v),v}}l&&l(e,t,n)}};module.exports=ChangeEventPlugin; +},{"./Object.assign":344,"./PooledClass":345,"_process":311,"fbjs/lib/invariant":29}],328:[function(require,module,exports){ +"use strict";function shouldUseChangeEvent(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function manualDispatchChangeEvent(e){var t=SyntheticEvent.getPooled(eventTypes.change,activeElementID,e,getEventTarget(e));EventPropagators.accumulateTwoPhaseDispatches(t),ReactUpdates.batchedUpdates(runEventInBatch,t)}function runEventInBatch(e){EventPluginHub.enqueueEvents(e),EventPluginHub.processEventQueue(!1)}function startWatchingForChangeEventIE8(e,t){activeElement=e,activeElementID=t,activeElement.attachEvent("onchange",manualDispatchChangeEvent)}function stopWatchingForChangeEventIE8(){activeElement&&(activeElement.detachEvent("onchange",manualDispatchChangeEvent),activeElement=null,activeElementID=null)}function getTargetIDForChangeEvent(e,t,n){return e===topLevelTypes.topChange?n:void 0}function handleEventsForChangeEventIE8(e,t,n){e===topLevelTypes.topFocus?(stopWatchingForChangeEventIE8(),startWatchingForChangeEventIE8(t,n)):e===topLevelTypes.topBlur&&stopWatchingForChangeEventIE8()}function startWatchingForValueChange(e,t){activeElement=e,activeElementID=t,activeElementValue=e.value,activeElementValueProp=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(activeElement,"value",newValueProp),activeElement.attachEvent("onpropertychange",handlePropertyChange)}function stopWatchingForValueChange(){activeElement&&(delete activeElement.value,activeElement.detachEvent("onpropertychange",handlePropertyChange),activeElement=null,activeElementID=null,activeElementValue=null,activeElementValueProp=null)}function handlePropertyChange(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==activeElementValue&&(activeElementValue=t,manualDispatchChangeEvent(e))}}function getTargetIDForInputEvent(e,t,n){return e===topLevelTypes.topInput?n:void 0}function handleEventsForInputEventIE(e,t,n){e===topLevelTypes.topFocus?(stopWatchingForValueChange(),startWatchingForValueChange(t,n)):e===topLevelTypes.topBlur&&stopWatchingForValueChange()}function getTargetIDForInputEventIE(e,t,n){return e!==topLevelTypes.topSelectionChange&&e!==topLevelTypes.topKeyUp&&e!==topLevelTypes.topKeyDown||!activeElement||activeElement.value===activeElementValue?void 0:(activeElementValue=activeElement.value,activeElementID)}function shouldUseClickEvent(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function getTargetIDForClickEvent(e,t,n){return e===topLevelTypes.topClick?n:void 0}var EventConstants=require("./EventConstants"),EventPluginHub=require("./EventPluginHub"),EventPropagators=require("./EventPropagators"),ExecutionEnvironment=require("fbjs/lib/ExecutionEnvironment"),ReactUpdates=require("./ReactUpdates"),SyntheticEvent=require("./SyntheticEvent"),getEventTarget=require("./getEventTarget"),isEventSupported=require("./isEventSupported"),isTextInputElement=require("./isTextInputElement"),keyOf=require("fbjs/lib/keyOf"),topLevelTypes=EventConstants.topLevelTypes,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]}},activeElement=null,activeElementID=null,activeElementValue=null,activeElementValueProp=null,doesChangeEventBubble=!1;ExecutionEnvironment.canUseDOM&&(doesChangeEventBubble=isEventSupported("change")&&(!("documentMode"in document)||document.documentMode>8));var isInputEventSupported=!1;ExecutionEnvironment.canUseDOM&&(isInputEventSupported=isEventSupported("input")&&(!("documentMode"in document)||document.documentMode>9));var newValueProp={get:function(){return activeElementValueProp.get.call(this)},set:function(e){activeElementValue=""+e,activeElementValueProp.set.call(this,e)}},ChangeEventPlugin={eventTypes:eventTypes,extractEvents:function(e,t,n,a,o){var l,u;if(shouldUseChangeEvent(t)?doesChangeEventBubble?l=getTargetIDForChangeEvent:u=handleEventsForChangeEventIE8:isTextInputElement(t)?isInputEventSupported?l=getTargetIDForInputEvent:(l=getTargetIDForInputEventIE,u=handleEventsForInputEventIE):shouldUseClickEvent(t)&&(l=getTargetIDForClickEvent),l){var v=l(e,t,n);if(v){var p=SyntheticEvent.getPooled(eventTypes.change,v,a,o);return p.type="change",EventPropagators.accumulateTwoPhaseDispatches(p),p}}u&&u(e,t,n)}};module.exports=ChangeEventPlugin; -},{"./EventConstants":321,"./EventPluginHub":323,"./EventPropagators":326,"./ExecutionEnvironment":327,"./ReactUpdates":405,"./SyntheticEvent":414,"./isEventSupported":457,"./isTextInputElement":459,"./keyOf":463}],314:[function(require,module,exports){ +},{"./EventConstants":336,"./EventPluginHub":337,"./EventPropagators":340,"./ReactUpdates":406,"./SyntheticEvent":415,"./getEventTarget":437,"./isEventSupported":442,"./isTextInputElement":443,"fbjs/lib/ExecutionEnvironment":15,"fbjs/lib/keyOf":33}],329:[function(require,module,exports){ "use strict";var nextReactRootIndex=0,ClientReactRootIndex={createReactRootIndex:function(){return nextReactRootIndex++}};module.exports=ClientReactRootIndex; -},{}],315:[function(require,module,exports){ +},{}],330:[function(require,module,exports){ (function (process){ -"use strict";function insertChildAt(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var Danger=require("./Danger"),ReactMultiChildUpdateTypes=require("./ReactMultiChildUpdateTypes"),setTextContent=require("./setTextContent"),invariant=require("./invariant"),DOMChildrenOperations={dangerouslyReplaceNodeWithMarkup:Danger.dangerouslyReplaceNodeWithMarkup,updateTextContent:setTextContent,processUpdates:function(e,t){for(var n,a=null,r=null,i=0;i when using tables, nesting tags like
    ,

    , or , or using non-SVG elements in an parent. Try inspecting the child nodes of the element with React ID `%s`.",s,l):invariant(d),a=a||{},a[l]=a[l]||[],a[l][s]=d,r=r||[],r.push(d)}var o=Danger.dangerouslyRenderMarkup(t);if(r)for(var p=0;p=e.childNodes.length?null:e.childNodes.item(n);e.insertBefore(t,a)}var Danger=require("./Danger"),ReactMultiChildUpdateTypes=require("./ReactMultiChildUpdateTypes"),ReactPerf=require("./ReactPerf"),setInnerHTML=require("./setInnerHTML"),setTextContent=require("./setTextContent"),invariant=require("fbjs/lib/invariant"),DOMChildrenOperations={dangerouslyReplaceNodeWithMarkup:Danger.dangerouslyReplaceNodeWithMarkup,updateTextContent:setTextContent,processUpdates:function(e,t){for(var n,a=null,r=null,i=0;i when using tables, nesting tags like
    ,

    , or , or using non-SVG elements in an parent. Try inspecting the child nodes of the element with React ID `%s`.",s,o):invariant(!1),a=a||{},a[o]=a[o]||[],a[o][s]=d,r=r||[],r.push(d)}var l;if(l=t.length&&"string"==typeof t[0]?Danger.dangerouslyRenderMarkup(t):t,r)for(var p=0;pe||DOMProperty.hasOverloadedBooleanValue[r]&&e===!1}var DOMProperty=require("./DOMProperty"),quoteAttributeValueForBrowser=require("./quoteAttributeValueForBrowser"),warning=require("./warning");if("production"!==process.env.NODE_ENV)var reactProps={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0},warnedProperties={},warnUnknownProperty=function(r){if(!(reactProps.hasOwnProperty(r)&&reactProps[r]||warnedProperties.hasOwnProperty(r)&&warnedProperties[r])){warnedProperties[r]=!0;var e=r.toLowerCase(),t=DOMProperty.isCustomAttribute(e)?e:DOMProperty.getPossibleStandardName.hasOwnProperty(e)?DOMProperty.getPossibleStandardName[e]:null;"production"!==process.env.NODE_ENV?warning(null==t,"Unknown DOM property %s. Did you mean %s?",r,t):null}};var DOMPropertyOperations={createMarkupForID:function(r){return DOMProperty.ID_ATTRIBUTE_NAME+"="+quoteAttributeValueForBrowser(r)},createMarkupForProperty:function(r,e){if(DOMProperty.isStandardName.hasOwnProperty(r)&&DOMProperty.isStandardName[r]){if(shouldIgnoreValue(r,e))return"";var t=DOMProperty.getAttributeName[r];return DOMProperty.hasBooleanValue[r]||DOMProperty.hasOverloadedBooleanValue[r]&&e===!0?t:t+"="+quoteAttributeValueForBrowser(e)}return DOMProperty.isCustomAttribute(r)?null==e?"":r+"="+quoteAttributeValueForBrowser(e):("production"!==process.env.NODE_ENV&&warnUnknownProperty(r),null)},setValueForProperty:function(r,e,t){if(DOMProperty.isStandardName.hasOwnProperty(e)&&DOMProperty.isStandardName[e]){var o=DOMProperty.getMutationMethod[e];if(o)o(r,t);else if(shouldIgnoreValue(e,t))this.deleteValueForProperty(r,e);else if(DOMProperty.mustUseAttribute[e])r.setAttribute(DOMProperty.getAttributeName[e],""+t);else{var a=DOMProperty.getPropertyName[e];DOMProperty.hasSideEffects[e]&&""+r[a]==""+t||(r[a]=t)}}else DOMProperty.isCustomAttribute(e)?null==t?r.removeAttribute(e):r.setAttribute(e,""+t):"production"!==process.env.NODE_ENV&&warnUnknownProperty(e)},deleteValueForProperty:function(r,e){if(DOMProperty.isStandardName.hasOwnProperty(e)&&DOMProperty.isStandardName[e]){var t=DOMProperty.getMutationMethod[e];if(t)t(r,void 0);else if(DOMProperty.mustUseAttribute[e])r.removeAttribute(DOMProperty.getAttributeName[e]);else{var o=DOMProperty.getPropertyName[e],a=DOMProperty.getDefaultValueForProperty(r.nodeName,o);DOMProperty.hasSideEffects[e]&&""+r[o]===a||(r[o]=a)}}else DOMProperty.isCustomAttribute(e)?r.removeAttribute(e):"production"!==process.env.NODE_ENV&&warnUnknownProperty(e)}};module.exports=DOMPropertyOperations; +"use strict";function isAttributeNameSafe(e){return validatedAttributeNameCache.hasOwnProperty(e)?!0:illegalAttributeNameCache.hasOwnProperty(e)?!1:VALID_ATTRIBUTE_NAME_REGEX.test(e)?(validatedAttributeNameCache[e]=!0,!0):(illegalAttributeNameCache[e]=!0,"production"!==process.env.NODE_ENV?warning(!1,"Invalid attribute name: `%s`",e):void 0,!1)}function shouldIgnoreValue(e,r){return null==r||e.hasBooleanValue&&!r||e.hasNumericValue&&isNaN(r)||e.hasPositiveNumericValue&&1>r||e.hasOverloadedBooleanValue&&r===!1}var DOMProperty=require("./DOMProperty"),ReactPerf=require("./ReactPerf"),quoteAttributeValueForBrowser=require("./quoteAttributeValueForBrowser"),warning=require("fbjs/lib/warning"),VALID_ATTRIBUTE_NAME_REGEX=/^[a-zA-Z_][\w\.\-]*$/,illegalAttributeNameCache={},validatedAttributeNameCache={};if("production"!==process.env.NODE_ENV)var reactProps={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0},warnedProperties={},warnUnknownProperty=function(e){if(!(reactProps.hasOwnProperty(e)&&reactProps[e]||warnedProperties.hasOwnProperty(e)&&warnedProperties[e])){warnedProperties[e]=!0;var r=e.toLowerCase(),t=DOMProperty.isCustomAttribute(r)?r:DOMProperty.getPossibleStandardName.hasOwnProperty(r)?DOMProperty.getPossibleStandardName[r]:null;"production"!==process.env.NODE_ENV?warning(null==t,"Unknown DOM property %s. Did you mean %s?",e,t):void 0}};var DOMPropertyOperations={createMarkupForID:function(e){return DOMProperty.ID_ATTRIBUTE_NAME+"="+quoteAttributeValueForBrowser(e)},setAttributeForID:function(e,r){e.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME,r)},createMarkupForProperty:function(e,r){var t=DOMProperty.properties.hasOwnProperty(e)?DOMProperty.properties[e]:null;if(t){if(shouldIgnoreValue(t,r))return"";var o=t.attributeName;return t.hasBooleanValue||t.hasOverloadedBooleanValue&&r===!0?o+'=""':o+"="+quoteAttributeValueForBrowser(r)}return DOMProperty.isCustomAttribute(e)?null==r?"":e+"="+quoteAttributeValueForBrowser(r):("production"!==process.env.NODE_ENV&&warnUnknownProperty(e),null)},createMarkupForCustomAttribute:function(e,r){return isAttributeNameSafe(e)&&null!=r?e+"="+quoteAttributeValueForBrowser(r):""},setValueForProperty:function(e,r,t){var o=DOMProperty.properties.hasOwnProperty(r)?DOMProperty.properties[r]:null;if(o){var a=o.mutationMethod;if(a)a(e,t);else if(shouldIgnoreValue(o,t))this.deleteValueForProperty(e,r);else if(o.mustUseAttribute){var u=o.attributeName,i=o.attributeNamespace;i?e.setAttributeNS(i,u,""+t):o.hasBooleanValue||o.hasOverloadedBooleanValue&&t===!0?e.setAttribute(u,""):e.setAttribute(u,""+t)}else{var s=o.propertyName;o.hasSideEffects&&""+e[s]==""+t||(e[s]=t)}}else DOMProperty.isCustomAttribute(r)?DOMPropertyOperations.setValueForAttribute(e,r,t):"production"!==process.env.NODE_ENV&&warnUnknownProperty(r)},setValueForAttribute:function(e,r,t){isAttributeNameSafe(r)&&(null==t?e.removeAttribute(r):e.setAttribute(r,""+t))},deleteValueForProperty:function(e,r){var t=DOMProperty.properties.hasOwnProperty(r)?DOMProperty.properties[r]:null;if(t){var o=t.mutationMethod;if(o)o(e,void 0);else if(t.mustUseAttribute)e.removeAttribute(t.attributeName);else{var a=t.propertyName,u=DOMProperty.getDefaultValueForProperty(e.nodeName,a);t.hasSideEffects&&""+e[a]===u||(e[a]=u)}}else DOMProperty.isCustomAttribute(r)?e.removeAttribute(r):"production"!==process.env.NODE_ENV&&warnUnknownProperty(r)}};ReactPerf.measureMethods(DOMPropertyOperations,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),module.exports=DOMPropertyOperations; }).call(this,require('_process')) -},{"./DOMProperty":316,"./quoteAttributeValueForBrowser":469,"./warning":477,"_process":498}],318:[function(require,module,exports){ +},{"./DOMProperty":331,"./ReactPerf":394,"./quoteAttributeValueForBrowser":445,"_process":311,"fbjs/lib/warning":40}],333:[function(require,module,exports){ (function (process){ -"use strict";function getNodeName(e){return e.substring(1,e.indexOf(" "))}var ExecutionEnvironment=require("./ExecutionEnvironment"),createNodesFromMarkup=require("./createNodesFromMarkup"),emptyFunction=require("./emptyFunction"),getMarkupWrap=require("./getMarkupWrap"),invariant=require("./invariant"),OPEN_TAG_NAME_EXP=/^(<[^ \/>]+)/,RESULT_INDEX_ATTR="data-danger-index",Danger={dangerouslyRenderMarkup:function(e){"production"!==process.env.NODE_ENV?invariant(ExecutionEnvironment.canUseDOM,"dangerouslyRenderMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use React.renderToString for server rendering."):invariant(ExecutionEnvironment.canUseDOM);for(var r,n={},a=0;a 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 React.renderToString()."):invariant("html"!==e.tagName.toLowerCase());var n=createNodesFromMarkup(r,emptyFunction)[0];e.parentNode.replaceChild(n,e)}};module.exports=Danger; +"use strict";function getNodeName(e){return e.substring(1,e.indexOf(" "))}var ExecutionEnvironment=require("fbjs/lib/ExecutionEnvironment"),createNodesFromMarkup=require("fbjs/lib/createNodesFromMarkup"),emptyFunction=require("fbjs/lib/emptyFunction"),getMarkupWrap=require("fbjs/lib/getMarkupWrap"),invariant=require("fbjs/lib/invariant"),OPEN_TAG_NAME_EXP=/^(<[^ \/>]+)/,RESULT_INDEX_ATTR="data-danger-index",Danger={dangerouslyRenderMarkup:function(e){ExecutionEnvironment.canUseDOM?void 0:"production"!==process.env.NODE_ENV?invariant(!1,"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(!1);for(var r,n={},a=0;a 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(!1):void 0;var n;n="string"==typeof r?createNodesFromMarkup(r,emptyFunction)[0]:r,e.parentNode.replaceChild(n,e)}};module.exports=Danger; }).call(this,require('_process')) -},{"./ExecutionEnvironment":327,"./createNodesFromMarkup":432,"./emptyFunction":435,"./getMarkupWrap":448,"./invariant":456,"_process":498}],319:[function(require,module,exports){ -"use strict";var keyOf=require("./keyOf"),DefaultEventPluginOrder=[keyOf({ResponderEventPlugin:null}),keyOf({SimpleEventPlugin:null}),keyOf({TapEventPlugin:null}),keyOf({EnterLeaveEventPlugin:null}),keyOf({ChangeEventPlugin:null}),keyOf({SelectEventPlugin:null}),keyOf({BeforeInputEventPlugin:null}),keyOf({AnalyticsEventPlugin:null}),keyOf({MobileSafariClickEventPlugin:null})];module.exports=DefaultEventPluginOrder; +},{"_process":311,"fbjs/lib/ExecutionEnvironment":15,"fbjs/lib/createNodesFromMarkup":20,"fbjs/lib/emptyFunction":21,"fbjs/lib/getMarkupWrap":25,"fbjs/lib/invariant":29}],334:[function(require,module,exports){ +"use strict";var keyOf=require("fbjs/lib/keyOf"),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; -},{"./keyOf":463}],320:[function(require,module,exports){ -"use strict";var EventConstants=require("./EventConstants"),EventPropagators=require("./EventPropagators"),SyntheticMouseEvent=require("./SyntheticMouseEvent"),ReactMount=require("./ReactMount"),keyOf=require("./keyOf"),topLevelTypes=EventConstants.topLevelTypes,getFirstReactDOM=ReactMount.getFirstReactDOM,eventTypes={mouseEnter:{registrationName:keyOf({onMouseEnter:null}),dependencies:[topLevelTypes.topMouseOut,topLevelTypes.topMouseOver]},mouseLeave:{registrationName:keyOf({onMouseLeave:null}),dependencies:[topLevelTypes.topMouseOut,topLevelTypes.topMouseOver]}},extractedEvents=[null,null],EnterLeaveEventPlugin={eventTypes:eventTypes,extractEvents:function(e,t,n,o){if(e===topLevelTypes.topMouseOver&&(o.relatedTarget||o.fromElement))return null;if(e!==topLevelTypes.topMouseOut&&e!==topLevelTypes.topMouseOver)return null;var r;if(t.window===t)r=t;else{var s=t.ownerDocument;r=s?s.defaultView||s.parentWindow:window}var a,u;if(e===topLevelTypes.topMouseOut?(a=t,u=getFirstReactDOM(o.relatedTarget||o.toElement)||r):(a=r,u=t),a===u)return null;var v=a?ReactMount.getID(a):"",p=u?ReactMount.getID(u):"",l=SyntheticMouseEvent.getPooled(eventTypes.mouseLeave,v,o);l.type="mouseleave",l.target=a,l.relatedTarget=u;var i=SyntheticMouseEvent.getPooled(eventTypes.mouseEnter,p,o);return i.type="mouseenter",i.target=u,i.relatedTarget=a,EventPropagators.accumulateEnterLeaveDispatches(l,i,v,p),extractedEvents[0]=l,extractedEvents[1]=i,extractedEvents}};module.exports=EnterLeaveEventPlugin; +},{"fbjs/lib/keyOf":33}],335:[function(require,module,exports){ +"use strict";var EventConstants=require("./EventConstants"),EventPropagators=require("./EventPropagators"),SyntheticMouseEvent=require("./SyntheticMouseEvent"),ReactMount=require("./ReactMount"),keyOf=require("fbjs/lib/keyOf"),topLevelTypes=EventConstants.topLevelTypes,getFirstReactDOM=ReactMount.getFirstReactDOM,eventTypes={mouseEnter:{registrationName:keyOf({onMouseEnter:null}),dependencies:[topLevelTypes.topMouseOut,topLevelTypes.topMouseOver]},mouseLeave:{registrationName:keyOf({onMouseLeave:null}),dependencies:[topLevelTypes.topMouseOut,topLevelTypes.topMouseOver]}},extractedEvents=[null,null],EnterLeaveEventPlugin={eventTypes:eventTypes,extractEvents:function(e,t,n,o,r){if(e===topLevelTypes.topMouseOver&&(o.relatedTarget||o.fromElement))return null;if(e!==topLevelTypes.topMouseOut&&e!==topLevelTypes.topMouseOver)return null;var s;if(t.window===t)s=t;else{var a=t.ownerDocument;s=a?a.defaultView||a.parentWindow:window}var u,v,p="",l="";if(e===topLevelTypes.topMouseOut?(u=t,p=n,v=getFirstReactDOM(o.relatedTarget||o.toElement),v?l=ReactMount.getID(v):v=s,v=v||s):(u=s,v=t,l=n),u===v)return null;var i=SyntheticMouseEvent.getPooled(eventTypes.mouseLeave,p,o,r);i.type="mouseleave",i.target=u,i.relatedTarget=v;var y=SyntheticMouseEvent.getPooled(eventTypes.mouseEnter,l,o,r);return y.type="mouseenter",y.target=v,y.relatedTarget=u,EventPropagators.accumulateEnterLeaveDispatches(i,y,p,l),extractedEvents[0]=i,extractedEvents[1]=y,extractedEvents}};module.exports=EnterLeaveEventPlugin; -},{"./EventConstants":321,"./EventPropagators":326,"./ReactMount":382,"./SyntheticMouseEvent":418,"./keyOf":463}],321:[function(require,module,exports){ -"use strict";var keyMirror=require("./keyMirror"),PropagationPhases=keyMirror({bubbled:null,captured:null}),topLevelTypes=keyMirror({topBlur: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,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topReset:null,topScroll:null,topSelectionChange:null,topSubmit:null,topTextInput:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topWheel:null}),EventConstants={topLevelTypes:topLevelTypes,PropagationPhases:PropagationPhases};module.exports=EventConstants; - -},{"./keyMirror":462}],322:[function(require,module,exports){ -(function (process){ -var emptyFunction=require("./emptyFunction"),EventListener={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):("production"!==process.env.NODE_ENV&&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."),{remove:emptyFunction})},registerDefault:function(){}};module.exports=EventListener; +},{"./EventConstants":336,"./EventPropagators":340,"./ReactMount":388,"./SyntheticMouseEvent":419,"fbjs/lib/keyOf":33}],336:[function(require,module,exports){ +"use strict";var keyMirror=require("fbjs/lib/keyMirror"),PropagationPhases=keyMirror({bubbled:null,captured:null}),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}),EventConstants={topLevelTypes:topLevelTypes,PropagationPhases:PropagationPhases};module.exports=EventConstants; -}).call(this,require('_process')) -},{"./emptyFunction":435,"_process":498}],323:[function(require,module,exports){ +},{"fbjs/lib/keyMirror":32}],337:[function(require,module,exports){ (function (process){ -"use strict";function validateInstanceHandle(){var e=InstanceHandle&&InstanceHandle.traverseTwoPhase&&InstanceHandle.traverseEnterLeave;"production"!==process.env.NODE_ENV?invariant(e,"InstanceHandle not injected before use!"):invariant(e)}var EventPluginRegistry=require("./EventPluginRegistry"),EventPluginUtils=require("./EventPluginUtils"),accumulateInto=require("./accumulateInto"),forEachAccumulated=require("./forEachAccumulated"),invariant=require("./invariant"),listenerBank={},eventQueue=null,executeDispatchesAndRelease=function(e){if(e){var n=EventPluginUtils.executeDispatch,t=EventPluginRegistry.getPluginModuleForEvent(e);t&&t.executeDispatch&&(n=t.executeDispatch),EventPluginUtils.executeDispatchesInOrder(e,n),e.isPersistent()||e.constructor.release(e)}},InstanceHandle=null,EventPluginHub={injection:{injectMount:EventPluginUtils.injection.injectMount,injectInstanceHandle:function(e){InstanceHandle=e,"production"!==process.env.NODE_ENV&&validateInstanceHandle()},getInstanceHandle:function(){return"production"!==process.env.NODE_ENV&&validateInstanceHandle(),InstanceHandle},injectEventPluginOrder:EventPluginRegistry.injectEventPluginOrder,injectEventPluginsByName:EventPluginRegistry.injectEventPluginsByName},eventNameDispatchConfigs:EventPluginRegistry.eventNameDispatchConfigs,registrationNameModules:EventPluginRegistry.registrationNameModules,putListener:function(e,n,t){"production"!==process.env.NODE_ENV?invariant(!t||"function"==typeof t,"Expected %s listener to be a function, instead got type %s",n,typeof t):invariant(!t||"function"==typeof t);var i=listenerBank[n]||(listenerBank[n]={});i[e]=t},getListener:function(e,n){var t=listenerBank[n];return t&&t[e]},deleteListener:function(e,n){var t=listenerBank[n];t&&delete t[e]},deleteAllListeners:function(e){for(var n in listenerBank)delete listenerBank[n][e]},extractEvents:function(e,n,t,i){for(var u,a=EventPluginRegistry.plugins,r=0,s=a.length;s>r;r++){var c=a[r];if(c){var l=c.extractEvents(e,n,t,i);l&&(u=accumulateInto(u,l))}}return u},enqueueEvents:function(e){e&&(eventQueue=accumulateInto(eventQueue,e))},processEventQueue:function(){var e=eventQueue;eventQueue=null,forEachAccumulated(e,executeDispatchesAndRelease),"production"!==process.env.NODE_ENV?invariant(!eventQueue,"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."):invariant(!eventQueue)},__purge:function(){listenerBank={}},__getListenerBank:function(){return listenerBank}};module.exports=EventPluginHub; +"use strict";function validateInstanceHandle(){var e=InstanceHandle&&InstanceHandle.traverseTwoPhase&&InstanceHandle.traverseEnterLeave;"production"!==process.env.NODE_ENV?warning(e,"InstanceHandle not injected before use!"):void 0}var EventPluginRegistry=require("./EventPluginRegistry"),EventPluginUtils=require("./EventPluginUtils"),ReactErrorUtils=require("./ReactErrorUtils"),accumulateInto=require("./accumulateInto"),forEachAccumulated=require("./forEachAccumulated"),invariant=require("fbjs/lib/invariant"),warning=require("fbjs/lib/warning"),listenerBank={},eventQueue=null,executeDispatchesAndRelease=function(e,n){e&&(EventPluginUtils.executeDispatchesInOrder(e,n),e.isPersistent()||e.constructor.release(e))},executeDispatchesAndReleaseSimulated=function(e){return executeDispatchesAndRelease(e,!0)},executeDispatchesAndReleaseTopLevel=function(e){return executeDispatchesAndRelease(e,!1)},InstanceHandle=null,EventPluginHub={injection:{injectMount:EventPluginUtils.injection.injectMount,injectInstanceHandle:function(e){InstanceHandle=e,"production"!==process.env.NODE_ENV&&validateInstanceHandle()},getInstanceHandle:function(){return"production"!==process.env.NODE_ENV&&validateInstanceHandle(),InstanceHandle},injectEventPluginOrder:EventPluginRegistry.injectEventPluginOrder,injectEventPluginsByName:EventPluginRegistry.injectEventPluginsByName},eventNameDispatchConfigs:EventPluginRegistry.eventNameDispatchConfigs,registrationNameModules:EventPluginRegistry.registrationNameModules,putListener:function(e,n,t){"function"!=typeof t?"production"!==process.env.NODE_ENV?invariant(!1,"Expected %s listener to be a function, instead got type %s",n,typeof t):invariant(!1):void 0;var i=listenerBank[n]||(listenerBank[n]={});i[e]=t;var r=EventPluginRegistry.registrationNameModules[n];r&&r.didPutListener&&r.didPutListener(e,n,t)},getListener:function(e,n){var t=listenerBank[n];return t&&t[e]},deleteListener:function(e,n){var t=EventPluginRegistry.registrationNameModules[n];t&&t.willDeleteListener&&t.willDeleteListener(e,n);var i=listenerBank[n];i&&delete i[e]},deleteAllListeners:function(e){for(var n in listenerBank)if(listenerBank[n][e]){var t=EventPluginRegistry.registrationNameModules[n];t&&t.willDeleteListener&&t.willDeleteListener(e,n),delete listenerBank[n][e]}},extractEvents:function(e,n,t,i,r){for(var a,s=EventPluginRegistry.plugins,u=0;u-1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",n):invariant(i>-1),!EventPluginRegistry.plugins[i]){"production"!==process.env.NODE_ENV?invariant(e.extractEvents,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",n):invariant(e.extractEvents),EventPluginRegistry.plugins[i]=e;var t=e.eventTypes;for(var r in t)"production"!==process.env.NODE_ENV?invariant(publishEventForPlugin(t[r],e,r),"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",r,n):invariant(publishEventForPlugin(t[r],e,r))}}}function publishEventForPlugin(n,e,i){"production"!==process.env.NODE_ENV?invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(i),"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",i):invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(i)),EventPluginRegistry.eventNameDispatchConfigs[i]=n;var t=n.phasedRegistrationNames;if(t){for(var r in t)if(t.hasOwnProperty(r)){var s=t[r];publishRegistrationName(s,e,i)}return!0}return n.registrationName?(publishRegistrationName(n.registrationName,e,i),!0):!1}function publishRegistrationName(n,e,i){"production"!==process.env.NODE_ENV?invariant(!EventPluginRegistry.registrationNameModules[n],"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",n):invariant(!EventPluginRegistry.registrationNameModules[n]),EventPluginRegistry.registrationNameModules[n]=e,EventPluginRegistry.registrationNameDependencies[n]=e.eventTypes[i].dependencies}var invariant=require("./invariant"),EventPluginOrder=null,namesToPlugins={},EventPluginRegistry={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(n){"production"!==process.env.NODE_ENV?invariant(!EventPluginOrder,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."):invariant(!EventPluginOrder),EventPluginOrder=Array.prototype.slice.call(n),recomputePluginOrdering()},injectEventPluginsByName:function(n){var e=!1;for(var i in n)if(n.hasOwnProperty(i)){var t=n[i];namesToPlugins.hasOwnProperty(i)&&namesToPlugins[i]===t||("production"!==process.env.NODE_ENV?invariant(!namesToPlugins[i],"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",i):invariant(!namesToPlugins[i]),namesToPlugins[i]=t,e=!0)}e&&recomputePluginOrdering()},getPluginModuleForEvent:function(n){var e=n.dispatchConfig;if(e.registrationName)return EventPluginRegistry.registrationNameModules[e.registrationName]||null;for(var i in e.phasedRegistrationNames)if(e.phasedRegistrationNames.hasOwnProperty(i)){var t=EventPluginRegistry.registrationNameModules[e.phasedRegistrationNames[i]];if(t)return t}return null},_resetEventPlugins:function(){EventPluginOrder=null;for(var n in namesToPlugins)namesToPlugins.hasOwnProperty(n)&&delete namesToPlugins[n];EventPluginRegistry.plugins.length=0;var e=EventPluginRegistry.eventNameDispatchConfigs;for(var i in e)e.hasOwnProperty(i)&&delete e[i];var t=EventPluginRegistry.registrationNameModules;for(var r in t)t.hasOwnProperty(r)&&delete t[r]}};module.exports=EventPluginRegistry; +"use strict";function recomputePluginOrdering(){if(EventPluginOrder)for(var n in namesToPlugins){var e=namesToPlugins[n],i=EventPluginOrder.indexOf(n);if(i>-1?void 0:"production"!==process.env.NODE_ENV?invariant(!1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",n):invariant(!1),!EventPluginRegistry.plugins[i]){e.extractEvents?void 0:"production"!==process.env.NODE_ENV?invariant(!1,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",n):invariant(!1),EventPluginRegistry.plugins[i]=e;var t=e.eventTypes;for(var r in t)publishEventForPlugin(t[r],e,r)?void 0:"production"!==process.env.NODE_ENV?invariant(!1,"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",r,n):invariant(!1)}}}function publishEventForPlugin(n,e,i){EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(i)?"production"!==process.env.NODE_ENV?invariant(!1,"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",i):invariant(!1):void 0,EventPluginRegistry.eventNameDispatchConfigs[i]=n;var t=n.phasedRegistrationNames;if(t){for(var r in t)if(t.hasOwnProperty(r)){var s=t[r];publishRegistrationName(s,e,i)}return!0}return n.registrationName?(publishRegistrationName(n.registrationName,e,i),!0):!1}function publishRegistrationName(n,e,i){EventPluginRegistry.registrationNameModules[n]?"production"!==process.env.NODE_ENV?invariant(!1,"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",n):invariant(!1):void 0,EventPluginRegistry.registrationNameModules[n]=e,EventPluginRegistry.registrationNameDependencies[n]=e.eventTypes[i].dependencies}var invariant=require("fbjs/lib/invariant"),EventPluginOrder=null,namesToPlugins={},EventPluginRegistry={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(n){EventPluginOrder?"production"!==process.env.NODE_ENV?invariant(!1,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."):invariant(!1):void 0,EventPluginOrder=Array.prototype.slice.call(n),recomputePluginOrdering()},injectEventPluginsByName:function(n){var e=!1;for(var i in n)if(n.hasOwnProperty(i)){var t=n[i];namesToPlugins.hasOwnProperty(i)&&namesToPlugins[i]===t||(namesToPlugins[i]?"production"!==process.env.NODE_ENV?invariant(!1,"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",i):invariant(!1):void 0,namesToPlugins[i]=t,e=!0)}e&&recomputePluginOrdering()},getPluginModuleForEvent:function(n){var e=n.dispatchConfig;if(e.registrationName)return EventPluginRegistry.registrationNameModules[e.registrationName]||null;for(var i in e.phasedRegistrationNames)if(e.phasedRegistrationNames.hasOwnProperty(i)){var t=EventPluginRegistry.registrationNameModules[e.phasedRegistrationNames[i]];if(t)return t}return null},_resetEventPlugins:function(){EventPluginOrder=null;for(var n in namesToPlugins)namesToPlugins.hasOwnProperty(n)&&delete namesToPlugins[n];EventPluginRegistry.plugins.length=0;var e=EventPluginRegistry.eventNameDispatchConfigs;for(var i in e)e.hasOwnProperty(i)&&delete e[i];var t=EventPluginRegistry.registrationNameModules;for(var r in t)t.hasOwnProperty(r)&&delete t[r]}};module.exports=EventPluginRegistry; }).call(this,require('_process')) -},{"./invariant":456,"_process":498}],325:[function(require,module,exports){ +},{"_process":311,"fbjs/lib/invariant":29}],339:[function(require,module,exports){ (function (process){ -"use strict";function isEndish(e){return e===topLevelTypes.topMouseUp||e===topLevelTypes.topTouchEnd||e===topLevelTypes.topTouchCancel}function isMoveish(e){return e===topLevelTypes.topMouseMove||e===topLevelTypes.topTouchMove}function isStartish(e){return e===topLevelTypes.topMouseDown||e===topLevelTypes.topTouchStart}function forEachEventDispatch(e,t){var n=e._dispatchListeners,s=e._dispatchIDs;if("production"!==process.env.NODE_ENV&&validateEventDispatches(e),Array.isArray(n))for(var i=0;it&&o[t]===a[t];t++);var l=s-t;for(e=1;l>=e&&o[s-e]===a[i-e];e++);var r=e>1?1-e:void 0;return this._fallbackText=a.slice(t,r),this._fallbackText}}),PooledClass.addPoolingTo(FallbackCompositionState),module.exports=FallbackCompositionState; - -},{"./Object.assign":334,"./PooledClass":335,"./getTextContentAccessor":451}],329:[function(require,module,exports){ -"use strict";var DOMProperty=require("./DOMProperty"),ExecutionEnvironment=require("./ExecutionEnvironment"),MUST_USE_ATTRIBUTE=DOMProperty.injection.MUST_USE_ATTRIBUTE,MUST_USE_PROPERTY=DOMProperty.injection.MUST_USE_PROPERTY,HAS_BOOLEAN_VALUE=DOMProperty.injection.HAS_BOOLEAN_VALUE,HAS_SIDE_EFFECTS=DOMProperty.injection.HAS_SIDE_EFFECTS,HAS_NUMERIC_VALUE=DOMProperty.injection.HAS_NUMERIC_VALUE,HAS_POSITIVE_NUMERIC_VALUE=DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE,HAS_OVERLOADED_BOOLEAN_VALUE=DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE,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:{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,autoPlay:HAS_BOOLEAN_VALUE,cellPadding:null,cellSpacing:null,charSet:MUST_USE_ATTRIBUTE,checked:MUST_USE_PROPERTY|HAS_BOOLEAN_VALUE,classID:MUST_USE_ATTRIBUTE,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,dateTime:MUST_USE_ATTRIBUTE,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,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,multiple:MUST_USE_PROPERTY|HAS_BOOLEAN_VALUE,muted:MUST_USE_PROPERTY|HAS_BOOLEAN_VALUE,name:null,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,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,srcSet:MUST_USE_ATTRIBUTE,start:HAS_NUMERIC_VALUE,step:null,style: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,autoCapitalize:null,autoCorrect:null,itemProp:MUST_USE_ATTRIBUTE,itemScope:MUST_USE_ATTRIBUTE|HAS_BOOLEAN_VALUE,itemType:MUST_USE_ATTRIBUTE,itemID:MUST_USE_ATTRIBUTE,itemRef:MUST_USE_ATTRIBUTE,property:null,unselectable:MUST_USE_ATTRIBUTE},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};module.exports=HTMLDOMPropertyConfig; +},{"./EventConstants":336,"./EventPluginHub":337,"./accumulateInto":425,"./forEachAccumulated":433,"_process":311,"fbjs/lib/warning":40}],341:[function(require,module,exports){ +"use strict";function FallbackCompositionState(t){this._root=t,this._startText=this.getText(),this._fallbackText=null}var PooledClass=require("./PooledClass"),assign=require("./Object.assign"),getTextContentAccessor=require("./getTextContentAccessor");assign(FallbackCompositionState.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[getTextContentAccessor()]},getData:function(){if(this._fallbackText)return this._fallbackText;var t,e,o=this._startText,s=o.length,a=this.getText(),l=a.length;for(t=0;s>t&&o[t]===a[t];t++);var i=s-t;for(e=1;i>=e&&o[s-e]===a[l-e];e++);var r=e>1?1-e:void 0;return this._fallbackText=a.slice(t,r),this._fallbackText}}),PooledClass.addPoolingTo(FallbackCompositionState),module.exports=FallbackCompositionState; -},{"./DOMProperty":316,"./ExecutionEnvironment":327}],330:[function(require,module,exports){ -"use strict";var ReactLink=require("./ReactLink"),ReactStateSetters=require("./ReactStateSetters"),LinkedStateMixin={linkState:function(t){return new ReactLink(this.state[t],ReactStateSetters.createStateKeySetter(this,t))}};module.exports=LinkedStateMixin; +},{"./Object.assign":344,"./PooledClass":345,"./getTextContentAccessor":440}],342:[function(require,module,exports){ +"use strict";var DOMProperty=require("./DOMProperty"),ExecutionEnvironment=require("fbjs/lib/ExecutionEnvironment"),MUST_USE_ATTRIBUTE=DOMProperty.injection.MUST_USE_ATTRIBUTE,MUST_USE_PROPERTY=DOMProperty.injection.MUST_USE_PROPERTY,HAS_BOOLEAN_VALUE=DOMProperty.injection.HAS_BOOLEAN_VALUE,HAS_SIDE_EFFECTS=DOMProperty.injection.HAS_SIDE_EFFECTS,HAS_NUMERIC_VALUE=DOMProperty.injection.HAS_NUMERIC_VALUE,HAS_POSITIVE_NUMERIC_VALUE=DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE,HAS_OVERLOADED_BOOLEAN_VALUE=DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE,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:{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,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,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,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,about:MUST_USE_ATTRIBUTE,datatype:MUST_USE_ATTRIBUTE,inlist:MUST_USE_ATTRIBUTE,prefix:MUST_USE_ATTRIBUTE,property:MUST_USE_ATTRIBUTE,resource:MUST_USE_ATTRIBUTE,"typeof":MUST_USE_ATTRIBUTE,vocab:MUST_USE_ATTRIBUTE,autoCapitalize:null,autoCorrect:null,autoSave:null,color:null,itemProp:MUST_USE_ATTRIBUTE,itemScope:MUST_USE_ATTRIBUTE|HAS_BOOLEAN_VALUE,itemType:MUST_USE_ATTRIBUTE,itemID:MUST_USE_ATTRIBUTE,itemRef:MUST_USE_ATTRIBUTE,results:null,security:MUST_USE_ATTRIBUTE,unselectable:MUST_USE_ATTRIBUTE},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",autoSave:"autosave",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};module.exports=HTMLDOMPropertyConfig; -},{"./ReactLink":380,"./ReactStateSetters":399}],331:[function(require,module,exports){ +},{"./DOMProperty":331,"fbjs/lib/ExecutionEnvironment":15}],343:[function(require,module,exports){ (function (process){ -"use strict";function _assertSingleLink(e){"production"!==process.env.NODE_ENV?invariant(null==e.props.checkedLink||null==e.props.valueLink,"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(null==e.props.checkedLink||null==e.props.valueLink)}function _assertValueLink(e){_assertSingleLink(e),"production"!==process.env.NODE_ENV?invariant(null==e.props.value&&null==e.props.onChange,"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(null==e.props.value&&null==e.props.onChange)}function _assertCheckedLink(e){_assertSingleLink(e),"production"!==process.env.NODE_ENV?invariant(null==e.props.checked&&null==e.props.onChange,"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(null==e.props.checked&&null==e.props.onChange)}function _handleLinkedValueChange(e){this.props.valueLink.requestChange(e.target.value)}function _handleLinkedCheckChange(e){this.props.checkedLink.requestChange(e.target.checked)}var ReactPropTypes=require("./ReactPropTypes"),invariant=require("./invariant"),hasReadOnlyValue={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},LinkedValueUtils={Mixin:{propTypes:{value:function(e,n,a){return!e[n]||hasReadOnlyValue[e.type]||e.onChange||e.readOnly||e.disabled?null: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(e,n,a){return!e[n]||e.onChange||e.readOnly||e.disabled?null: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}},getValue:function(e){return e.props.valueLink?(_assertValueLink(e),e.props.valueLink.value):e.props.value},getChecked:function(e){return e.props.checkedLink?(_assertCheckedLink(e),e.props.checkedLink.value):e.props.checked},getOnChange:function(e){return e.props.valueLink?(_assertValueLink(e),_handleLinkedValueChange):e.props.checkedLink?(_assertCheckedLink(e),_handleLinkedCheckChange):e.props.onChange}};module.exports=LinkedValueUtils; +"use strict";function _assertSingleLink(e){null!=e.checkedLink&&null!=e.valueLink?"production"!==process.env.NODE_ENV?invariant(!1,"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(!1):void 0}function _assertValueLink(e){_assertSingleLink(e),null!=e.value||null!=e.onChange?"production"!==process.env.NODE_ENV?invariant(!1,"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(!1):void 0}function _assertCheckedLink(e){_assertSingleLink(e),null!=e.checked||null!=e.onChange?"production"!==process.env.NODE_ENV?invariant(!1,"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(!1):void 0}function getDeclarationErrorAddendum(e){if(e){var n=e.getName();if(n)return" Check the render method of `"+n+"`."}return""}var ReactPropTypes=require("./ReactPropTypes"),ReactPropTypeLocations=require("./ReactPropTypeLocations"),invariant=require("fbjs/lib/invariant"),warning=require("fbjs/lib/warning"),hasReadOnlyValue={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},propTypes={value:function(e,n,a){return!e[n]||hasReadOnlyValue[e.type]||e.onChange||e.readOnly||e.disabled?null: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(e,n,a){return!e[n]||e.onChange||e.readOnly||e.disabled?null: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},loggedTypeFailures={},LinkedValueUtils={checkPropTypes:function(e,n,a){for(var r in propTypes){if(propTypes.hasOwnProperty(r))var o=propTypes[r](n,r,e,ReactPropTypeLocations.prop);if(o instanceof Error&&!(o.message in loggedTypeFailures)){loggedTypeFailures[o.message]=!0;var i=getDeclarationErrorAddendum(a);"production"!==process.env.NODE_ENV?warning(!1,"Failed form propType: %s%s",o.message,i):void 0}}},getValue:function(e){return e.valueLink?(_assertValueLink(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(_assertCheckedLink(e),e.checkedLink.value):e.checked},executeOnChange:function(e,n){return e.valueLink?(_assertValueLink(e),e.valueLink.requestChange(n.target.value)):e.checkedLink?(_assertCheckedLink(e),e.checkedLink.requestChange(n.target.checked)):e.onChange?e.onChange.call(void 0,n):void 0}};module.exports=LinkedValueUtils; }).call(this,require('_process')) -},{"./ReactPropTypes":391,"./invariant":456,"_process":498}],332:[function(require,module,exports){ -(function (process){ -"use strict";function remove(e){e.remove()}var ReactBrowserEventEmitter=require("./ReactBrowserEventEmitter"),accumulateInto=require("./accumulateInto"),forEachAccumulated=require("./forEachAccumulated"),invariant=require("./invariant"),LocalEventTrapMixin={trapBubbledEvent:function(e,t){"production"!==process.env.NODE_ENV?invariant(this.isMounted(),"Must be mounted to trap events"):invariant(this.isMounted());var n=this.getDOMNode();"production"!==process.env.NODE_ENV?invariant(n,"LocalEventTrapMixin.trapBubbledEvent(...): Requires node to be rendered."):invariant(n);var r=ReactBrowserEventEmitter.trapBubbledEvent(e,t,n);this._localEventListeners=accumulateInto(this._localEventListeners,r)},componentWillUnmount:function(){this._localEventListeners&&forEachAccumulated(this._localEventListeners,remove)}};module.exports=LocalEventTrapMixin; - -}).call(this,require('_process')) -},{"./ReactBrowserEventEmitter":338,"./accumulateInto":424,"./forEachAccumulated":441,"./invariant":456,"_process":498}],333:[function(require,module,exports){ -"use strict";var EventConstants=require("./EventConstants"),emptyFunction=require("./emptyFunction"),topLevelTypes=EventConstants.topLevelTypes,MobileSafariClickEventPlugin={eventTypes:null,extractEvents:function(t,e,n,i){if(t===topLevelTypes.topTouchStart){var o=i.target;o&&!o.onclick&&(o.onclick=emptyFunction)}}};module.exports=MobileSafariClickEventPlugin; - -},{"./EventConstants":321,"./emptyFunction":435}],334:[function(require,module,exports){ +},{"./ReactPropTypeLocations":396,"./ReactPropTypes":397,"_process":311,"fbjs/lib/invariant":29,"fbjs/lib/warning":40}],344:[function(require,module,exports){ "use strict";function assign(r,e){if(null==r)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(r),t=Object.prototype.hasOwnProperty,a=1;a-1&&"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&console.debug("Download the React DevTools for a better development experience: https://fb.me/react-devtools");for(var expectedFeatures=[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,Object.create,Object.freeze],i=0;is;s++){var p=o[s];n.hasOwnProperty(p)&&n[p]||(p===i.topWheel?isEventSupported("wheel")?ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(i.topWheel,"wheel",r):isEventSupported("mousewheel")?ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(i.topWheel,"mousewheel",r):ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(i.topWheel,"DOMMouseScroll",r):p===i.topScroll?isEventSupported("scroll",!0)?ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(i.topScroll,"scroll",r):ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(i.topScroll,"scroll",ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE):p===i.topFocus||p===i.topBlur?(isEventSupported("focus",!0)?(ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(i.topFocus,"focus",r),ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(i.topBlur,"blur",r)):isEventSupported("focusin")&&(ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(i.topFocus,"focusin",r),ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(i.topBlur,"focusout",r)),n[i.topBlur]=!0,n[i.topFocus]=!0):topEventMapping.hasOwnProperty(p)&&ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(p,topEventMapping[p],r),n[p]=!0)}},trapBubbledEvent:function(e,t,r){return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(e,t,r)},trapCapturedEvent:function(e,t,r){return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(e,t,r)},ensureScrollValueMonitoring:function(){if(!isMonitoringScrollValue){var e=ViewportMetrics.refreshScrollValues;ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(e),isMonitoringScrollValue=!0}},eventNameDispatchConfigs:EventPluginHub.eventNameDispatchConfigs,registrationNameModules:EventPluginHub.registrationNameModules,putListener:EventPluginHub.putListener,getListener:EventPluginHub.getListener,deleteListener:EventPluginHub.deleteListener,deleteAllListeners:EventPluginHub.deleteAllListeners});module.exports=ReactBrowserEventEmitter; +},{"_process":311,"fbjs/lib/invariant":29}],346:[function(require,module,exports){ +"use strict";var ReactDOM=require("./ReactDOM"),ReactDOMServer=require("./ReactDOMServer"),ReactIsomorphic=require("./ReactIsomorphic"),assign=require("./Object.assign"),deprecated=require("./deprecated"),React={};assign(React,ReactIsomorphic),assign(React,{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),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; -},{"./EventConstants":321,"./EventPluginHub":323,"./EventPluginRegistry":324,"./Object.assign":334,"./ReactEventEmitterMixin":372,"./ViewportMetrics":423,"./isEventSupported":457}],339:[function(require,module,exports){ -"use strict";var React=require("./React"),assign=require("./Object.assign"),ReactTransitionGroup=React.createFactory(require("./ReactTransitionGroup")),ReactCSSTransitionGroupChild=React.createFactory(require("./ReactCSSTransitionGroupChild")),ReactCSSTransitionGroup=React.createClass({displayName:"ReactCSSTransitionGroup",propTypes:{transitionName:React.PropTypes.string.isRequired,transitionAppear:React.PropTypes.bool,transitionEnter:React.PropTypes.bool,transitionLeave:React.PropTypes.bool},getDefaultProps:function(){return{transitionAppear:!1,transitionEnter:!0,transitionLeave:!0}},_wrapChild:function(t){return ReactCSSTransitionGroupChild({name:this.props.transitionName,appear:this.props.transitionAppear,enter:this.props.transitionEnter,leave:this.props.transitionLeave},t)},render:function(){return ReactTransitionGroup(assign({},this.props,{childFactory:this._wrapChild}))}});module.exports=ReactCSSTransitionGroup; - -},{"./Object.assign":334,"./React":336,"./ReactCSSTransitionGroupChild":340,"./ReactTransitionGroup":403}],340:[function(require,module,exports){ +},{"./Object.assign":344,"./ReactDOM":358,"./ReactDOMServer":368,"./ReactIsomorphic":386,"./deprecated":429}],347:[function(require,module,exports){ (function (process){ -"use strict";var React=require("./React"),CSSCore=require("./CSSCore"),ReactTransitionEvents=require("./ReactTransitionEvents"),onlyChild=require("./onlyChild"),warning=require("./warning"),TICK=17,NO_EVENT_TIMEOUT=5e3,noEventListener=null;"production"!==process.env.NODE_ENV&&(noEventListener=function(){"production"!==process.env.NODE_ENV?warning(!1,"transition(): tried to perform an animation without an animationend or transitionend event after timeout (%sms). You should either disable this transition in JS or add a CSS animation/transition.",NO_EVENT_TIMEOUT):null});var ReactCSSTransitionGroupChild=React.createClass({displayName:"ReactCSSTransitionGroupChild",transition:function(e,t){var n=this.getDOMNode(),i=this.props.name+"-"+e,o=i+"-active",s=null,r=function(e){e&&e.target!==n||("production"!==process.env.NODE_ENV&&clearTimeout(s),CSSCore.removeClass(n,i),CSSCore.removeClass(n,o),ReactTransitionEvents.removeEndEventListener(n,r),t&&t())};ReactTransitionEvents.addEndEventListener(n,r),CSSCore.addClass(n,i),this.queueClass(o),"production"!==process.env.NODE_ENV&&(s=setTimeout(noEventListener,NO_EVENT_TIMEOUT))},queueClass:function(e){this.classNameQueue.push(e),this.timeout||(this.timeout=setTimeout(this.flushClassNameQueue,TICK))},flushClassNameQueue:function(){this.isMounted()&&this.classNameQueue.forEach(CSSCore.addClass.bind(CSSCore,this.getDOMNode())),this.classNameQueue.length=0,this.timeout=null},componentWillMount:function(){this.classNameQueue=[]},componentWillUnmount:function(){this.timeout&&clearTimeout(this.timeout)},componentWillAppear:function(e){this.props.appear?this.transition("appear",e):e()},componentWillEnter:function(e){this.props.enter?this.transition("enter",e):e()},componentWillLeave:function(e){this.props.leave?this.transition("leave",e):e()},render:function(){return onlyChild(this.props.children)}});module.exports=ReactCSSTransitionGroupChild; +"use strict";var ReactInstanceMap=require("./ReactInstanceMap"),findDOMNode=require("./findDOMNode"),warning=require("fbjs/lib/warning"),didWarnKey="_getDOMNodeDidWarn",ReactBrowserComponentMixin={getDOMNode:function(){return"production"!==process.env.NODE_ENV?warning(this.constructor[didWarnKey],"%s.getDOMNode(...) is deprecated. Please use ReactDOM.findDOMNode(instance) instead.",ReactInstanceMap.get(this).getName()||this.tagName||"Unknown"):void 0,this.constructor[didWarnKey]=!0,findDOMNode(this)}};module.exports=ReactBrowserComponentMixin; }).call(this,require('_process')) -},{"./CSSCore":309,"./React":336,"./ReactTransitionEvents":402,"./onlyChild":466,"./warning":477,"_process":498}],341:[function(require,module,exports){ -"use strict";var ReactReconciler=require("./ReactReconciler"),flattenChildren=require("./flattenChildren"),instantiateReactComponent=require("./instantiateReactComponent"),shouldUpdateReactComponent=require("./shouldUpdateReactComponent"),ReactChildReconciler={instantiateChildren:function(e,n,t){var r=flattenChildren(e);for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],i=instantiateReactComponent(a,null);r[o]=i}return r},updateChildren:function(e,n,t,r){var o=flattenChildren(n);if(!o&&!e)return null;var a;for(a in o)if(o.hasOwnProperty(a)){var i=e&&e[a],c=i&&i._currentElement,l=o[a];if(shouldUpdateReactComponent(c,l))ReactReconciler.receiveComponent(i,l,t,r),o[a]=i;else{i&&ReactReconciler.unmountComponent(i,a);var u=instantiateReactComponent(l,null);o[a]=u}}for(a in e)!e.hasOwnProperty(a)||o&&o.hasOwnProperty(a)||ReactReconciler.unmountComponent(e[a]);return o},unmountChildren:function(e){for(var n in e){var t=e[n];ReactReconciler.unmountComponent(t)}}};module.exports=ReactChildReconciler; +},{"./ReactInstanceMap":385,"./findDOMNode":431,"_process":311,"fbjs/lib/warning":40}],348:[function(require,module,exports){ +"use strict";function getListeningForDocument(e){return Object.prototype.hasOwnProperty.call(e,topListenersIDKey)||(e[topListenersIDKey]=reactTopListenersCounter++,alreadyListeningTo[e[topListenersIDKey]]={}),alreadyListeningTo[e[topListenersIDKey]]}var EventConstants=require("./EventConstants"),EventPluginHub=require("./EventPluginHub"),EventPluginRegistry=require("./EventPluginRegistry"),ReactEventEmitterMixin=require("./ReactEventEmitterMixin"),ReactPerf=require("./ReactPerf"),ViewportMetrics=require("./ViewportMetrics"),assign=require("./Object.assign"),isEventSupported=require("./isEventSupported"),alreadyListeningTo={},isMonitoringScrollValue=!1,reactTopListenersCounter=0,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"},topListenersIDKey="_reactListenersID"+String(Math.random()).slice(2),ReactBrowserEventEmitter=assign({},ReactEventEmitterMixin,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel),ReactBrowserEventEmitter.ReactEventListener=e}},setEnabled:function(e){ReactBrowserEventEmitter.ReactEventListener&&ReactBrowserEventEmitter.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!ReactBrowserEventEmitter.ReactEventListener||!ReactBrowserEventEmitter.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var r=t,n=getListeningForDocument(r),o=EventPluginRegistry.registrationNameDependencies[e],i=EventConstants.topLevelTypes,a=0;ac;c++)r.push(arguments[c]);if(i!==e&&null!==i)"production"!==process.env.NODE_ENV?warning(!1,"bind(): React component methods may only be bound to the component instance. See %s",o):null;else if(!r.length)return"production"!==process.env.NODE_ENV?warning(!1,"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",o):null,n;var p=a.apply(n,arguments);return p.__reactBoundContext=e,p.__reactBoundMethod=t,p.__reactBoundArguments=r,p}}return n}function bindAutoBindMethods(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=bindAutoBindMethod(e,ReactErrorUtils.guard(n,e.constructor.displayName+"."+t))}}var ReactComponent=require("./ReactComponent"),ReactCurrentOwner=require("./ReactCurrentOwner"),ReactElement=require("./ReactElement"),ReactErrorUtils=require("./ReactErrorUtils"),ReactInstanceMap=require("./ReactInstanceMap"),ReactLifeCycle=require("./ReactLifeCycle"),ReactPropTypeLocations=require("./ReactPropTypeLocations"),ReactPropTypeLocationNames=require("./ReactPropTypeLocationNames"),ReactUpdateQueue=require("./ReactUpdateQueue"),assign=require("./Object.assign"),invariant=require("./invariant"),keyMirror=require("./keyMirror"),keyOf=require("./keyOf"),warning=require("./warning"),MIXINS_KEY=keyOf({mixins:null}),SpecPolicy=keyMirror({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),injectedMixins=[],ReactClassInterface={mixins:SpecPolicy.DEFINE_MANY,statics:SpecPolicy.DEFINE_MANY,propTypes:SpecPolicy.DEFINE_MANY,contextTypes:SpecPolicy.DEFINE_MANY,childContextTypes:SpecPolicy.DEFINE_MANY,getDefaultProps:SpecPolicy.DEFINE_MANY_MERGED,getInitialState:SpecPolicy.DEFINE_MANY_MERGED,getChildContext:SpecPolicy.DEFINE_MANY_MERGED,render:SpecPolicy.DEFINE_ONCE,componentWillMount:SpecPolicy.DEFINE_MANY,componentDidMount:SpecPolicy.DEFINE_MANY,componentWillReceiveProps:SpecPolicy.DEFINE_MANY,shouldComponentUpdate:SpecPolicy.DEFINE_ONCE,componentWillUpdate:SpecPolicy.DEFINE_MANY,componentDidUpdate:SpecPolicy.DEFINE_MANY,componentWillUnmount:SpecPolicy.DEFINE_MANY,updateComponent:SpecPolicy.OVERRIDE_BASE},RESERVED_SPEC_KEYS={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n1?r-1:0),c=1;r>c;c++)s[c-1]=arguments[c];if(a!==e&&null!==a)"production"!==process.env.NODE_ENV?warning(!1,"bind(): React component methods may only be bound to the component instance. See %s",o):void 0;else if(!s.length)return"production"!==process.env.NODE_ENV?warning(!1,"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",o):void 0,n;var p=i.apply(n,arguments);return p.__reactBoundContext=e,p.__reactBoundMethod=t,p.__reactBoundArguments=s,p}}return n}function bindAutoBindMethods(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=bindAutoBindMethod(e,n)}}var ReactComponent=require("./ReactComponent"),ReactElement=require("./ReactElement"),ReactPropTypeLocations=require("./ReactPropTypeLocations"),ReactPropTypeLocationNames=require("./ReactPropTypeLocationNames"),ReactNoopUpdateQueue=require("./ReactNoopUpdateQueue"),assign=require("./Object.assign"),emptyObject=require("fbjs/lib/emptyObject"),invariant=require("fbjs/lib/invariant"),keyMirror=require("fbjs/lib/keyMirror"),keyOf=require("fbjs/lib/keyOf"),warning=require("fbjs/lib/warning"),MIXINS_KEY=keyOf({mixins:null}),SpecPolicy=keyMirror({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),injectedMixins=[],warnedSetProps=!1,ReactClassInterface={mixins:SpecPolicy.DEFINE_MANY,statics:SpecPolicy.DEFINE_MANY,propTypes:SpecPolicy.DEFINE_MANY,contextTypes:SpecPolicy.DEFINE_MANY,childContextTypes:SpecPolicy.DEFINE_MANY,getDefaultProps:SpecPolicy.DEFINE_MANY_MERGED,getInitialState:SpecPolicy.DEFINE_MANY_MERGED,getChildContext:SpecPolicy.DEFINE_MANY_MERGED,render:SpecPolicy.DEFINE_ONCE,componentWillMount:SpecPolicy.DEFINE_MANY,componentDidMount:SpecPolicy.DEFINE_MANY,componentWillReceiveProps:SpecPolicy.DEFINE_MANY,shouldComponentUpdate:SpecPolicy.DEFINE_ONCE,componentWillUpdate:SpecPolicy.DEFINE_MANY,componentDidUpdate:SpecPolicy.DEFINE_MANY,componentWillUnmount:SpecPolicy.DEFINE_MANY,updateComponent:SpecPolicy.OVERRIDE_BASE},RESERVED_SPEC_KEYS={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n-1&&-1===navigator.userAgent.indexOf("Edge")||navigator.userAgent.indexOf("Firefox")>-1)&&console.debug("Download the React DevTools for a better development experience: https://fb.me/react-devtools");var ieCompatibilityMode=document.documentMode&&document.documentMode<8;"production"!==process.env.NODE_ENV?warning(!ieCompatibilityMode,'Internet Explorer is running in compatibility mode; please add the following tag to your HTML to prevent this from happening: '):void 0;for(var expectedFeatures=[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,Object.create,Object.freeze],i=0;i";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t,n)+r},_createOpenTagMarkupAndPutListeners:function(e){var t=this._currentElement.props,n="<"+this._tag;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(null!=o)if(registrationNameModules.hasOwnProperty(r))putListener(this._rootNodeID,r,o,e);else{r===STYLE&&(o&&(o=this._previousStyleCopy=assign({},t.style)),o=CSSPropertyOperations.createMarkupForStyles(o));var i=DOMPropertyOperations.createMarkupForProperty(r,o);i&&(n+=" "+i)}}if(e.renderToStaticMarkup)return n+">";var a=DOMPropertyOperations.createMarkupForID(this._rootNodeID);return n+" "+a+">"},_createContentMarkup:function(e,t){var n="";("listing"===this._tag||"pre"===this._tag||"textarea"===this._tag)&&(n="\n");var r=this._currentElement.props,o=r.dangerouslySetInnerHTML;if(null!=o){if(null!=o.__html)return n+o.__html}else{var i=CONTENT_TYPES[typeof r.children]?r.children:null,a=null!=i?null:r.children;if(null!=i)return n+escapeTextContentForBrowser(i);if(null!=a){var s=this.mountChildren(a,e,t);return n+s.join("")}}return n},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){assertValidProps(this._currentElement.props),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e,r)},_updateDOMProperties:function(e,t){var n,r,o,i=this._currentElement.props;for(n in e)if(!i.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===STYLE){var a=this._previousStyleCopy;for(r in a)a.hasOwnProperty(r)&&(o=o||{},o[r]="");this._previousStyleCopy=null}else registrationNameModules.hasOwnProperty(n)?deleteListener(this._rootNodeID,n):(DOMProperty.isStandardName[n]||DOMProperty.isCustomAttribute(n))&&BackendIDOperations.deletePropertyByID(this._rootNodeID,n);for(n in i){var s=i[n],l=n===STYLE?this._previousStyleCopy:e[n];if(i.hasOwnProperty(n)&&s!==l)if(n===STYLE)if(s?s=this._previousStyleCopy=assign({},s):this._previousStyleCopy=null,l){for(r in l)!l.hasOwnProperty(r)||s&&s.hasOwnProperty(r)||(o=o||{},o[r]="");for(r in s)s.hasOwnProperty(r)&&l[r]!==s[r]&&(o=o||{},o[r]=s[r])}else o=s;else registrationNameModules.hasOwnProperty(n)?putListener(this._rootNodeID,n,s,t):(DOMProperty.isStandardName[n]||DOMProperty.isCustomAttribute(n))&&BackendIDOperations.updatePropertyByID(this._rootNodeID,n,s)}o&&BackendIDOperations.updateStylesByID(this._rootNodeID,o)},_updateDOMChildren:function(e,t,n){var r=this._currentElement.props,o=CONTENT_TYPES[typeof e.children]?e.children:null,i=CONTENT_TYPES[typeof r.children]?r.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=r.dangerouslySetInnerHTML&&r.dangerouslySetInnerHTML.__html,l=null!=o?null:e.children,p=null!=i?null:r.children,u=null!=o||null!=a,d=null!=i||null!=s;null!=l&&null==p?this.updateChildren(null,t,n):u&&!d&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=s?a!==s&&BackendIDOperations.updateInnerHTMLByID(this._rootNodeID,s):null!=p&&this.updateChildren(p,t,n)},unmountComponent:function(){this.unmountChildren(),ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID),ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},ReactPerf.measureMethods(ReactDOMComponent,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),assign(ReactDOMComponent.prototype,ReactDOMComponent.Mixin,ReactMultiChild.Mixin),ReactDOMComponent.injection={injectIDOperations:function(e){ReactDOMComponent.BackendIDOperations=BackendIDOperations=e}},module.exports=ReactDOMComponent; +"use strict";function getDeclarationErrorAddendum(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}function legacyGetDOMNode(){if("production"!==process.env.NODE_ENV){var e=this._reactInternalComponent;"production"!==process.env.NODE_ENV?warning(!1,"ReactDOMComponent: Do not access .getDOMNode() of a DOM node; instead, use the node directly.%s",getDeclarationErrorAddendum(e)):void 0}return this}function legacyIsMounted(){var e=this._reactInternalComponent;return"production"!==process.env.NODE_ENV&&("production"!==process.env.NODE_ENV?warning(!1,"ReactDOMComponent: Do not access .isMounted() of a DOM node.%s",getDeclarationErrorAddendum(e)):void 0),!!e}function legacySetStateEtc(){if("production"!==process.env.NODE_ENV){var e=this._reactInternalComponent;"production"!==process.env.NODE_ENV?warning(!1,"ReactDOMComponent: Do not access .setState(), .replaceState(), or .forceUpdate() of a DOM node. This is a no-op.%s",getDeclarationErrorAddendum(e)):void 0}}function legacySetProps(e,t){var n=this._reactInternalComponent;"production"!==process.env.NODE_ENV&&("production"!==process.env.NODE_ENV?warning(!1,"ReactDOMComponent: Do not access .setProps() of a DOM node. Instead, call ReactDOM.render again at the top level.%s",getDeclarationErrorAddendum(n)):void 0),n&&(ReactUpdateQueue.enqueueSetPropsInternal(n,e),t&&ReactUpdateQueue.enqueueCallbackInternal(n,t))}function legacyReplaceProps(e,t){var n=this._reactInternalComponent;"production"!==process.env.NODE_ENV&&("production"!==process.env.NODE_ENV?warning(!1,"ReactDOMComponent: Do not access .replaceProps() of a DOM node. Instead, call ReactDOM.render again at the top level.%s",getDeclarationErrorAddendum(n)):void 0),n&&(ReactUpdateQueue.enqueueReplacePropsInternal(n,e),t&&ReactUpdateQueue.enqueueCallbackInternal(n,t))}function friendlyStringify(e){if("object"==typeof e){if(Array.isArray(e))return"["+e.map(friendlyStringify).join(", ")+"]";var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=/^[a-z$_][\w$_]*$/i.test(n)?n:JSON.stringify(n);t.push(r+": "+friendlyStringify(e[n]))}return"{"+t.join(", ")+"}"}return"string"==typeof e?JSON.stringify(e):"function"==typeof e?"[function object]":String(e)}function checkAndWarnForMutatedStyle(e,t,n){if(null!=e&&null!=t&&!shallowEqual(e,t)){var r,o=n._tag,a=n._currentElement._owner;a&&(r=a.getName());var i=r+"|"+o;styleMutationWarning.hasOwnProperty(i)||(styleMutationWarning[i]=!0,"production"!==process.env.NODE_ENV?warning(!1,"`%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.",o,a?"of `"+r+"`":"using <"+o+">",friendlyStringify(e),friendlyStringify(t)):void 0)}}function assertValidProps(e,t){t&&("production"!==process.env.NODE_ENV&&voidElementTags[e._tag]&&("production"!==process.env.NODE_ENV?warning(null==t.children&&null==t.dangerouslySetInnerHTML,"%s is a void element tag and must not have `children` or use `props.dangerouslySetInnerHTML`.%s",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""):void 0),null!=t.dangerouslySetInnerHTML&&(null!=t.children?"production"!==process.env.NODE_ENV?invariant(!1,"Can only set one of `children` or `props.dangerouslySetInnerHTML`."):invariant(!1):void 0,"object"==typeof t.dangerouslySetInnerHTML&&HTML in t.dangerouslySetInnerHTML?void 0:"production"!==process.env.NODE_ENV?invariant(!1,"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information."):invariant(!1)),"production"!==process.env.NODE_ENV&&("production"!==process.env.NODE_ENV?warning(null==t.innerHTML,"Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."):void 0,"production"!==process.env.NODE_ENV?warning(!t.contentEditable||null==t.children,"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."):void 0),null!=t.style&&"object"!=typeof t.style?"production"!==process.env.NODE_ENV?invariant(!1,"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(e)):invariant(!1):void 0)}function enqueuePutListener(e,t,n,r){"production"!==process.env.NODE_ENV&&("production"!==process.env.NODE_ENV?warning("onScroll"!==t||isEventSupported("scroll",!0),"This browser doesn't support the `onScroll` event"):void 0);var o=ReactMount.findReactContainerForID(e);if(o){var a=o.nodeType===ELEMENT_NODE_TYPE?o.ownerDocument:o;listenTo(t,a)}r.getReactMountReady().enqueue(putListener,{id:e,registrationName:t,listener:n})}function putListener(){var e=this;ReactBrowserEventEmitter.putListener(e.id,e.registrationName,e.listener)}function trapBubbledEventsLocal(){var e=this;e._rootNodeID?void 0:"production"!==process.env.NODE_ENV?invariant(!1,"Must be mounted to trap events"):invariant(!1);var t=ReactMount.getNode(e._rootNodeID);switch(t?void 0:"production"!==process.env.NODE_ENV?invariant(!1,"trapBubbledEvent(...): Requires node to be rendered."):invariant(!1),e._tag){case"iframe":e._wrapperState.listeners=[ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad,"load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in mediaEvents)mediaEvents.hasOwnProperty(n)&&e._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[n],mediaEvents[n],t));break;case"img":e._wrapperState.listeners=[ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError,"error",t),ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad,"load",t)];break;case"form":e._wrapperState.listeners=[ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset,"reset",t),ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit,"submit",t)]}}function mountReadyInputWrapper(){ReactDOMInput.mountReadyWrapper(this)}function postUpdateSelectWrapper(){ReactDOMSelect.postUpdateWrapper(this)}function validateDangerousTag(e){hasOwnProperty.call(validatedTagCache,e)||(VALID_TAG_REGEX.test(e)?void 0:"production"!==process.env.NODE_ENV?invariant(!1,"Invalid tag: %s",e):invariant(!1),validatedTagCache[e]=!0)}function processChildContextDev(e,t){e=assign({},e);var n=e[validateDOMNesting.ancestorInfoContextKey];return e[validateDOMNesting.ancestorInfoContextKey]=validateDOMNesting.updatedAncestorInfo(n,t._tag,t),e}function isCustomComponent(e,t){return e.indexOf("-")>=0||null!=t.is}function ReactDOMComponent(e){validateDangerousTag(e),this._tag=e.toLowerCase(),this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._rootNodeID=null,this._wrapperState=null,this._topLevelWrapper=null,this._nodeWithLegacyProperties=null,"production"!==process.env.NODE_ENV&&(this._unprocessedContextDev=null,this._processedContextDev=null)}var AutoFocusUtils=require("./AutoFocusUtils"),CSSPropertyOperations=require("./CSSPropertyOperations"),DOMProperty=require("./DOMProperty"),DOMPropertyOperations=require("./DOMPropertyOperations"),EventConstants=require("./EventConstants"),ReactBrowserEventEmitter=require("./ReactBrowserEventEmitter"),ReactComponentBrowserEnvironment=require("./ReactComponentBrowserEnvironment"),ReactDOMButton=require("./ReactDOMButton"),ReactDOMInput=require("./ReactDOMInput"),ReactDOMOption=require("./ReactDOMOption"),ReactDOMSelect=require("./ReactDOMSelect"),ReactDOMTextarea=require("./ReactDOMTextarea"),ReactMount=require("./ReactMount"),ReactMultiChild=require("./ReactMultiChild"),ReactPerf=require("./ReactPerf"),ReactUpdateQueue=require("./ReactUpdateQueue"),assign=require("./Object.assign"),canDefineProperty=require("./canDefineProperty"),escapeTextContentForBrowser=require("./escapeTextContentForBrowser"),invariant=require("fbjs/lib/invariant"),isEventSupported=require("./isEventSupported"),keyOf=require("fbjs/lib/keyOf"),setInnerHTML=require("./setInnerHTML"),setTextContent=require("./setTextContent"),shallowEqual=require("fbjs/lib/shallowEqual"),validateDOMNesting=require("./validateDOMNesting"),warning=require("fbjs/lib/warning"),deleteListener=ReactBrowserEventEmitter.deleteListener,listenTo=ReactBrowserEventEmitter.listenTo,registrationNameModules=ReactBrowserEventEmitter.registrationNameModules,CONTENT_TYPES={string:!0,number:!0},CHILDREN=keyOf({children:null}),STYLE=keyOf({style:null}),HTML=keyOf({__html:null}),ELEMENT_NODE_TYPE=1,legacyPropsDescriptor;"production"!==process.env.NODE_ENV&&(legacyPropsDescriptor={props:{enumerable:!1,get:function(){var e=this._reactInternalComponent;return"production"!==process.env.NODE_ENV?warning(!1,"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(e)):void 0,e._currentElement.props}}});var styleMutationWarning={},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"},omittedCloseTags={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},newlineEatingTags={listing:!0,pre:!0,textarea:!0},voidElementTags=assign({menuitem:!0},omittedCloseTags),VALID_TAG_REGEX=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,validatedTagCache={},hasOwnProperty={}.hasOwnProperty;ReactDOMComponent.displayName="ReactDOMComponent",ReactDOMComponent.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e;var r=this._currentElement.props;switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},t.getReactMountReady().enqueue(trapBubbledEventsLocal,this);break;case"button":r=ReactDOMButton.getNativeProps(this,r,n);break;case"input":ReactDOMInput.mountWrapper(this,r,n),r=ReactDOMInput.getNativeProps(this,r,n);break;case"option":ReactDOMOption.mountWrapper(this,r,n),r=ReactDOMOption.getNativeProps(this,r,n);break;case"select":ReactDOMSelect.mountWrapper(this,r,n),r=ReactDOMSelect.getNativeProps(this,r,n),n=ReactDOMSelect.processChildContext(this,r,n);break;case"textarea":ReactDOMTextarea.mountWrapper(this,r,n),r=ReactDOMTextarea.getNativeProps(this,r,n)}assertValidProps(this,r),"production"!==process.env.NODE_ENV&&n[validateDOMNesting.ancestorInfoContextKey]&&validateDOMNesting(this._tag,this,n[validateDOMNesting.ancestorInfoContextKey]),"production"!==process.env.NODE_ENV&&(this._unprocessedContextDev=n,this._processedContextDev=processChildContextDev(n,this),n=this._processedContextDev);var o;if(t.useCreateElement){var a=n[ReactMount.ownerDocumentContextKey],i=a.createElement(this._currentElement.type);DOMPropertyOperations.setAttributeForID(i,this._rootNodeID),ReactMount.getID(i),this._updateDOMProperties({},r,t,i),this._createInitialChildren(t,r,n,i),o=i}else{var s=this._createOpenTagMarkupAndPutListeners(t,r),p=this._createContentMarkup(t,r,n);o=!p&&omittedCloseTags[this._tag]?s+"/>":s+">"+p+""}switch(this._tag){case"input":t.getReactMountReady().enqueue(mountReadyInputWrapper,this);case"button":case"select":case"textarea":r.autoFocus&&t.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent,this)}return o},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(null!=o)if(registrationNameModules.hasOwnProperty(r))o&&enqueuePutListener(this._rootNodeID,r,o,e);else{r===STYLE&&(o&&("production"!==process.env.NODE_ENV&&(this._previousStyle=o),o=this._previousStyleCopy=assign({},t.style)),o=CSSPropertyOperations.createMarkupForStyles(o));var a=null;null!=this._tag&&isCustomComponent(this._tag,t)?r!==CHILDREN&&(a=DOMPropertyOperations.createMarkupForCustomAttribute(r,o)):a=DOMPropertyOperations.createMarkupForProperty(r,o),a&&(n+=" "+a)}}if(e.renderToStaticMarkup)return n;var i=DOMPropertyOperations.createMarkupForID(this._rootNodeID);return n+" "+i},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var a=CONTENT_TYPES[typeof t.children]?t.children:null,i=null!=a?null:t.children;if(null!=a)r=escapeTextContentForBrowser(a);else if(null!=i){var s=this.mountChildren(i,e,n);r=s.join("")}}return newlineEatingTags[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&setInnerHTML(r,o.__html);else{var a=CONTENT_TYPES[typeof t.children]?t.children:null,i=null!=a?null:t.children;if(null!=a)setTextContent(r,a);else if(null!=i)for(var s=this.mountChildren(i,e,n),p=0;p tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg , , and ) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.",this._tag):invariant(!1)}if(this.unmountChildren(),ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID),ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null,this._wrapperState=null,this._nodeWithLegacyProperties){var n=this._nodeWithLegacyProperties;n._reactInternalComponent=null,this._nodeWithLegacyProperties=null}},getPublicInstance:function(){if(!this._nodeWithLegacyProperties){var e=ReactMount.getNode(this._rootNodeID);e._reactInternalComponent=this,e.getDOMNode=legacyGetDOMNode,e.isMounted=legacyIsMounted,e.setState=legacySetStateEtc,e.replaceState=legacySetStateEtc,e.forceUpdate=legacySetStateEtc,e.setProps=legacySetProps,e.replaceProps=legacyReplaceProps,"production"!==process.env.NODE_ENV&&canDefineProperty?Object.defineProperties(e,legacyPropsDescriptor):e.props=this._currentElement.props,this._nodeWithLegacyProperties=e}return this._nodeWithLegacyProperties}},ReactPerf.measureMethods(ReactDOMComponent,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),assign(ReactDOMComponent.prototype,ReactDOMComponent.Mixin,ReactMultiChild.Mixin),module.exports=ReactDOMComponent; }).call(this,require('_process')) -},{"./CSSPropertyOperations":311,"./DOMProperty":316,"./DOMPropertyOperations":317,"./Object.assign":334,"./ReactBrowserEventEmitter":338,"./ReactComponentBrowserEnvironment":345,"./ReactMount":382,"./ReactMultiChild":383,"./ReactPerf":387,"./escapeTextContentForBrowser":437,"./invariant":456,"./isEventSupported":457,"./keyOf":463,"./warning":477,"_process":498}],354:[function(require,module,exports){ -"use strict";var EventConstants=require("./EventConstants"),LocalEventTrapMixin=require("./LocalEventTrapMixin"),ReactBrowserComponentMixin=require("./ReactBrowserComponentMixin"),ReactClass=require("./ReactClass"),ReactElement=require("./ReactElement"),form=ReactElement.createFactory("form"),ReactDOMForm=ReactClass.createClass({displayName:"ReactDOMForm",tagName:"FORM",mixins:[ReactBrowserComponentMixin,LocalEventTrapMixin],render:function(){return form(this.props)},componentDidMount:function(){this.trapBubbledEvent(EventConstants.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit,"submit")}});module.exports=ReactDOMForm; - -},{"./EventConstants":321,"./LocalEventTrapMixin":332,"./ReactBrowserComponentMixin":337,"./ReactClass":343,"./ReactElement":368}],355:[function(require,module,exports){ +},{"./AutoFocusUtils":323,"./CSSPropertyOperations":326,"./DOMProperty":331,"./DOMPropertyOperations":332,"./EventConstants":336,"./Object.assign":344,"./ReactBrowserEventEmitter":348,"./ReactComponentBrowserEnvironment":353,"./ReactDOMButton":359,"./ReactDOMInput":364,"./ReactDOMOption":365,"./ReactDOMSelect":366,"./ReactDOMTextarea":370,"./ReactMount":388,"./ReactMultiChild":389,"./ReactPerf":394,"./ReactUpdateQueue":405,"./canDefineProperty":427,"./escapeTextContentForBrowser":430,"./isEventSupported":442,"./setInnerHTML":447,"./setTextContent":448,"./validateDOMNesting":452,"_process":311,"fbjs/lib/invariant":29,"fbjs/lib/keyOf":33,"fbjs/lib/shallowEqual":38,"fbjs/lib/warning":40}],361:[function(require,module,exports){ (function (process){ -"use strict";var CSSPropertyOperations=require("./CSSPropertyOperations"),DOMChildrenOperations=require("./DOMChildrenOperations"),DOMPropertyOperations=require("./DOMPropertyOperations"),ReactMount=require("./ReactMount"),ReactPerf=require("./ReactPerf"),invariant=require("./invariant"),setInnerHTML=require("./setInnerHTML"),INVALID_PROPERTY_ERRORS={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},ReactDOMIDOperations={updatePropertyByID:function(e,t,r){var n=ReactMount.getNode(e);"production"!==process.env.NODE_ENV?invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(t),"updatePropertyByID(...): %s",INVALID_PROPERTY_ERRORS[t]):invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(t)),null!=r?DOMPropertyOperations.setValueForProperty(n,t,r):DOMPropertyOperations.deleteValueForProperty(n,t)},deletePropertyByID:function(e,t,r){var n=ReactMount.getNode(e);"production"!==process.env.NODE_ENV?invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(t),"updatePropertyByID(...): %s",INVALID_PROPERTY_ERRORS[t]):invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(t)),DOMPropertyOperations.deleteValueForProperty(n,t,r)},updateStylesByID:function(e,t){var r=ReactMount.getNode(e);CSSPropertyOperations.setValueForStyles(r,t)},updateInnerHTMLByID:function(e,t){var r=ReactMount.getNode(e);setInnerHTML(r,t)},updateTextContentByID:function(e,t){var r=ReactMount.getNode(e);DOMChildrenOperations.updateTextContent(r,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var r=ReactMount.getNode(e);DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(r,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var r=0;ro;o++){var c=s[o];if(c!==i&&c.form===i.form){var l=ReactMount.getID(c);"production"!==process.env.NODE_ENV?invariant(l,"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."):invariant(l);var p=instancesByReactID[l];"production"!==process.env.NODE_ENV?invariant(p,"ReactDOMInput: Unknown radio button ID %s.",l):invariant(p),ReactUpdates.asap(forceUpdateIfMounted,p)}}}return t}});module.exports=ReactDOMInput; +"use strict";var DOMChildrenOperations=require("./DOMChildrenOperations"),DOMPropertyOperations=require("./DOMPropertyOperations"),ReactMount=require("./ReactMount"),ReactPerf=require("./ReactPerf"),invariant=require("fbjs/lib/invariant"),INVALID_PROPERTY_ERRORS={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},ReactDOMIDOperations={updatePropertyByID:function(e,r,t){var a=ReactMount.getNode(e);INVALID_PROPERTY_ERRORS.hasOwnProperty(r)?"production"!==process.env.NODE_ENV?invariant(!1,"updatePropertyByID(...): %s",INVALID_PROPERTY_ERRORS[r]):invariant(!1):void 0,null!=t?DOMPropertyOperations.setValueForProperty(a,r,t):DOMPropertyOperations.deleteValueForProperty(a,r)},dangerouslyReplaceNodeWithMarkupByID:function(e,r){var t=ReactMount.getNode(e);DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(t,r)},dangerouslyProcessChildrenUpdates:function(e,r){for(var t=0;t instead of setting `selected` on